diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-11-07 04:00:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:49 -0500 |
commit | 80d188a643b0f550a2aaedf7bf4dd1abd86cfc45 (patch) | |
tree | 1439a87508fab8a39a64d8be8b20f4b6e2350159 /net | |
parent | 0ba7536d5d47e4ecf2259a80b207158dc4e711eb (diff) |
[PATCH] knfsd: make sure svc_process call the correct pg_authenticate for multi-service port
If an RPC socket is serving multiple programs, then the pg_authenticate of
the first program in the list is called, instead of pg_authenticate for the
program to be run.
This does not cause a problem with any programs in the current kernel, but
could confuse future code.
Also set pg_authenticate for nfsd_acl_program incase it ever gets used.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index e9bd91265f70..5a220b2bb376 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -313,6 +313,11 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp) | |||
313 | rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */ | 313 | rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */ |
314 | 314 | ||
315 | progp = serv->sv_program; | 315 | progp = serv->sv_program; |
316 | |||
317 | for (progp = serv->sv_program; progp; progp = progp->pg_next) | ||
318 | if (prog == progp->pg_prog) | ||
319 | break; | ||
320 | |||
316 | /* | 321 | /* |
317 | * Decode auth data, and add verifier to reply buffer. | 322 | * Decode auth data, and add verifier to reply buffer. |
318 | * We do this before anything else in order to get a decent | 323 | * We do this before anything else in order to get a decent |
@@ -320,7 +325,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp) | |||
320 | */ | 325 | */ |
321 | auth_res = svc_authenticate(rqstp, &auth_stat); | 326 | auth_res = svc_authenticate(rqstp, &auth_stat); |
322 | /* Also give the program a chance to reject this call: */ | 327 | /* Also give the program a chance to reject this call: */ |
323 | if (auth_res == SVC_OK) { | 328 | if (auth_res == SVC_OK && progp) { |
324 | auth_stat = rpc_autherr_badcred; | 329 | auth_stat = rpc_autherr_badcred; |
325 | auth_res = progp->pg_authenticate(rqstp); | 330 | auth_res = progp->pg_authenticate(rqstp); |
326 | } | 331 | } |
@@ -340,10 +345,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp) | |||
340 | case SVC_COMPLETE: | 345 | case SVC_COMPLETE: |
341 | goto sendit; | 346 | goto sendit; |
342 | } | 347 | } |
343 | 348 | ||
344 | for (progp = serv->sv_program; progp; progp = progp->pg_next) | ||
345 | if (prog == progp->pg_prog) | ||
346 | break; | ||
347 | if (progp == NULL) | 349 | if (progp == NULL) |
348 | goto err_bad_prog; | 350 | goto err_bad_prog; |
349 | 351 | ||