diff options
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index c79543212602..0443f8349458 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -350,16 +350,18 @@ EXPORT_SYMBOL_GPL(rpcauth_lookup_credcache); | |||
350 | struct rpc_cred * | 350 | struct rpc_cred * |
351 | rpcauth_lookupcred(struct rpc_auth *auth, int flags) | 351 | rpcauth_lookupcred(struct rpc_auth *auth, int flags) |
352 | { | 352 | { |
353 | struct auth_cred acred = { | 353 | struct auth_cred acred; |
354 | .uid = current_fsuid(), | ||
355 | .gid = current_fsgid(), | ||
356 | .group_info = current->cred->group_info, | ||
357 | }; | ||
358 | struct rpc_cred *ret; | 354 | struct rpc_cred *ret; |
355 | const struct cred *cred = current_cred(); | ||
359 | 356 | ||
360 | dprintk("RPC: looking up %s cred\n", | 357 | dprintk("RPC: looking up %s cred\n", |
361 | auth->au_ops->au_name); | 358 | auth->au_ops->au_name); |
362 | get_group_info(acred.group_info); | 359 | |
360 | memset(&acred, 0, sizeof(acred)); | ||
361 | acred.uid = cred->fsuid; | ||
362 | acred.gid = cred->fsgid; | ||
363 | acred.group_info = get_group_info(((struct cred *)cred)->group_info); | ||
364 | |||
363 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); | 365 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); |
364 | put_group_info(acred.group_info); | 366 | put_group_info(acred.group_info); |
365 | return ret; | 367 | return ret; |