We should use uid_eq() to compare uids, and GLOBAL_ROOT_UID as
the root uid.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
This has no practical effect, but in the wonderful future when user
namespaces work the current comparisons will fail to compile.

Ben.

 fs/aufs/inode.c |    2 +-
 fs/aufs/plink.c |    4 ++--
 fs/aufs/wkq.c   |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c
index af6a12a..5c2e48e 100644
--- a/fs/aufs/inode.c
+++ b/fs/aufs/inode.c
@@ -463,7 +463,7 @@ int au_test_ro(struct super_block *sb, aufs_bindex_t bindex,
 
 int au_test_h_perm(struct inode *h_inode, int mask)
 {
-       if (current_fsuid() == GLOBAL_ROOT_GID)
+       if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID))
                return 0;
        return inode_permission(h_inode, mask);
 }
diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c
index 0d1131b..7792680 100644
--- a/fs/aufs/plink.c
+++ b/fs/aufs/plink.c
@@ -237,7 +237,7 @@ struct dentry *au_plink_lkup(struct inode *inode, 
aufs_bindex_t bindex)
        h_dir = h_parent->d_inode;
        tgtname.len = plink_name(a, sizeof(a), inode, bindex);
 
-       if (current_fsuid() != GLOBAL_ROOT_GID) {
+       if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) {
                struct au_do_plink_lkup_args args = {
                        .errp           = &h_dentry,
                        .tgtname        = &tgtname,
@@ -322,7 +322,7 @@ static int whplink(struct dentry *h_dentry, struct inode 
*inode,
        tgtname.len = plink_name(a, sizeof(a), inode, bindex);
 
        /* always superio. */
-       if (current_fsuid() != GLOBAL_ROOT_GID) {
+       if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) {
                struct do_whplink_args args = {
                        .errp           = &err,
                        .tgt            = &tgtname,
diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c
index 49b59d2..07561ca 100644
--- a/fs/aufs/wkq.c
+++ b/fs/aufs/wkq.c
@@ -46,7 +46,7 @@ static void wkq_func(struct work_struct *wk)
 {
        struct au_wkinfo *wkinfo = container_of(wk, struct au_wkinfo, wk);
 
-       AuDebugOn(current_fsuid() != GLOBAL_ROOT_GID);
+       AuDebugOn(!uid_eq(current_fsuid(), GLOBAL_ROOT_UID));
        AuDebugOn(rlimit(RLIMIT_FSIZE) != RLIM_INFINITY);
 
        wkinfo->func(wkinfo->args);

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Reply via email to