aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/auth.c')
-rw-r--r--fs/nfsd/auth.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 79717a40dab..34a10d78b83 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -1,6 +1,7 @@
1/* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> */ 1/* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> */
2 2
3#include <linux/sched.h> 3#include <linux/sched.h>
4#include <linux/user_namespace.h>
4#include "nfsd.h" 5#include "nfsd.h"
5#include "auth.h" 6#include "auth.h"
6 7
@@ -10,7 +11,7 @@ int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
10 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; 11 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
11 12
12 for (f = exp->ex_flavors; f < end; f++) { 13 for (f = exp->ex_flavors; f < end; f++) {
13 if (f->pseudoflavor == rqstp->rq_flavor) 14 if (f->pseudoflavor == rqstp->rq_cred.cr_flavor)
14 return f->flags; 15 return f->flags;
15 } 16 }
16 return exp->ex_flags; 17 return exp->ex_flags;
@@ -56,8 +57,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
56 goto oom; 57 goto oom;
57 58
58 for (i = 0; i < rqgi->ngroups; i++) { 59 for (i = 0; i < rqgi->ngroups; i++) {
59 if (!GROUP_AT(rqgi, i)) 60 if (gid_eq(GLOBAL_ROOT_GID, GROUP_AT(rqgi, i)))
60 GROUP_AT(gi, i) = exp->ex_anon_gid; 61 GROUP_AT(gi, i) = make_kgid(&init_user_ns, exp->ex_anon_gid);
61 else 62 else
62 GROUP_AT(gi, i) = GROUP_AT(rqgi, i); 63 GROUP_AT(gi, i) = GROUP_AT(rqgi, i);
63 } 64 }