diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-05-14 19:55:22 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:29:55 -0400 |
commit | 03a4e1f6ddf25f48848e1bddcffc0ad489648331 (patch) | |
tree | f140e3deb767d092eca997037ebb7b098d8afce9 /net/sunrpc/auth_gss/svcauth_gss.c | |
parent | 631fc9ea05c97e5d1d14ea58a7347be4857d09da (diff) |
nfsd4: move principal name into svc_cred
Instead of keeping the principal name associated with a request in a
structure that's private to auth_gss and using an accessor function,
move it to svc_cred.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index f0a0cd4470b7..d091d7d09bea 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -335,7 +335,6 @@ struct rsc { | |||
335 | struct svc_cred cred; | 335 | struct svc_cred cred; |
336 | struct gss_svc_seq_data seqdata; | 336 | struct gss_svc_seq_data seqdata; |
337 | struct gss_ctx *mechctx; | 337 | struct gss_ctx *mechctx; |
338 | char *client_name; | ||
339 | }; | 338 | }; |
340 | 339 | ||
341 | static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old); | 340 | static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old); |
@@ -346,9 +345,7 @@ static void rsc_free(struct rsc *rsci) | |||
346 | kfree(rsci->handle.data); | 345 | kfree(rsci->handle.data); |
347 | if (rsci->mechctx) | 346 | if (rsci->mechctx) |
348 | gss_delete_sec_context(&rsci->mechctx); | 347 | gss_delete_sec_context(&rsci->mechctx); |
349 | if (rsci->cred.cr_group_info) | 348 | free_svc_cred(&rsci->cred); |
350 | put_group_info(rsci->cred.cr_group_info); | ||
351 | kfree(rsci->client_name); | ||
352 | } | 349 | } |
353 | 350 | ||
354 | static void rsc_put(struct kref *ref) | 351 | static void rsc_put(struct kref *ref) |
@@ -386,7 +383,7 @@ rsc_init(struct cache_head *cnew, struct cache_head *ctmp) | |||
386 | tmp->handle.data = NULL; | 383 | tmp->handle.data = NULL; |
387 | new->mechctx = NULL; | 384 | new->mechctx = NULL; |
388 | new->cred.cr_group_info = NULL; | 385 | new->cred.cr_group_info = NULL; |
389 | new->client_name = NULL; | 386 | new->cred.cr_principal = NULL; |
390 | } | 387 | } |
391 | 388 | ||
392 | static void | 389 | static void |
@@ -401,8 +398,8 @@ update_rsc(struct cache_head *cnew, struct cache_head *ctmp) | |||
401 | spin_lock_init(&new->seqdata.sd_lock); | 398 | spin_lock_init(&new->seqdata.sd_lock); |
402 | new->cred = tmp->cred; | 399 | new->cred = tmp->cred; |
403 | tmp->cred.cr_group_info = NULL; | 400 | tmp->cred.cr_group_info = NULL; |
404 | new->client_name = tmp->client_name; | 401 | new->cred.cr_principal = tmp->cred.cr_principal; |
405 | tmp->client_name = NULL; | 402 | tmp->cred.cr_principal = NULL; |
406 | } | 403 | } |
407 | 404 | ||
408 | static struct cache_head * | 405 | static struct cache_head * |
@@ -496,8 +493,8 @@ static int rsc_parse(struct cache_detail *cd, | |||
496 | /* get client name */ | 493 | /* get client name */ |
497 | len = qword_get(&mesg, buf, mlen); | 494 | len = qword_get(&mesg, buf, mlen); |
498 | if (len > 0) { | 495 | if (len > 0) { |
499 | rsci.client_name = kstrdup(buf, GFP_KERNEL); | 496 | rsci.cred.cr_principal = kstrdup(buf, GFP_KERNEL); |
500 | if (!rsci.client_name) | 497 | if (!rsci.cred.cr_principal) |
501 | goto out; | 498 | goto out; |
502 | } | 499 | } |
503 | 500 | ||
@@ -927,16 +924,6 @@ struct gss_svc_data { | |||
927 | struct rsc *rsci; | 924 | struct rsc *rsci; |
928 | }; | 925 | }; |
929 | 926 | ||
930 | char *svc_gss_principal(struct svc_rqst *rqstp) | ||
931 | { | ||
932 | struct gss_svc_data *gd = (struct gss_svc_data *)rqstp->rq_auth_data; | ||
933 | |||
934 | if (gd && gd->rsci) | ||
935 | return gd->rsci->client_name; | ||
936 | return NULL; | ||
937 | } | ||
938 | EXPORT_SYMBOL_GPL(svc_gss_principal); | ||
939 | |||
940 | static int | 927 | static int |
941 | svcauth_gss_set_client(struct svc_rqst *rqstp) | 928 | svcauth_gss_set_client(struct svc_rqst *rqstp) |
942 | { | 929 | { |