]> Pileus Git - ~andy/linux/blobdiff - fs/nfsd/auth.c
wil6210: use WLAN_CAPABILITY_DMG_TYPE_MASK
[~andy/linux] / fs / nfsd / auth.c
index 34a10d78b839f4c73b3d851e19820bc712129f36..06cddd57226453ef80e8839b5243912dd82df365 100644 (file)
@@ -47,9 +47,9 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
                if (!gi)
                        goto oom;
        } else if (flags & NFSEXP_ROOTSQUASH) {
-               if (!new->fsuid)
+               if (uid_eq(new->fsuid, GLOBAL_ROOT_UID))
                        new->fsuid = exp->ex_anon_uid;
-               if (!new->fsgid)
+               if (gid_eq(new->fsgid, GLOBAL_ROOT_GID))
                        new->fsgid = exp->ex_anon_gid;
 
                gi = groups_alloc(rqgi->ngroups);
@@ -58,7 +58,7 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 
                for (i = 0; i < rqgi->ngroups; i++) {
                        if (gid_eq(GLOBAL_ROOT_GID, GROUP_AT(rqgi, i)))
-                               GROUP_AT(gi, i) = make_kgid(&init_user_ns, exp->ex_anon_gid);
+                               GROUP_AT(gi, i) = exp->ex_anon_gid;
                        else
                                GROUP_AT(gi, i) = GROUP_AT(rqgi, i);
                }
@@ -66,9 +66,9 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
                gi = get_group_info(rqgi);
        }
 
-       if (new->fsuid == (uid_t) -1)
+       if (uid_eq(new->fsuid, INVALID_UID))
                new->fsuid = exp->ex_anon_uid;
-       if (new->fsgid == (gid_t) -1)
+       if (gid_eq(new->fsgid, INVALID_GID))
                new->fsgid = exp->ex_anon_gid;
 
        ret = set_groups(new, gi);
@@ -76,7 +76,7 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
        if (ret < 0)
                goto error;
 
-       if (new->fsuid)
+       if (!uid_eq(new->fsuid, GLOBAL_ROOT_UID))
                new->cap_effective = cap_drop_nfsd_set(new->cap_effective);
        else
                new->cap_effective = cap_raise_nfsd_set(new->cap_effective,