diff options
author | Andy Adamson <andros@citi.umich.edu> | 2007-07-17 07:04:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:07 -0400 |
commit | c4170583f655dca5da32bd14173d6a93805fc48b (patch) | |
tree | 6dbac34d8dd59af4a2f096a9c842405887c4f027 | |
parent | 42ed95c4e7415714aaab604ae7b1602b87b27b73 (diff) |
knfsd: nfsd4: store pseudoflavor in request
Add a new field to the svc_rqst structure to record the pseudoflavor that the
request was made with. For now we record the pseudoflavor but don't use it
for anything.
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/sunrpc/gss_api.h | 1 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 1 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_mech_switch.c | 14 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 3 |
5 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index bbac101ac372..459c5fc11d51 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -58,6 +58,7 @@ u32 gss_unwrap( | |||
58 | u32 gss_delete_sec_context( | 58 | u32 gss_delete_sec_context( |
59 | struct gss_ctx **ctx_id); | 59 | struct gss_ctx **ctx_id); |
60 | 60 | ||
61 | u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); | ||
61 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); | 62 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); |
62 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | 63 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); |
63 | 64 | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 129d50f2225c..705a90aa345e 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -212,6 +212,7 @@ struct svc_rqst { | |||
212 | struct svc_pool * rq_pool; /* thread pool */ | 212 | struct svc_pool * rq_pool; /* thread pool */ |
213 | struct svc_procedure * rq_procinfo; /* procedure info */ | 213 | struct svc_procedure * rq_procinfo; /* procedure info */ |
214 | struct auth_ops * rq_authop; /* authentication flavour */ | 214 | struct auth_ops * rq_authop; /* authentication flavour */ |
215 | u32 rq_flavor; /* pseudoflavor */ | ||
215 | struct svc_cred rq_cred; /* auth info */ | 216 | struct svc_cred rq_cred; /* auth info */ |
216 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ | 217 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ |
217 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ | 218 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ |
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index 26872517ccf3..61801a069ff0 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c | |||
@@ -194,6 +194,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor) | |||
194 | EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor); | 194 | EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor); |
195 | 195 | ||
196 | u32 | 196 | u32 |
197 | gss_svc_to_pseudoflavor(struct gss_api_mech *gm, u32 service) | ||
198 | { | ||
199 | int i; | ||
200 | |||
201 | for (i = 0; i < gm->gm_pf_num; i++) { | ||
202 | if (gm->gm_pfs[i].service == service) { | ||
203 | return gm->gm_pfs[i].pseudoflavor; | ||
204 | } | ||
205 | } | ||
206 | return RPC_AUTH_MAXFLAVOR; /* illegal value */ | ||
207 | } | ||
208 | EXPORT_SYMBOL(gss_svc_to_pseudoflavor); | ||
209 | |||
210 | u32 | ||
197 | gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor) | 211 | gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor) |
198 | { | 212 | { |
199 | int i; | 213 | int i; |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index c094583386fd..7a3e1758bea1 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -1131,6 +1131,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
1131 | } | 1131 | } |
1132 | svcdata->rsci = rsci; | 1132 | svcdata->rsci = rsci; |
1133 | cache_get(&rsci->h); | 1133 | cache_get(&rsci->h); |
1134 | rqstp->rq_flavor = gss_svc_to_pseudoflavor( | ||
1135 | rsci->mechctx->mech_type, gc->gc_svc); | ||
1134 | ret = SVC_OK; | 1136 | ret = SVC_OK; |
1135 | goto out; | 1137 | goto out; |
1136 | } | 1138 | } |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 07dcd20cbee4..d9fdf2e4d242 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/sunrpc/xdr.h> | 5 | #include <linux/sunrpc/xdr.h> |
6 | #include <linux/sunrpc/svcsock.h> | 6 | #include <linux/sunrpc/svcsock.h> |
7 | #include <linux/sunrpc/svcauth.h> | 7 | #include <linux/sunrpc/svcauth.h> |
8 | #include <linux/sunrpc/gss_api.h> | ||
8 | #include <linux/err.h> | 9 | #include <linux/err.h> |
9 | #include <linux/seq_file.h> | 10 | #include <linux/seq_file.h> |
10 | #include <linux/hash.h> | 11 | #include <linux/hash.h> |
@@ -707,6 +708,7 @@ svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
707 | svc_putnl(resv, RPC_AUTH_NULL); | 708 | svc_putnl(resv, RPC_AUTH_NULL); |
708 | svc_putnl(resv, 0); | 709 | svc_putnl(resv, 0); |
709 | 710 | ||
711 | rqstp->rq_flavor = RPC_AUTH_NULL; | ||
710 | return SVC_OK; | 712 | return SVC_OK; |
711 | } | 713 | } |
712 | 714 | ||
@@ -784,6 +786,7 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
784 | svc_putnl(resv, RPC_AUTH_NULL); | 786 | svc_putnl(resv, RPC_AUTH_NULL); |
785 | svc_putnl(resv, 0); | 787 | svc_putnl(resv, 0); |
786 | 788 | ||
789 | rqstp->rq_flavor = RPC_AUTH_UNIX; | ||
787 | return SVC_OK; | 790 | return SVC_OK; |
788 | 791 | ||
789 | badcred: | 792 | badcred: |