aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/auth.c2
-rw-r--r--fs/nfsd/export.c6
-rw-r--r--fs/nfsd/nfs4idmap.c4
-rw-r--r--fs/nfsd/nfs4state.c6
-rw-r--r--include/linux/sunrpc/svc.h1
-rw-r--r--include/linux/sunrpc/svcauth.h1
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
-rw-r--r--net/sunrpc/svcauth_unix.c4
8 files changed, 13 insertions, 13 deletions
diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 79717a40daba..b42eaf3aac16 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -10,7 +10,7 @@ int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
10 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; 10 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
11 11
12 for (f = exp->ex_flavors; f < end; f++) { 12 for (f = exp->ex_flavors; f < end; f++) {
13 if (f->pseudoflavor == rqstp->rq_flavor) 13 if (f->pseudoflavor == rqstp->rq_cred.cr_flavor)
14 return f->flags; 14 return f->flags;
15 } 15 }
16 return exp->ex_flags; 16 return exp->ex_flags;
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index ec16364f782e..ba233499b9a5 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -904,13 +904,13 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
904 return 0; 904 return 0;
905 /* ip-address based client; check sec= export option: */ 905 /* ip-address based client; check sec= export option: */
906 for (f = exp->ex_flavors; f < end; f++) { 906 for (f = exp->ex_flavors; f < end; f++) {
907 if (f->pseudoflavor == rqstp->rq_flavor) 907 if (f->pseudoflavor == rqstp->rq_cred.cr_flavor)
908 return 0; 908 return 0;
909 } 909 }
910 /* defaults in absence of sec= options: */ 910 /* defaults in absence of sec= options: */
911 if (exp->ex_nflavors == 0) { 911 if (exp->ex_nflavors == 0) {
912 if (rqstp->rq_flavor == RPC_AUTH_NULL || 912 if (rqstp->rq_cred.cr_flavor == RPC_AUTH_NULL ||
913 rqstp->rq_flavor == RPC_AUTH_UNIX) 913 rqstp->rq_cred.cr_flavor == RPC_AUTH_UNIX)
914 return 0; 914 return 0;
915 } 915 }
916 return nfserr_wrongsec; 916 return nfserr_wrongsec;
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 286a7f8f2024..dae36f1dee95 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -605,7 +605,7 @@ numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namel
605static __be32 605static __be32
606do_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, uid_t *id) 606do_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, uid_t *id)
607{ 607{
608 if (nfs4_disable_idmapping && rqstp->rq_flavor < RPC_AUTH_GSS) 608 if (nfs4_disable_idmapping && rqstp->rq_cred.cr_flavor < RPC_AUTH_GSS)
609 if (numeric_name_to_id(rqstp, type, name, namelen, id)) 609 if (numeric_name_to_id(rqstp, type, name, namelen, id))
610 return 0; 610 return 0;
611 /* 611 /*
@@ -618,7 +618,7 @@ do_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, u
618static int 618static int
619do_id_to_name(struct svc_rqst *rqstp, int type, uid_t id, char *name) 619do_id_to_name(struct svc_rqst *rqstp, int type, uid_t id, char *name)
620{ 620{
621 if (nfs4_disable_idmapping && rqstp->rq_flavor < RPC_AUTH_GSS) 621 if (nfs4_disable_idmapping && rqstp->rq_cred.cr_flavor < RPC_AUTH_GSS)
622 return sprintf(name, "%u", id); 622 return sprintf(name, "%u", id);
623 return idmap_id_to_name(rqstp, type, id, name); 623 return idmap_id_to_name(rqstp, type, id, name);
624} 624}
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6dc0cfb37541..c743cdf51ebc 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1177,6 +1177,7 @@ static int copy_cred(struct svc_cred *target, struct svc_cred *source)
1177 return -ENOMEM; 1177 return -ENOMEM;
1178 } else 1178 } else
1179 target->cr_principal = NULL; 1179 target->cr_principal = NULL;
1180 target->cr_flavor = source->cr_flavor;
1180 target->cr_uid = source->cr_uid; 1181 target->cr_uid = source->cr_uid;
1181 target->cr_gid = source->cr_gid; 1182 target->cr_gid = source->cr_gid;
1182 target->cr_group_info = source->cr_group_info; 1183 target->cr_group_info = source->cr_group_info;
@@ -1213,11 +1214,11 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2)
1213 return true; 1214 return true;
1214} 1215}
1215 1216
1216/* XXX what about NGROUP */
1217static int 1217static int
1218same_creds(struct svc_cred *cr1, struct svc_cred *cr2) 1218same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
1219{ 1219{
1220 if ((cr1->cr_uid != cr2->cr_uid) 1220 if ((cr1->cr_flavor != cr2->cr_flavor)
1221 || (cr1->cr_uid != cr2->cr_uid)
1221 || (cr1->cr_gid != cr2->cr_gid) 1222 || (cr1->cr_gid != cr2->cr_gid)
1222 || !groups_equal(cr1->cr_group_info, cr2->cr_group_info)) 1223 || !groups_equal(cr1->cr_group_info, cr2->cr_group_info))
1223 return false; 1224 return false;
@@ -1299,7 +1300,6 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
1299 rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); 1300 rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table");
1300 copy_verf(clp, verf); 1301 copy_verf(clp, verf);
1301 rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa); 1302 rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa);
1302 clp->cl_flavor = rqstp->rq_flavor;
1303 gen_confirm(clp); 1303 gen_confirm(clp);
1304 clp->cl_cb_session = NULL; 1304 clp->cl_cb_session = NULL;
1305 return clp; 1305 return clp;
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 2b43e0214261..40e0a273faea 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -232,7 +232,6 @@ struct svc_rqst {
232 struct svc_pool * rq_pool; /* thread pool */ 232 struct svc_pool * rq_pool; /* thread pool */
233 struct svc_procedure * rq_procinfo; /* procedure info */ 233 struct svc_procedure * rq_procinfo; /* procedure info */
234 struct auth_ops * rq_authop; /* authentication flavour */ 234 struct auth_ops * rq_authop; /* authentication flavour */
235 u32 rq_flavor; /* pseudoflavor */
236 struct svc_cred rq_cred; /* auth info */ 235 struct svc_cred rq_cred; /* auth info */
237 void * rq_xprt_ctxt; /* transport specific context ptr */ 236 void * rq_xprt_ctxt; /* transport specific context ptr */
238 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ 237 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 16fe477a96e0..dd74084a9799 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -21,6 +21,7 @@ struct svc_cred {
21 uid_t cr_uid; 21 uid_t cr_uid;
22 gid_t cr_gid; 22 gid_t cr_gid;
23 struct group_info *cr_group_info; 23 struct group_info *cr_group_info;
24 u32 cr_flavor; /* pseudoflavor */
24 char *cr_principal; /* for gss */ 25 char *cr_principal; /* for gss */
25}; 26};
26 27
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index d091d7d09bea..bcb773781ec0 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1202,7 +1202,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1202 } 1202 }
1203 svcdata->rsci = rsci; 1203 svcdata->rsci = rsci;
1204 cache_get(&rsci->h); 1204 cache_get(&rsci->h);
1205 rqstp->rq_flavor = gss_svc_to_pseudoflavor( 1205 rqstp->rq_cred.cr_flavor = gss_svc_to_pseudoflavor(
1206 rsci->mechctx->mech_type, gc->gc_svc); 1206 rsci->mechctx->mech_type, gc->gc_svc);
1207 ret = SVC_OK; 1207 ret = SVC_OK;
1208 goto out; 1208 goto out;
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 12e4897d0bf3..88962cf34377 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -768,7 +768,7 @@ svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp)
768 svc_putnl(resv, RPC_AUTH_NULL); 768 svc_putnl(resv, RPC_AUTH_NULL);
769 svc_putnl(resv, 0); 769 svc_putnl(resv, 0);
770 770
771 rqstp->rq_flavor = RPC_AUTH_NULL; 771 rqstp->rq_cred.cr_flavor = RPC_AUTH_NULL;
772 return SVC_OK; 772 return SVC_OK;
773} 773}
774 774
@@ -839,7 +839,7 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp)
839 svc_putnl(resv, RPC_AUTH_NULL); 839 svc_putnl(resv, RPC_AUTH_NULL);
840 svc_putnl(resv, 0); 840 svc_putnl(resv, 0);
841 841
842 rqstp->rq_flavor = RPC_AUTH_UNIX; 842 rqstp->rq_cred.cr_flavor = RPC_AUTH_UNIX;
843 return SVC_OK; 843 return SVC_OK;
844 844
845badcred: 845badcred: