Commit 5d18c1c2 authored by J. Bruce Fields's avatar J. Bruce Fields

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: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8323c3b2
...@@ -481,22 +481,24 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn) ...@@ -481,22 +481,24 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
}; };
struct rpc_create_args args = { struct rpc_create_args args = {
.net = &init_net, .net = &init_net,
.protocol = XPRT_TRANSPORT_TCP,
.address = (struct sockaddr *) &conn->cb_addr, .address = (struct sockaddr *) &conn->cb_addr,
.addrsize = conn->cb_addrlen, .addrsize = conn->cb_addrlen,
.timeout = &timeparms, .timeout = &timeparms,
.program = &cb_program, .program = &cb_program,
.prognumber = conn->cb_prog,
.version = 0, .version = 0,
.authflavor = clp->cl_flavor, .authflavor = clp->cl_flavor,
.flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
.client_name = clp->cl_principal,
}; };
struct rpc_clnt *client; struct rpc_clnt *client;
if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) if (clp->cl_minorversion == 0) {
return -EINVAL; if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
if (clp->cl_minorversion) { return -EINVAL;
args.client_name = clp->cl_principal;
args.prognumber = conn->cb_prog,
args.protocol = XPRT_TRANSPORT_TCP;
clp->cl_cb_ident = conn->cb_ident;
} else {
args.bc_xprt = conn->cb_xprt; args.bc_xprt = conn->cb_xprt;
args.prognumber = clp->cl_cb_session->se_cb_prog; args.prognumber = clp->cl_cb_session->se_cb_prog;
args.protocol = XPRT_TRANSPORT_BC_TCP; args.protocol = XPRT_TRANSPORT_BC_TCP;
...@@ -508,7 +510,6 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn) ...@@ -508,7 +510,6 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
PTR_ERR(client)); PTR_ERR(client));
return PTR_ERR(client); return PTR_ERR(client);
} }
clp->cl_cb_ident = conn->cb_ident;
clp->cl_cb_client = client; clp->cl_cb_client = client;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment