diff options
author | J. Bruce Fields <bfields@fieldses.org> | 2006-10-24 18:33:17 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2007-10-09 18:31:57 -0400 |
commit | dd4877bfb6f09cb4a294b459b354c8fc8fa66904 (patch) | |
tree | d4f5f199bd0fa481b9b41c55715835272e07b482 /fs | |
parent | e8ff2a8453cedf38d6d7a0528cb9c308066a3e3e (diff) |
knfsd: fix callback rpc cred
It doesn't make sense to make the callback with credentials that the
client made the setclientid with. Instead the spec requires that the
callback occur with the credentials the client authenticated *to*.
It probably doesn't matter what we use for auth_unix, and some more
infrastructure will be needed for auth_gss, so let's just remove the
cred lookup for now.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Acked-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index c17a5202ee3f..c1cb7e009c1e 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -344,28 +344,6 @@ static struct rpc_version * nfs_cb_version[] = { | |||
344 | &nfs_cb_version4, | 344 | &nfs_cb_version4, |
345 | }; | 345 | }; |
346 | 346 | ||
347 | /* | ||
348 | * Use the SETCLIENTID credential | ||
349 | */ | ||
350 | static struct rpc_cred * | ||
351 | nfsd4_lookupcred(struct nfs4_client *clp, int taskflags) | ||
352 | { | ||
353 | struct auth_cred acred; | ||
354 | struct rpc_clnt *clnt = clp->cl_callback.cb_client; | ||
355 | struct rpc_cred *ret; | ||
356 | |||
357 | get_group_info(clp->cl_cred.cr_group_info); | ||
358 | acred.uid = clp->cl_cred.cr_uid; | ||
359 | acred.gid = clp->cl_cred.cr_gid; | ||
360 | acred.group_info = clp->cl_cred.cr_group_info; | ||
361 | |||
362 | dprintk("NFSD: looking up %s cred\n", | ||
363 | clnt->cl_auth->au_ops->au_name); | ||
364 | ret = rpcauth_lookup_credcache(clnt->cl_auth, &acred, taskflags); | ||
365 | put_group_info(clp->cl_cred.cr_group_info); | ||
366 | return ret; | ||
367 | } | ||
368 | |||
369 | /* Reference counting, callback cleanup, etc., all look racy as heck. | 347 | /* Reference counting, callback cleanup, etc., all look racy as heck. |
370 | * And why is cb_set an atomic? */ | 348 | * And why is cb_set an atomic? */ |
371 | 349 | ||
@@ -379,18 +357,13 @@ static int do_probe_callback(void *data) | |||
379 | }; | 357 | }; |
380 | int status; | 358 | int status; |
381 | 359 | ||
382 | msg.rpc_cred = nfsd4_lookupcred(clp, 0); | ||
383 | if (IS_ERR(msg.rpc_cred)) | ||
384 | goto out; | ||
385 | status = rpc_call_sync(cb->cb_client, &msg, RPC_TASK_SOFT); | 360 | status = rpc_call_sync(cb->cb_client, &msg, RPC_TASK_SOFT); |
386 | put_rpccred(msg.rpc_cred); | ||
387 | 361 | ||
388 | if (status) { | 362 | if (status) { |
389 | rpc_shutdown_client(cb->cb_client); | 363 | rpc_shutdown_client(cb->cb_client); |
390 | cb->cb_client = NULL; | 364 | cb->cb_client = NULL; |
391 | } else | 365 | } else |
392 | atomic_set(&cb->cb_set, 1); | 366 | atomic_set(&cb->cb_set, 1); |
393 | out: | ||
394 | put_nfs4_client(clp); | 367 | put_nfs4_client(clp); |
395 | return 0; | 368 | return 0; |
396 | } | 369 | } |
@@ -488,10 +461,6 @@ nfsd4_cb_recall(struct nfs4_delegation *dp) | |||
488 | if ((!atomic_read(&clp->cl_callback.cb_set)) || !clnt) | 461 | if ((!atomic_read(&clp->cl_callback.cb_set)) || !clnt) |
489 | return; | 462 | return; |
490 | 463 | ||
491 | msg.rpc_cred = nfsd4_lookupcred(clp, 0); | ||
492 | if (IS_ERR(msg.rpc_cred)) | ||
493 | goto out; | ||
494 | |||
495 | cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */ | 464 | cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */ |
496 | cbr->cbr_dp = dp; | 465 | cbr->cbr_dp = dp; |
497 | 466 | ||
@@ -512,8 +481,6 @@ nfsd4_cb_recall(struct nfs4_delegation *dp) | |||
512 | status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT); | 481 | status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT); |
513 | } | 482 | } |
514 | out_put_cred: | 483 | out_put_cred: |
515 | put_rpccred(msg.rpc_cred); | ||
516 | out: | ||
517 | if (status == -EIO) | 484 | if (status == -EIO) |
518 | atomic_set(&clp->cl_callback.cb_set, 0); | 485 | atomic_set(&clp->cl_callback.cb_set, 0); |
519 | /* Success or failure, now we're either waiting for lease expiration | 486 | /* Success or failure, now we're either waiting for lease expiration |