diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-01 20:10:52 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:15:19 -0500 |
commit | cdba321e291f0fbf5abda4d88340292b858e3d4d (patch) | |
tree | 67792b091f081f9fcd8b76c7b727016f7c6a17a4 /net | |
parent | 9132adb0212c7ddf37d1c2a26c12f8fe7706827d (diff) |
sunrpc: Convert kuids and kgids to uids and gids for printing
When printing kuids and kgids for debugging purpropses convert them
to ordinary integers so their values can be fed to the oridnary
print functions.
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_generic.c | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 13 | ||||
-rw-r--r-- | net/sunrpc/auth_unix.c | 3 |
3 files changed, 13 insertions, 7 deletions
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index bff3e4730f6b..b6badafc6494 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
@@ -96,7 +96,9 @@ generic_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
96 | 96 | ||
97 | dprintk("RPC: allocated %s cred %p for uid %d gid %d\n", | 97 | dprintk("RPC: allocated %s cred %p for uid %d gid %d\n", |
98 | gcred->acred.machine_cred ? "machine" : "generic", | 98 | gcred->acred.machine_cred ? "machine" : "generic", |
99 | gcred, acred->uid, acred->gid); | 99 | gcred, |
100 | from_kuid(&init_user_ns, acred->uid), | ||
101 | from_kgid(&init_user_ns, acred->gid)); | ||
100 | return &gcred->gc_base; | 102 | return &gcred->gc_base; |
101 | } | 103 | } |
102 | 104 | ||
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 1b8b3e4fad46..afbbcfb1078b 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -517,7 +517,7 @@ gss_refresh_upcall(struct rpc_task *task) | |||
517 | int err = 0; | 517 | int err = 0; |
518 | 518 | ||
519 | dprintk("RPC: %5u %s for uid %u\n", | 519 | dprintk("RPC: %5u %s for uid %u\n", |
520 | task->tk_pid, __func__, cred->cr_uid); | 520 | task->tk_pid, __func__, from_kuid(&init_user_ns, cred->cr_uid)); |
521 | gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); | 521 | gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); |
522 | if (PTR_ERR(gss_msg) == -EAGAIN) { | 522 | if (PTR_ERR(gss_msg) == -EAGAIN) { |
523 | /* XXX: warning on the first, under the assumption we | 523 | /* XXX: warning on the first, under the assumption we |
@@ -549,7 +549,8 @@ gss_refresh_upcall(struct rpc_task *task) | |||
549 | gss_release_msg(gss_msg); | 549 | gss_release_msg(gss_msg); |
550 | out: | 550 | out: |
551 | dprintk("RPC: %5u %s for uid %u result %d\n", | 551 | dprintk("RPC: %5u %s for uid %u result %d\n", |
552 | task->tk_pid, __func__, cred->cr_uid, err); | 552 | task->tk_pid, __func__, |
553 | from_kuid(&init_user_ns, cred->cr_uid), err); | ||
553 | return err; | 554 | return err; |
554 | } | 555 | } |
555 | 556 | ||
@@ -562,7 +563,8 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) | |||
562 | DEFINE_WAIT(wait); | 563 | DEFINE_WAIT(wait); |
563 | int err = 0; | 564 | int err = 0; |
564 | 565 | ||
565 | dprintk("RPC: %s for uid %u\n", __func__, cred->cr_uid); | 566 | dprintk("RPC: %s for uid %u\n", |
567 | __func__, from_kuid(&init_user_ns, cred->cr_uid)); | ||
566 | retry: | 568 | retry: |
567 | gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); | 569 | gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); |
568 | if (PTR_ERR(gss_msg) == -EAGAIN) { | 570 | if (PTR_ERR(gss_msg) == -EAGAIN) { |
@@ -604,7 +606,7 @@ out_intr: | |||
604 | gss_release_msg(gss_msg); | 606 | gss_release_msg(gss_msg); |
605 | out: | 607 | out: |
606 | dprintk("RPC: %s for uid %u result %d\n", | 608 | dprintk("RPC: %s for uid %u result %d\n", |
607 | __func__, cred->cr_uid, err); | 609 | __func__, from_kuid(&init_user_ns, cred->cr_uid), err); |
608 | return err; | 610 | return err; |
609 | } | 611 | } |
610 | 612 | ||
@@ -1059,7 +1061,8 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
1059 | int err = -ENOMEM; | 1061 | int err = -ENOMEM; |
1060 | 1062 | ||
1061 | dprintk("RPC: %s for uid %d, flavor %d\n", | 1063 | dprintk("RPC: %s for uid %d, flavor %d\n", |
1062 | __func__, acred->uid, auth->au_flavor); | 1064 | __func__, from_kuid(&init_user_ns, acred->uid), |
1065 | auth->au_flavor); | ||
1063 | 1066 | ||
1064 | if (!(cred = kzalloc(sizeof(*cred), GFP_NOFS))) | 1067 | if (!(cred = kzalloc(sizeof(*cred), GFP_NOFS))) |
1065 | goto out_err; | 1068 | goto out_err; |
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 9f3885745fb3..55b6ca6fbbd3 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
@@ -65,7 +65,8 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
65 | unsigned int i; | 65 | unsigned int i; |
66 | 66 | ||
67 | dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", | 67 | dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", |
68 | acred->uid, acred->gid); | 68 | from_kuid(&init_user_ns, acred->uid), |
69 | from_kgid(&init_user_ns, acred->gid)); | ||
69 | 70 | ||
70 | if (!(cred = kmalloc(sizeof(*cred), GFP_NOFS))) | 71 | if (!(cred = kmalloc(sizeof(*cred), GFP_NOFS))) |
71 | return ERR_PTR(-ENOMEM); | 72 | return ERR_PTR(-ENOMEM); |