diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-03-04 00:17:15 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-03 06:29:34 -0400 |
commit | 8e96e3b7b8407be794ab1fd8e4b332818a358e78 (patch) | |
tree | f27756bb2ec49e586221ac669ea00c68e8a2ee58 /fs/namei.c | |
parent | 72cda3d1ef24ab0a9a89c15e9776ca737b75f45a (diff) |
userns: Use uid_eq gid_eq helpers when comparing kuids and kgids in the vfs
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 941c4362e298..86512b4d38fd 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -228,7 +228,7 @@ static int acl_permission_check(struct inode *inode, int mask) | |||
228 | { | 228 | { |
229 | unsigned int mode = inode->i_mode; | 229 | unsigned int mode = inode->i_mode; |
230 | 230 | ||
231 | if (likely(current_fsuid() == inode->i_uid)) | 231 | if (likely(uid_eq(current_fsuid(), inode->i_uid))) |
232 | mode >>= 6; | 232 | mode >>= 6; |
233 | else { | 233 | else { |
234 | if (IS_POSIXACL(inode) && (mode & S_IRWXG)) { | 234 | if (IS_POSIXACL(inode) && (mode & S_IRWXG)) { |
@@ -1956,13 +1956,13 @@ static int user_path_parent(int dfd, const char __user *path, | |||
1956 | */ | 1956 | */ |
1957 | static inline int check_sticky(struct inode *dir, struct inode *inode) | 1957 | static inline int check_sticky(struct inode *dir, struct inode *inode) |
1958 | { | 1958 | { |
1959 | uid_t fsuid = current_fsuid(); | 1959 | kuid_t fsuid = current_fsuid(); |
1960 | 1960 | ||
1961 | if (!(dir->i_mode & S_ISVTX)) | 1961 | if (!(dir->i_mode & S_ISVTX)) |
1962 | return 0; | 1962 | return 0; |
1963 | if (inode->i_uid == fsuid) | 1963 | if (uid_eq(inode->i_uid, fsuid)) |
1964 | return 0; | 1964 | return 0; |
1965 | if (dir->i_uid == fsuid) | 1965 | if (uid_eq(dir->i_uid, fsuid)) |
1966 | return 0; | 1966 | return 0; |
1967 | return !inode_capable(inode, CAP_FOWNER); | 1967 | return !inode_capable(inode, CAP_FOWNER); |
1968 | } | 1968 | } |