aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-27 14:29:04 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:37 -0400
commit1be27f36601973815171db684c711d30557cf50c (patch)
tree37119def0079958b1ec444ee6a3b2ec3b15337b5 /net/sunrpc/auth.c
parent1dd17ec693bf4a08b666c2ef76b68ca08ce3c93d (diff)
SUNRPC: Remove the tk_auth macro...
We should almost always be deferencing the rpc_auth struct by means of the credential's cr_auth field instead of the rpc_clnt->cl_auth anyway. Fix up that historical mistake, and remove the macro that propagated it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r--net/sunrpc/auth.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 81f4c776c558..74baf87ccff9 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(rpcauth_init_cred);
371struct rpc_cred * 371struct rpc_cred *
372rpcauth_bindcred(struct rpc_task *task) 372rpcauth_bindcred(struct rpc_task *task)
373{ 373{
374 struct rpc_auth *auth = task->tk_auth; 374 struct rpc_auth *auth = task->tk_client->cl_auth;
375 struct auth_cred acred = { 375 struct auth_cred acred = {
376 .uid = current->fsuid, 376 .uid = current->fsuid,
377 .gid = current->fsgid, 377 .gid = current->fsgid,
@@ -381,7 +381,7 @@ rpcauth_bindcred(struct rpc_task *task)
381 int flags = 0; 381 int flags = 0;
382 382
383 dprintk("RPC: %5u looking up %s cred\n", 383 dprintk("RPC: %5u looking up %s cred\n",
384 task->tk_pid, task->tk_auth->au_ops->au_name); 384 task->tk_pid, task->tk_client->cl_auth->au_ops->au_name);
385 get_group_info(acred.group_info); 385 get_group_info(acred.group_info);
386 if (task->tk_flags & RPC_TASK_ROOTCREDS) 386 if (task->tk_flags & RPC_TASK_ROOTCREDS)
387 flags |= RPCAUTH_LOOKUP_ROOTCREDS; 387 flags |= RPCAUTH_LOOKUP_ROOTCREDS;
@@ -397,11 +397,12 @@ rpcauth_bindcred(struct rpc_task *task)
397void 397void
398rpcauth_holdcred(struct rpc_task *task) 398rpcauth_holdcred(struct rpc_task *task)
399{ 399{
400 dprintk("RPC: %5u holding %s cred %p\n", 400 struct rpc_cred *cred = task->tk_msg.rpc_cred;
401 task->tk_pid, task->tk_auth->au_ops->au_name, 401 if (cred != NULL) {
402 task->tk_msg.rpc_cred); 402 get_rpccred(cred);
403 if (task->tk_msg.rpc_cred) 403 dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid,
404 get_rpccred(task->tk_msg.rpc_cred); 404 cred->cr_auth->au_ops->au_name, cred);
405 }
405} 406}
406 407
407void 408void
@@ -441,7 +442,7 @@ rpcauth_unbindcred(struct rpc_task *task)
441 struct rpc_cred *cred = task->tk_msg.rpc_cred; 442 struct rpc_cred *cred = task->tk_msg.rpc_cred;
442 443
443 dprintk("RPC: %5u releasing %s cred %p\n", 444 dprintk("RPC: %5u releasing %s cred %p\n",
444 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 445 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
445 446
446 put_rpccred(cred); 447 put_rpccred(cred);
447 task->tk_msg.rpc_cred = NULL; 448 task->tk_msg.rpc_cred = NULL;
@@ -453,7 +454,7 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
453 struct rpc_cred *cred = task->tk_msg.rpc_cred; 454 struct rpc_cred *cred = task->tk_msg.rpc_cred;
454 455
455 dprintk("RPC: %5u marshaling %s cred %p\n", 456 dprintk("RPC: %5u marshaling %s cred %p\n",
456 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 457 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
457 458
458 return cred->cr_ops->crmarshal(task, p); 459 return cred->cr_ops->crmarshal(task, p);
459} 460}
@@ -464,7 +465,7 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
464 struct rpc_cred *cred = task->tk_msg.rpc_cred; 465 struct rpc_cred *cred = task->tk_msg.rpc_cred;
465 466
466 dprintk("RPC: %5u validating %s cred %p\n", 467 dprintk("RPC: %5u validating %s cred %p\n",
467 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 468 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
468 469
469 return cred->cr_ops->crvalidate(task, p); 470 return cred->cr_ops->crvalidate(task, p);
470} 471}
@@ -505,7 +506,7 @@ rpcauth_refreshcred(struct rpc_task *task)
505 int err; 506 int err;
506 507
507 dprintk("RPC: %5u refreshing %s cred %p\n", 508 dprintk("RPC: %5u refreshing %s cred %p\n",
508 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 509 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
509 510
510 err = cred->cr_ops->crrefresh(task); 511 err = cred->cr_ops->crrefresh(task);
511 if (err < 0) 512 if (err < 0)
@@ -519,7 +520,7 @@ rpcauth_invalcred(struct rpc_task *task)
519 struct rpc_cred *cred = task->tk_msg.rpc_cred; 520 struct rpc_cred *cred = task->tk_msg.rpc_cred;
520 521
521 dprintk("RPC: %5u invalidating %s cred %p\n", 522 dprintk("RPC: %5u invalidating %s cred %p\n",
522 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 523 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
523 if (cred) 524 if (cred)
524 clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); 525 clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
525} 526}