aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r--net/sunrpc/auth.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index b0f2b2ee7cc0..1cdb163c4f89 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -375,7 +375,15 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
375} 375}
376EXPORT_SYMBOL_GPL(rpcauth_init_cred); 376EXPORT_SYMBOL_GPL(rpcauth_init_cred);
377 377
378void 378static void
379rpcauth_generic_bind_cred(struct rpc_task *task, struct rpc_cred *cred)
380{
381 task->tk_msg.rpc_cred = get_rpccred(cred);
382 dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid,
383 cred->cr_auth->au_ops->au_name, cred);
384}
385
386static void
379rpcauth_bind_root_cred(struct rpc_task *task) 387rpcauth_bind_root_cred(struct rpc_task *task)
380{ 388{
381 struct rpc_auth *auth = task->tk_client->cl_auth; 389 struct rpc_auth *auth = task->tk_client->cl_auth;
@@ -394,8 +402,8 @@ rpcauth_bind_root_cred(struct rpc_task *task)
394 task->tk_status = PTR_ERR(ret); 402 task->tk_status = PTR_ERR(ret);
395} 403}
396 404
397void 405static void
398rpcauth_bindcred(struct rpc_task *task) 406rpcauth_bind_new_cred(struct rpc_task *task)
399{ 407{
400 struct rpc_auth *auth = task->tk_client->cl_auth; 408 struct rpc_auth *auth = task->tk_client->cl_auth;
401 struct rpc_cred *ret; 409 struct rpc_cred *ret;
@@ -410,14 +418,14 @@ rpcauth_bindcred(struct rpc_task *task)
410} 418}
411 419
412void 420void
413rpcauth_holdcred(struct rpc_task *task) 421rpcauth_bindcred(struct rpc_task *task, struct rpc_cred *cred, int flags)
414{ 422{
415 struct rpc_cred *cred = task->tk_msg.rpc_cred; 423 if (cred != NULL)
416 if (cred != NULL) { 424 rpcauth_generic_bind_cred(task, cred);
417 get_rpccred(cred); 425 else if (flags & RPC_TASK_ROOTCREDS)
418 dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid, 426 rpcauth_bind_root_cred(task);
419 cred->cr_auth->au_ops->au_name, cred); 427 else
420 } 428 rpcauth_bind_new_cred(task);
421} 429}
422 430
423void 431void