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 dd1ed1b8e98e..a856e7f7b6e3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -680,7 +680,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
680 680
681 /* Allowed if owner and follower match. */ 681 /* Allowed if owner and follower match. */
682 inode = link->dentry->d_inode; 682 inode = link->dentry->d_inode;
683 if (current_cred()->fsuid == inode->i_uid) 683 if (uid_eq(current_cred()->fsuid, inode->i_uid))
684 return 0; 684 return 0;
685 685
686 /* Allowed if parent directory not sticky and world-writable. */ 686 /* Allowed if parent directory not sticky and world-writable. */
@@ -689,7 +689,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
689 return 0; 689 return 0;
690 690
691 /* Allowed if parent directory and link owner match. */ 691 /* Allowed if parent directory and link owner match. */
692 if (parent->i_uid == inode->i_uid) 692 if (uid_eq(parent->i_uid, inode->i_uid))
693 return 0; 693 return 0;
694 694
695 path_put_conditional(link, nd); 695 path_put_conditional(link, nd);
@@ -759,7 +759,7 @@ static int may_linkat(struct path *link)
759 /* Source inode owner (or CAP_FOWNER) can hardlink all they like, 759 /* Source inode owner (or CAP_FOWNER) can hardlink all they like,
760 * otherwise, it must be a safe source. 760 * otherwise, it must be a safe source.
761 */ 761 */
762 if (cred->fsuid == inode->i_uid || safe_hardlink_source(inode) || 762 if (uid_eq(cred->fsuid, inode->i_uid) || safe_hardlink_source(inode) ||
763 capable(CAP_FOWNER)) 763 capable(CAP_FOWNER))
764 return 0; 764 return 0;
765 765