aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4idmap.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-01-04 18:02:15 -0500
committerJ. Bruce Fields <bfields@redhat.com>2011-01-04 18:21:36 -0500
commitf6af99ec1b261e21219d5eba99e3af48fc6c32d4 (patch)
tree828eab9238b2178e3d13abde226edcb1ec0c57a8 /fs/nfsd/nfs4idmap.c
parent255c7cf810e4776ae8f1023332060459f30d8a2a (diff)
nfsd4: name->id mapping should fail with BADOWNER not BADNAME
According to rfc 3530 BADNAME is for strings that represent paths; BADOWNER is for user/group names that don't map. And the too-long name should probably be BADOWNER as well; it's effectively the same as if we couldn't map it. Cc: stable@kernel.org Reported-by: Trond Myklebust <Trond.Myklebust@netapp.com> Reported-by: Simon Kirby <sim@hostway.ca> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4idmap.c')
-rw-r--r--fs/nfsd/nfs4idmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index f0695e815f0e..844960fd0395 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -524,13 +524,13 @@ idmap_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen
524 int ret; 524 int ret;
525 525
526 if (namelen + 1 > sizeof(key.name)) 526 if (namelen + 1 > sizeof(key.name))
527 return -EINVAL; 527 return -ESRCH; /* nfserr_badowner */
528 memcpy(key.name, name, namelen); 528 memcpy(key.name, name, namelen);
529 key.name[namelen] = '\0'; 529 key.name[namelen] = '\0';
530 strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname)); 530 strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
531 ret = idmap_lookup(rqstp, nametoid_lookup, &key, &nametoid_cache, &item); 531 ret = idmap_lookup(rqstp, nametoid_lookup, &key, &nametoid_cache, &item);
532 if (ret == -ENOENT) 532 if (ret == -ENOENT)
533 ret = -ESRCH; /* nfserr_badname */ 533 ret = -ESRCH; /* nfserr_badowner */
534 if (ret) 534 if (ret)
535 return ret; 535 return ret;
536 *id = item->id; 536 *id = item->id;