diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-10 23:17:44 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-18 04:01:35 -0400 |
commit | 5f3a4a28ec140a90e6058d1d09f6b1f235d485e5 (patch) | |
tree | a8fc30f22d94033bd5bb4ccfe5218b01bfafcc50 /fs/ext2 | |
parent | 2f6f0654ab61961fd0f7701fe3be89ea111f0cda (diff) |
userns: Pass a userns parameter into posix_acl_to_xattr and posix_acl_from_xattr
- Pass the user namespace the uid and gid values in the xattr are stored
in into posix_acl_from_xattr.
- Pass the user namespace kuid and kgid values should be converted into
when storing uid and gid values in an xattr in posix_acl_to_xattr.
- Modify all callers of posix_acl_from_xattr and posix_acl_to_xattr to
pass in &init_user_ns.
In the short term this change is not strictly needed but it makes the
code clearer. In the longer term this change is necessary to be able to
mount filesystems outside of the initial user namespace that natively
store posix acls in the linux xattr format.
Cc: Theodore Tso <tytso@mit.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/acl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 35d6a3cfd9ff..70bb1bccc957 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -350,7 +350,7 @@ ext2_xattr_get_acl(struct dentry *dentry, const char *name, void *buffer, | |||
350 | return PTR_ERR(acl); | 350 | return PTR_ERR(acl); |
351 | if (acl == NULL) | 351 | if (acl == NULL) |
352 | return -ENODATA; | 352 | return -ENODATA; |
353 | error = posix_acl_to_xattr(acl, buffer, size); | 353 | error = posix_acl_to_xattr(&init_user_ns, acl, buffer, size); |
354 | posix_acl_release(acl); | 354 | posix_acl_release(acl); |
355 | 355 | ||
356 | return error; | 356 | return error; |
@@ -371,7 +371,7 @@ ext2_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, | |||
371 | return -EPERM; | 371 | return -EPERM; |
372 | 372 | ||
373 | if (value) { | 373 | if (value) { |
374 | acl = posix_acl_from_xattr(value, size); | 374 | acl = posix_acl_from_xattr(&init_user_ns, value, size); |
375 | if (IS_ERR(acl)) | 375 | if (IS_ERR(acl)) |
376 | return PTR_ERR(acl); | 376 | return PTR_ERR(acl); |
377 | else if (acl) { | 377 | else if (acl) { |