diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-09 12:10:30 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-15 17:08:35 -0400 |
commit | a7c1938e22c02b008655524c766d185ae99d9d53 (patch) | |
tree | f6b862a5d187908007614e5537f4cd1e31a40df4 /fs/compat.c | |
parent | 52137abe1820196d956bfd51edebc571b3427deb (diff) |
userns: Convert stat to return values mapped from kuids and kgids
- Store uids and gids with kuid_t and kgid_t in struct kstat
- Convert uid and gids to userspace usable values with
from_kuid and from_kgid
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/compat.c b/fs/compat.c index f2944ace7a7b..0781e619a62a 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -144,8 +144,8 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) | |||
144 | tmp.st_nlink = stat->nlink; | 144 | tmp.st_nlink = stat->nlink; |
145 | if (tmp.st_nlink != stat->nlink) | 145 | if (tmp.st_nlink != stat->nlink) |
146 | return -EOVERFLOW; | 146 | return -EOVERFLOW; |
147 | SET_UID(tmp.st_uid, stat->uid); | 147 | SET_UID(tmp.st_uid, from_kuid_munged(current_user_ns(), stat->uid)); |
148 | SET_GID(tmp.st_gid, stat->gid); | 148 | SET_GID(tmp.st_gid, from_kgid_munged(current_user_ns(), stat->gid)); |
149 | tmp.st_rdev = old_encode_dev(stat->rdev); | 149 | tmp.st_rdev = old_encode_dev(stat->rdev); |
150 | if ((u64) stat->size > MAX_NON_LFS) | 150 | if ((u64) stat->size > MAX_NON_LFS) |
151 | return -EOVERFLOW; | 151 | return -EOVERFLOW; |