From bbc3bbd475bfeeea443f63077fb2961e578cd19c Mon Sep 17 00:00:00 2001 From: Andy Adamson Date: Tue, 17 Jul 2007 04:04:42 -0700 Subject: [PATCH] --- yaml --- r: 60831 b: refs/heads/master c: c4170583f655dca5da32bd14173d6a93805fc48b h: refs/heads/master i: 60829: 55c38b6a9f1a894ae8bba340c4d98e3fd1307444 60827: 4c32a83e5046d390eb4ba734a9bbff30e4dcce25 60823: 9a5faf77ccbc16bef0ec2e26f688fb0680f81fbb 60815: ed37d1468b4b0d9b36bf2c4bf48116b6623e6436 60799: e2988f434a25fa87161f6a25a008bcdeed4189b2 v: v3 --- [refs] | 2 +- trunk/include/linux/sunrpc/gss_api.h | 1 + trunk/include/linux/sunrpc/svc.h | 1 + trunk/net/sunrpc/auth_gss/gss_mech_switch.c | 14 ++++++++++++++ trunk/net/sunrpc/auth_gss/svcauth_gss.c | 2 ++ trunk/net/sunrpc/svcauth_unix.c | 3 +++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 2ef850230bd2..91ef604c5fa7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 42ed95c4e7415714aaab604ae7b1602b87b27b73 +refs/heads/master: c4170583f655dca5da32bd14173d6a93805fc48b diff --git a/trunk/include/linux/sunrpc/gss_api.h b/trunk/include/linux/sunrpc/gss_api.h index bbac101ac372..459c5fc11d51 100644 --- a/trunk/include/linux/sunrpc/gss_api.h +++ b/trunk/include/linux/sunrpc/gss_api.h @@ -58,6 +58,7 @@ u32 gss_unwrap( u32 gss_delete_sec_context( struct gss_ctx **ctx_id); +u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); diff --git a/trunk/include/linux/sunrpc/svc.h b/trunk/include/linux/sunrpc/svc.h index 129d50f2225c..705a90aa345e 100644 --- a/trunk/include/linux/sunrpc/svc.h +++ b/trunk/include/linux/sunrpc/svc.h @@ -212,6 +212,7 @@ struct svc_rqst { struct svc_pool * rq_pool; /* thread pool */ struct svc_procedure * rq_procinfo; /* procedure info */ struct auth_ops * rq_authop; /* authentication flavour */ + u32 rq_flavor; /* pseudoflavor */ struct svc_cred rq_cred; /* auth info */ struct sk_buff * rq_skbuff; /* fast recv inet buffer */ struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ diff --git a/trunk/net/sunrpc/auth_gss/gss_mech_switch.c b/trunk/net/sunrpc/auth_gss/gss_mech_switch.c index 26872517ccf3..61801a069ff0 100644 --- a/trunk/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/trunk/net/sunrpc/auth_gss/gss_mech_switch.c @@ -193,6 +193,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor) EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor); +u32 +gss_svc_to_pseudoflavor(struct gss_api_mech *gm, u32 service) +{ + int i; + + for (i = 0; i < gm->gm_pf_num; i++) { + if (gm->gm_pfs[i].service == service) { + return gm->gm_pfs[i].pseudoflavor; + } + } + return RPC_AUTH_MAXFLAVOR; /* illegal value */ +} +EXPORT_SYMBOL(gss_svc_to_pseudoflavor); + u32 gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor) { diff --git a/trunk/net/sunrpc/auth_gss/svcauth_gss.c b/trunk/net/sunrpc/auth_gss/svcauth_gss.c index c094583386fd..7a3e1758bea1 100644 --- a/trunk/net/sunrpc/auth_gss/svcauth_gss.c +++ b/trunk/net/sunrpc/auth_gss/svcauth_gss.c @@ -1131,6 +1131,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) } svcdata->rsci = rsci; cache_get(&rsci->h); + rqstp->rq_flavor = gss_svc_to_pseudoflavor( + rsci->mechctx->mech_type, gc->gc_svc); ret = SVC_OK; goto out; } diff --git a/trunk/net/sunrpc/svcauth_unix.c b/trunk/net/sunrpc/svcauth_unix.c index 07dcd20cbee4..d9fdf2e4d242 100644 --- a/trunk/net/sunrpc/svcauth_unix.c +++ b/trunk/net/sunrpc/svcauth_unix.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -707,6 +708,7 @@ svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp) svc_putnl(resv, RPC_AUTH_NULL); svc_putnl(resv, 0); + rqstp->rq_flavor = RPC_AUTH_NULL; return SVC_OK; } @@ -784,6 +786,7 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp) svc_putnl(resv, RPC_AUTH_NULL); svc_putnl(resv, 0); + rqstp->rq_flavor = RPC_AUTH_UNIX; return SVC_OK; badcred: