You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
Linus Torvalds
parent
0ba7536d5d
commit
80d188a643
@@ -427,6 +427,7 @@ static struct svc_program nfsd_acl_program = {
|
|||||||
.pg_name = "nfsd",
|
.pg_name = "nfsd",
|
||||||
.pg_class = "nfsd",
|
.pg_class = "nfsd",
|
||||||
.pg_stats = &nfsd_acl_svcstats,
|
.pg_stats = &nfsd_acl_svcstats,
|
||||||
|
.pg_authenticate = &svc_set_client,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct svc_stat nfsd_acl_svcstats = {
|
static struct svc_stat nfsd_acl_svcstats = {
|
||||||
|
|||||||
+7
-5
@@ -313,6 +313,11 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
|
|||||||
rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */
|
rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */
|
||||||
|
|
||||||
progp = serv->sv_program;
|
progp = serv->sv_program;
|
||||||
|
|
||||||
|
for (progp = serv->sv_program; progp; progp = progp->pg_next)
|
||||||
|
if (prog == progp->pg_prog)
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decode auth data, and add verifier to reply buffer.
|
* Decode auth data, and add verifier to reply buffer.
|
||||||
* We do this before anything else in order to get a decent
|
* 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)
|
|||||||
*/
|
*/
|
||||||
auth_res = svc_authenticate(rqstp, &auth_stat);
|
auth_res = svc_authenticate(rqstp, &auth_stat);
|
||||||
/* Also give the program a chance to reject this call: */
|
/* Also give the program a chance to reject this call: */
|
||||||
if (auth_res == SVC_OK) {
|
if (auth_res == SVC_OK && progp) {
|
||||||
auth_stat = rpc_autherr_badcred;
|
auth_stat = rpc_autherr_badcred;
|
||||||
auth_res = progp->pg_authenticate(rqstp);
|
auth_res = progp->pg_authenticate(rqstp);
|
||||||
}
|
}
|
||||||
@@ -340,10 +345,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
|
|||||||
case SVC_COMPLETE:
|
case SVC_COMPLETE:
|
||||||
goto sendit;
|
goto sendit;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (progp = serv->sv_program; progp; progp = progp->pg_next)
|
|
||||||
if (prog == progp->pg_prog)
|
|
||||||
break;
|
|
||||||
if (progp == NULL)
|
if (progp == NULL)
|
||||||
goto err_bad_prog;
|
goto err_bad_prog;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user