summaryrefslogtreecommitdiffstats
path: root/fs/fat/file.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-02-07 16:25:39 -0800
committerEric W. Biederman <ebiederm@xmission.com>2012-09-20 06:11:55 -0700
commit170782eb89462d30302cec12378253115b492b38 (patch)
treeeff2d455057fcd084071487139ba89521f287032 /fs/fat/file.c
parent1a06d420ce9d60b98f5bdf5fd6e4200abfbd3c35 (diff)
downloadlinux-stable-170782eb89462d30302cec12378253115b492b38.tar.gz
linux-stable-170782eb89462d30302cec12378253115b492b38.tar.bz2
linux-stable-170782eb89462d30302cec12378253115b492b38.zip
userns: Convert fat to use kuid/kgid where appropriate
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r--fs/fat/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index e007b8bd8e5e..a62e0ecbe2db 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -352,7 +352,7 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
{
umode_t allow_utime = sbi->options.allow_utime;
- if (current_fsuid() != inode->i_uid) {
+ if (!uid_eq(current_fsuid(), inode->i_uid)) {
if (in_group_p(inode->i_gid))
allow_utime >>= 3;
if (allow_utime & MAY_WRITE)
@@ -407,9 +407,9 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
}
if (((attr->ia_valid & ATTR_UID) &&
- (attr->ia_uid != sbi->options.fs_uid)) ||
+ (!uid_eq(attr->ia_uid, sbi->options.fs_uid))) ||
((attr->ia_valid & ATTR_GID) &&
- (attr->ia_gid != sbi->options.fs_gid)) ||
+ (!gid_eq(attr->ia_gid, sbi->options.fs_gid))) ||
((attr->ia_valid & ATTR_MODE) &&
(attr->ia_mode & ~FAT_VALID_MODE)))
error = -EPERM;