aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-05-18 22:42:16 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-05-31 20:30:03 -0400
commit788c1eba50133777df5ca2972cda3c9a8f78f52f (patch)
treec1b9c1e4a47e52cd854272aec9d5dfc22bfd3313 /fs/nfsd
parent34b232bb3742dc88eef7352da2ca018f51ac4561 (diff)
nfsd4: fix setclientid_confirm same_cred check
New clients are created only by nfsd4_setclientid(), which always gives any new client a unique clientid. The only exception is in the "callback update" case, in which case it may create an unconfirmed client with the same clientid as a confirmed client. In that case it also checks that the confirmed client has the same credential. Therefore, it is pointless for setclientid_confirm to check whether a confirmed and unconfirmed client with the same clientid have matching credentials--they're guaranteed to. Instead, it should be checking whether the credential on the setclientid_confirm matches either of those. Otherwise, it could be anyone sending the setclientid_confirm. Granted, I can't see why anyone would, but still it's probalby safer to check. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 9d7e3eb0f5db..0f108f68da77 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2243,7 +2243,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2243 status = nfserr_clid_inuse; 2243 status = nfserr_clid_inuse;
2244 if (conf && unconf && same_verf(&confirm, &unconf->cl_confirm)) { 2244 if (conf && unconf && same_verf(&confirm, &unconf->cl_confirm)) {
2245 /* case 1: callback update */ 2245 /* case 1: callback update */
2246 if (!same_creds(&conf->cl_cred, &unconf->cl_cred)) 2246 if (!same_creds(&conf->cl_cred, &rqstp->rq_cred))
2247 status = nfserr_clid_inuse; 2247 status = nfserr_clid_inuse;
2248 else { 2248 else {
2249 nfsd4_change_callback(conf, &unconf->cl_cb_conn); 2249 nfsd4_change_callback(conf, &unconf->cl_cb_conn);