aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 1b464390dde8..05480a64d7b7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -678,7 +678,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
678 678
679 /* Allowed if owner and follower match. */ 679 /* Allowed if owner and follower match. */
680 inode = link->dentry->d_inode; 680 inode = link->dentry->d_inode;
681 if (current_cred()->fsuid == inode->i_uid) 681 if (uid_eq(current_cred()->fsuid, inode->i_uid))
682 return 0; 682 return 0;
683 683
684 /* Allowed if parent directory not sticky and world-writable. */ 684 /* Allowed if parent directory not sticky and world-writable. */
@@ -687,7 +687,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
687 return 0; 687 return 0;
688 688
689 /* Allowed if parent directory and link owner match. */ 689 /* Allowed if parent directory and link owner match. */
690 if (parent->i_uid == inode->i_uid) 690 if (uid_eq(parent->i_uid, inode->i_uid))
691 return 0; 691 return 0;
692 692
693 path_put_conditional(link, nd); 693 path_put_conditional(link, nd);
@@ -757,7 +757,7 @@ static int may_linkat(struct path *link)
757 /* Source inode owner (or CAP_FOWNER) can hardlink all they like, 757 /* Source inode owner (or CAP_FOWNER) can hardlink all they like,
758 * otherwise, it must be a safe source. 758 * otherwise, it must be a safe source.
759 */ 759 */
760 if (cred->fsuid == inode->i_uid || safe_hardlink_source(inode) || 760 if (uid_eq(cred->fsuid, inode->i_uid) || safe_hardlink_source(inode) ||
761 capable(CAP_FOWNER)) 761 capable(CAP_FOWNER))
762 return 0; 762 return 0;
763 763