aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-10-19 23:00:12 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-10-21 10:12:14 -0400
commit5d18c1c2a9a74e0f966c257520b8b7f5136c87b3 (patch)
tree0529ee5b46a8049eb0af7dbf4c056a7de2369fe8 /fs/nfsd
parent8323c3b2a6b6543919d5ebdddc7d52f192126161 (diff)
nfsd4: only require krb5 principal for NFSv4.0 callbacks
In the sessions backchannel case, we don't need a krb5 principal name for the client; we use the already-created forechannel credentials instead. Some cleanup, while we're there: make it clearer which code here is 4.0- or sessions- specific. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4callback.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 67bcd2c72623..143da2eecd7b 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -481,22 +481,24 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
481 }; 481 };
482 struct rpc_create_args args = { 482 struct rpc_create_args args = {
483 .net = &init_net, 483 .net = &init_net,
484 .protocol = XPRT_TRANSPORT_TCP,
485 .address = (struct sockaddr *) &conn->cb_addr, 484 .address = (struct sockaddr *) &conn->cb_addr,
486 .addrsize = conn->cb_addrlen, 485 .addrsize = conn->cb_addrlen,
487 .timeout = &timeparms, 486 .timeout = &timeparms,
488 .program = &cb_program, 487 .program = &cb_program,
489 .prognumber = conn->cb_prog,
490 .version = 0, 488 .version = 0,
491 .authflavor = clp->cl_flavor, 489 .authflavor = clp->cl_flavor,
492 .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), 490 .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
493 .client_name = clp->cl_principal,
494 }; 491 };
495 struct rpc_clnt *client; 492 struct rpc_clnt *client;
496 493
497 if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) 494 if (clp->cl_minorversion == 0) {
498 return -EINVAL; 495 if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
499 if (clp->cl_minorversion) { 496 return -EINVAL;
497 args.client_name = clp->cl_principal;
498 args.prognumber = conn->cb_prog,
499 args.protocol = XPRT_TRANSPORT_TCP;
500 clp->cl_cb_ident = conn->cb_ident;
501 } else {
500 args.bc_xprt = conn->cb_xprt; 502 args.bc_xprt = conn->cb_xprt;
501 args.prognumber = clp->cl_cb_session->se_cb_prog; 503 args.prognumber = clp->cl_cb_session->se_cb_prog;
502 args.protocol = XPRT_TRANSPORT_BC_TCP; 504 args.protocol = XPRT_TRANSPORT_BC_TCP;
@@ -508,7 +510,6 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
508 PTR_ERR(client)); 510 PTR_ERR(client));
509 return PTR_ERR(client); 511 return PTR_ERR(client);
510 } 512 }
511 clp->cl_cb_ident = conn->cb_ident;
512 clp->cl_cb_client = client; 513 clp->cl_cb_client = client;
513 return 0; 514 return 0;
514 515