diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-06 13:53:25 +0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 19:28:51 +0400 |
commit | 4a2c8cf56953a6ebe3c8671433607b7f96f200d5 (patch) | |
tree | 307523cb5ac706ab182cd2942a47895dc1647373 /fs/cifs/inode.c | |
parent | 6d4a083205c27bc2e2a1c03dff4acf2fe457d1c4 (diff) | |
download | linux-4a2c8cf56953a6ebe3c8671433607b7f96f200d5.tar.xz |
cifs: Convert struct cifs_fattr to use kuid and kgids
In cifs_unix_to_basic_fattr only update the cifs_fattr with an id if
it is valid after conversion.
Cc: Steve French <smfrench@gmail.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 737643940540..9638233964fc 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -247,15 +247,21 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info, fattr->cf_uid = cifs_sb->mnt_uid; if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)) { u64 id = le64_to_cpu(info->Uid); - if (id < ((uid_t)-1)) - fattr->cf_uid = id; + if (id < ((uid_t)-1)) { + kuid_t uid = make_kuid(&init_user_ns, id); + if (uid_valid(uid)) + fattr->cf_uid = uid; + } } fattr->cf_gid = cifs_sb->mnt_gid; if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)) { u64 id = le64_to_cpu(info->Gid); - if (id < ((gid_t)-1)) - fattr->cf_gid = id; + if (id < ((gid_t)-1)) { + kgid_t gid = make_kgid(&init_user_ns, id); + if (gid_valid(gid)) + fattr->cf_gid = gid; + } } fattr->cf_nlink = le64_to_cpu(info->Nlinks); |