aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/auth_gss.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-01-31 12:14:05 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 18:35:09 -0500
commit8885cb367f86ce02bed3bf18192d74a53ac3b81f (patch)
tree3d85dd85f176606756720914f46c93af53895295 /net/sunrpc/auth_gss/auth_gss.c
parenta3f565b1e530a756472401835107d08fd291f242 (diff)
SUNRPC: fix print format for tk_pid in auth_gss support
The tk_pid field is an unsigned short. The proper print format specifier for that type is %5u, not %4d. Also clean up some miscellaneous print formatting nits. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss/auth_gss.c')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index e1a104abb782..2fe8e91f5bc1 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -241,7 +241,7 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
241 } 241 }
242 return q; 242 return q;
243err: 243err:
244 dprintk("RPC: gss_fill_context returning %ld\n", -PTR_ERR(p)); 244 dprintk("RPC: gss_fill_context returning %ld\n", -PTR_ERR(p));
245 return p; 245 return p;
246} 246}
247 247
@@ -276,10 +276,10 @@ __gss_find_upcall(struct gss_auth *gss_auth, uid_t uid)
276 if (pos->uid != uid) 276 if (pos->uid != uid)
277 continue; 277 continue;
278 atomic_inc(&pos->count); 278 atomic_inc(&pos->count);
279 dprintk("RPC: gss_find_upcall found msg %p\n", pos); 279 dprintk("RPC: gss_find_upcall found msg %p\n", pos);
280 return pos; 280 return pos;
281 } 281 }
282 dprintk("RPC: gss_find_upcall found nothing\n"); 282 dprintk("RPC: gss_find_upcall found nothing\n");
283 return NULL; 283 return NULL;
284} 284}
285 285
@@ -393,7 +393,8 @@ gss_refresh_upcall(struct rpc_task *task)
393 struct gss_upcall_msg *gss_msg; 393 struct gss_upcall_msg *gss_msg;
394 int err = 0; 394 int err = 0;
395 395
396 dprintk("RPC: %4u gss_refresh_upcall for uid %u\n", task->tk_pid, cred->cr_uid); 396 dprintk("RPC: %5u gss_refresh_upcall for uid %u\n", task->tk_pid,
397 cred->cr_uid);
397 gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); 398 gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred);
398 if (IS_ERR(gss_msg)) { 399 if (IS_ERR(gss_msg)) {
399 err = PTR_ERR(gss_msg); 400 err = PTR_ERR(gss_msg);
@@ -413,8 +414,8 @@ gss_refresh_upcall(struct rpc_task *task)
413 spin_unlock(&gss_auth->lock); 414 spin_unlock(&gss_auth->lock);
414 gss_release_msg(gss_msg); 415 gss_release_msg(gss_msg);
415out: 416out:
416 dprintk("RPC: %4u gss_refresh_upcall for uid %u result %d\n", task->tk_pid, 417 dprintk("RPC: %5u gss_refresh_upcall for uid %u result %d\n",
417 cred->cr_uid, err); 418 task->tk_pid, cred->cr_uid, err);
418 return err; 419 return err;
419} 420}
420 421
@@ -426,7 +427,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
426 DEFINE_WAIT(wait); 427 DEFINE_WAIT(wait);
427 int err = 0; 428 int err = 0;
428 429
429 dprintk("RPC: gss_upcall for uid %u\n", cred->cr_uid); 430 dprintk("RPC: gss_upcall for uid %u\n", cred->cr_uid);
430 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); 431 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred);
431 if (IS_ERR(gss_msg)) { 432 if (IS_ERR(gss_msg)) {
432 err = PTR_ERR(gss_msg); 433 err = PTR_ERR(gss_msg);
@@ -454,7 +455,8 @@ out_intr:
454 finish_wait(&gss_msg->waitqueue, &wait); 455 finish_wait(&gss_msg->waitqueue, &wait);
455 gss_release_msg(gss_msg); 456 gss_release_msg(gss_msg);
456out: 457out:
457 dprintk("RPC: gss_create_upcall for uid %u result %d\n", cred->cr_uid, err); 458 dprintk("RPC: gss_create_upcall for uid %u result %d\n",
459 cred->cr_uid, err);
458 return err; 460 return err;
459} 461}
460 462
@@ -546,14 +548,14 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
546 } 548 }
547 gss_put_ctx(ctx); 549 gss_put_ctx(ctx);
548 kfree(buf); 550 kfree(buf);
549 dprintk("RPC: gss_pipe_downcall returning length %Zu\n", mlen); 551 dprintk("RPC: gss_pipe_downcall returning length %Zu\n", mlen);
550 return mlen; 552 return mlen;
551err_put_ctx: 553err_put_ctx:
552 gss_put_ctx(ctx); 554 gss_put_ctx(ctx);
553err: 555err:
554 kfree(buf); 556 kfree(buf);
555out: 557out:
556 dprintk("RPC: gss_pipe_downcall returning %d\n", err); 558 dprintk("RPC: gss_pipe_downcall returning %d\n", err);
557 return err; 559 return err;
558} 560}
559 561
@@ -591,7 +593,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
591 static unsigned long ratelimit; 593 static unsigned long ratelimit;
592 594
593 if (msg->errno < 0) { 595 if (msg->errno < 0) {
594 dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n", 596 dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n",
595 gss_msg); 597 gss_msg);
596 atomic_inc(&gss_msg->count); 598 atomic_inc(&gss_msg->count);
597 gss_unhash_msg(gss_msg); 599 gss_unhash_msg(gss_msg);
@@ -618,7 +620,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
618 struct rpc_auth * auth; 620 struct rpc_auth * auth;
619 int err = -ENOMEM; /* XXX? */ 621 int err = -ENOMEM; /* XXX? */
620 622
621 dprintk("RPC: creating GSS authenticator for client %p\n",clnt); 623 dprintk("RPC: creating GSS authenticator for client %p\n", clnt);
622 624
623 if (!try_module_get(THIS_MODULE)) 625 if (!try_module_get(THIS_MODULE))
624 return ERR_PTR(err); 626 return ERR_PTR(err);
@@ -670,8 +672,8 @@ gss_destroy(struct rpc_auth *auth)
670{ 672{
671 struct gss_auth *gss_auth; 673 struct gss_auth *gss_auth;
672 674
673 dprintk("RPC: destroying GSS authenticator %p flavor %d\n", 675 dprintk("RPC: destroying GSS authenticator %p flavor %d\n",
674 auth, auth->au_flavor); 676 auth, auth->au_flavor);
675 677
676 gss_auth = container_of(auth, struct gss_auth, rpc_auth); 678 gss_auth = container_of(auth, struct gss_auth, rpc_auth);
677 rpc_unlink(gss_auth->dentry); 679 rpc_unlink(gss_auth->dentry);
@@ -689,7 +691,7 @@ gss_destroy(struct rpc_auth *auth)
689static void 691static void
690gss_destroy_ctx(struct gss_cl_ctx *ctx) 692gss_destroy_ctx(struct gss_cl_ctx *ctx)
691{ 693{
692 dprintk("RPC: gss_destroy_ctx\n"); 694 dprintk("RPC: gss_destroy_ctx\n");
693 695
694 if (ctx->gc_gss_ctx) 696 if (ctx->gc_gss_ctx)
695 gss_delete_sec_context(&ctx->gc_gss_ctx); 697 gss_delete_sec_context(&ctx->gc_gss_ctx);
@@ -703,7 +705,7 @@ gss_destroy_cred(struct rpc_cred *rc)
703{ 705{
704 struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base); 706 struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base);
705 707
706 dprintk("RPC: gss_destroy_cred \n"); 708 dprintk("RPC: gss_destroy_cred \n");
707 709
708 if (cred->gc_ctx) 710 if (cred->gc_ctx)
709 gss_put_ctx(cred->gc_ctx); 711 gss_put_ctx(cred->gc_ctx);
@@ -726,7 +728,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
726 struct gss_cred *cred = NULL; 728 struct gss_cred *cred = NULL;
727 int err = -ENOMEM; 729 int err = -ENOMEM;
728 730
729 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", 731 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n",
730 acred->uid, auth->au_flavor); 732 acred->uid, auth->au_flavor);
731 733
732 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL))) 734 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL)))
@@ -745,7 +747,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
745 return &cred->gc_base; 747 return &cred->gc_base;
746 748
747out_err: 749out_err:
748 dprintk("RPC: gss_create_cred failed with error %d\n", err); 750 dprintk("RPC: gss_create_cred failed with error %d\n", err);
749 return ERR_PTR(err); 751 return ERR_PTR(err);
750} 752}
751 753
@@ -799,7 +801,7 @@ gss_marshal(struct rpc_task *task, __be32 *p)
799 struct kvec iov; 801 struct kvec iov;
800 struct xdr_buf verf_buf; 802 struct xdr_buf verf_buf;
801 803
802 dprintk("RPC: %4u gss_marshal\n", task->tk_pid); 804 dprintk("RPC: %5u gss_marshal\n", task->tk_pid);
803 805
804 *p++ = htonl(RPC_AUTH_GSS); 806 *p++ = htonl(RPC_AUTH_GSS);
805 cred_len = p++; 807 cred_len = p++;
@@ -865,7 +867,7 @@ gss_validate(struct rpc_task *task, __be32 *p)
865 u32 flav,len; 867 u32 flav,len;
866 u32 maj_stat; 868 u32 maj_stat;
867 869
868 dprintk("RPC: %4u gss_validate\n", task->tk_pid); 870 dprintk("RPC: %5u gss_validate\n", task->tk_pid);
869 871
870 flav = ntohl(*p++); 872 flav = ntohl(*p++);
871 if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE) 873 if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE)
@@ -888,12 +890,12 @@ gss_validate(struct rpc_task *task, __be32 *p)
888 * calculate the length of the verifier: */ 890 * calculate the length of the verifier: */
889 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2; 891 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2;
890 gss_put_ctx(ctx); 892 gss_put_ctx(ctx);
891 dprintk("RPC: %4u GSS gss_validate: gss_verify_mic succeeded.\n", 893 dprintk("RPC: %5u gss_validate: gss_verify_mic succeeded.\n",
892 task->tk_pid); 894 task->tk_pid);
893 return p + XDR_QUADLEN(len); 895 return p + XDR_QUADLEN(len);
894out_bad: 896out_bad:
895 gss_put_ctx(ctx); 897 gss_put_ctx(ctx);
896 dprintk("RPC: %4u gss_validate failed.\n", task->tk_pid); 898 dprintk("RPC: %5u gss_validate failed.\n", task->tk_pid);
897 return NULL; 899 return NULL;
898} 900}
899 901
@@ -1063,7 +1065,7 @@ gss_wrap_req(struct rpc_task *task,
1063 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); 1065 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
1064 int status = -EIO; 1066 int status = -EIO;
1065 1067
1066 dprintk("RPC: %4u gss_wrap_req\n", task->tk_pid); 1068 dprintk("RPC: %5u gss_wrap_req\n", task->tk_pid);
1067 if (ctx->gc_proc != RPC_GSS_PROC_DATA) { 1069 if (ctx->gc_proc != RPC_GSS_PROC_DATA) {
1068 /* The spec seems a little ambiguous here, but I think that not 1070 /* The spec seems a little ambiguous here, but I think that not
1069 * wrapping context destruction requests makes the most sense. 1071 * wrapping context destruction requests makes the most sense.
@@ -1086,7 +1088,7 @@ gss_wrap_req(struct rpc_task *task,
1086 } 1088 }
1087out: 1089out:
1088 gss_put_ctx(ctx); 1090 gss_put_ctx(ctx);
1089 dprintk("RPC: %4u gss_wrap_req returning %d\n", task->tk_pid, status); 1091 dprintk("RPC: %5u gss_wrap_req returning %d\n", task->tk_pid, status);
1090 return status; 1092 return status;
1091} 1093}
1092 1094
@@ -1192,7 +1194,7 @@ out_decode:
1192 status = decode(rqstp, p, obj); 1194 status = decode(rqstp, p, obj);
1193out: 1195out:
1194 gss_put_ctx(ctx); 1196 gss_put_ctx(ctx);
1195 dprintk("RPC: %4u gss_unwrap_resp returning %d\n", task->tk_pid, 1197 dprintk("RPC: %5u gss_unwrap_resp returning %d\n", task->tk_pid,
1196 status); 1198 status);
1197 return status; 1199 return status;
1198} 1200}