Commit 04d1532b authored by NeilBrown's avatar NeilBrown Committed by Anna Schumaker

SUNRPC discard cr_uid from struct rpc_cred.

Just use ->cr_cred->fsuid directly.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 2edd8d74
...@@ -58,8 +58,6 @@ struct rpc_cred { ...@@ -58,8 +58,6 @@ struct rpc_cred {
refcount_t cr_count; /* ref count */ refcount_t cr_count; /* ref count */
const struct cred *cr_cred; const struct cred *cr_cred;
kuid_t cr_uid;
/* per-flavor data */ /* per-flavor data */
}; };
#define RPCAUTH_CRED_NEW 0 #define RPCAUTH_CRED_NEW 0
......
...@@ -655,7 +655,6 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred, ...@@ -655,7 +655,6 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
cred->cr_ops = ops; cred->cr_ops = ops;
cred->cr_expire = jiffies; cred->cr_expire = jiffies;
cred->cr_cred = get_cred(acred->cred); cred->cr_cred = get_cred(acred->cred);
cred->cr_uid = acred->cred->fsuid;
} }
EXPORT_SYMBOL_GPL(rpcauth_init_cred); EXPORT_SYMBOL_GPL(rpcauth_init_cred);
......
...@@ -565,7 +565,7 @@ gss_setup_upcall(struct gss_auth *gss_auth, struct rpc_cred *cred) ...@@ -565,7 +565,7 @@ gss_setup_upcall(struct gss_auth *gss_auth, struct rpc_cred *cred)
struct gss_cred *gss_cred = container_of(cred, struct gss_cred *gss_cred = container_of(cred,
struct gss_cred, gc_base); struct gss_cred, gc_base);
struct gss_upcall_msg *gss_new, *gss_msg; struct gss_upcall_msg *gss_new, *gss_msg;
kuid_t uid = cred->cr_uid; kuid_t uid = cred->cr_cred->fsuid;
gss_new = gss_alloc_msg(gss_auth, uid, gss_cred->gc_principal); gss_new = gss_alloc_msg(gss_auth, uid, gss_cred->gc_principal);
if (IS_ERR(gss_new)) if (IS_ERR(gss_new))
...@@ -604,7 +604,7 @@ gss_refresh_upcall(struct rpc_task *task) ...@@ -604,7 +604,7 @@ gss_refresh_upcall(struct rpc_task *task)
int err = 0; int err = 0;
dprintk("RPC: %5u %s for uid %u\n", dprintk("RPC: %5u %s for uid %u\n",
task->tk_pid, __func__, from_kuid(&init_user_ns, cred->cr_uid)); task->tk_pid, __func__, from_kuid(&init_user_ns, cred->cr_cred->fsuid));
gss_msg = gss_setup_upcall(gss_auth, cred); gss_msg = gss_setup_upcall(gss_auth, cred);
if (PTR_ERR(gss_msg) == -EAGAIN) { if (PTR_ERR(gss_msg) == -EAGAIN) {
/* XXX: warning on the first, under the assumption we /* XXX: warning on the first, under the assumption we
...@@ -637,7 +637,7 @@ gss_refresh_upcall(struct rpc_task *task) ...@@ -637,7 +637,7 @@ gss_refresh_upcall(struct rpc_task *task)
out: out:
dprintk("RPC: %5u %s for uid %u result %d\n", dprintk("RPC: %5u %s for uid %u result %d\n",
task->tk_pid, __func__, task->tk_pid, __func__,
from_kuid(&init_user_ns, cred->cr_uid), err); from_kuid(&init_user_ns, cred->cr_cred->fsuid), err);
return err; return err;
} }
...@@ -653,7 +653,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) ...@@ -653,7 +653,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
int err; int err;
dprintk("RPC: %s for uid %u\n", dprintk("RPC: %s for uid %u\n",
__func__, from_kuid(&init_user_ns, cred->cr_uid)); __func__, from_kuid(&init_user_ns, cred->cr_cred->fsuid));
retry: retry:
err = 0; err = 0;
/* if gssd is down, just skip upcalling altogether */ /* if gssd is down, just skip upcalling altogether */
...@@ -701,7 +701,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred) ...@@ -701,7 +701,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
gss_release_msg(gss_msg); gss_release_msg(gss_msg);
out: out:
dprintk("RPC: %s for uid %u result %d\n", dprintk("RPC: %s for uid %u result %d\n",
__func__, from_kuid(&init_user_ns, cred->cr_uid), err); __func__, from_kuid(&init_user_ns, cred->cr_cred->fsuid), err);
return err; return err;
} }
...@@ -1520,7 +1520,7 @@ gss_match(struct auth_cred *acred, struct rpc_cred *rc, int flags) ...@@ -1520,7 +1520,7 @@ gss_match(struct auth_cred *acred, struct rpc_cred *rc, int flags)
} else { } else {
if (gss_cred->gc_principal != NULL) if (gss_cred->gc_principal != NULL)
return 0; return 0;
ret = uid_eq(rc->cr_uid, acred->cred->fsuid); ret = uid_eq(rc->cr_cred->fsuid, acred->cred->fsuid);
} }
return ret; return ret;
} }
......
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