From: "J. Bruce Fields" <bfields@redhat.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Simon Kirby <sim@hostway.ca>,
linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>,
stable@kernel.org
Subject: [PATCH 1/4] nfsd4: name->id mapping should fail with BADOWNER not BADNAME
Date: Tue, 4 Jan 2011 18:23:27 -0500 [thread overview]
Message-ID: <1294183410-14688-1-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1294178391.5896.31.camel@heimdal.trondhjem.org>
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>
---
fs/nfsd/nfs4idmap.c | 4 ++--
fs/nfsd/nfsd.h | 1 +
fs/nfsd/nfsproc.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index f0695e8..844960f 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
int ret;
if (namelen + 1 > sizeof(key.name))
- return -EINVAL;
+ return -ESRCH; /* nfserr_badowner */
memcpy(key.name, name, namelen);
key.name[namelen] = '\0';
strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
ret = idmap_lookup(rqstp, nametoid_lookup, &key, &nametoid_cache, &item);
if (ret == -ENOENT)
- ret = -ESRCH; /* nfserr_badname */
+ ret = -ESRCH; /* nfserr_badowner */
if (ret)
return ret;
*id = item->id;
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 6b641cf..7ecfa24 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -158,6 +158,7 @@ void nfsd_lockd_shutdown(void);
#define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP)
#define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR)
#define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE)
+#define nfserr_badowner cpu_to_be32(NFSERR_BADOWNER)
#define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD)
#define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL)
#define nfserr_grace cpu_to_be32(NFSERR_GRACE)
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index fd608a2..8f05dcd 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -738,7 +738,7 @@ nfserrno (int errno)
{ nfserr_jukebox, -EAGAIN },
{ nfserr_jukebox, -EWOULDBLOCK },
{ nfserr_jukebox, -ENOMEM },
- { nfserr_badname, -ESRCH },
+ { nfserr_badowner, -ESRCH },
{ nfserr_io, -ETXTBSY },
{ nfserr_notsupp, -EOPNOTSUPP },
{ nfserr_toosmall, -ETOOSMALL },
--
1.7.1
next prev parent reply other threads:[~2011-01-04 23:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-30 2:57 [PATCH 0/4] Allow the admin to turn off NFSv4 uid/gid mapping Trond Myklebust
2010-11-30 2:57 ` [PATCH 1/4] NFSv4: If the server sends us a numeric uid/gid then accept it Trond Myklebust
2010-11-30 2:57 ` [PATCH 2/4] NFSv4: Send unmapped uid/gids to the server if the idmapper fails Trond Myklebust
2010-11-30 2:57 ` [PATCH 3/4] NFSv4: cleanup idmapper functions to take an nfs_server argument Trond Myklebust
2010-11-30 2:57 ` [PATCH 4/4] NFSv4: Send unmapped uid/gids to the server when using auth_sys Trond Myklebust
2010-11-30 9:44 ` Boaz Harrosh
2010-11-30 13:17 ` Trond Myklebust
2010-11-30 16:02 ` Boaz Harrosh
2011-01-04 21:25 ` Simon Kirby
2011-01-04 21:33 ` Trond Myklebust
2011-01-04 21:43 ` Simon Kirby
2011-01-04 21:50 ` Trond Myklebust
2011-01-04 21:57 ` Dr. J. Bruce Fields
2011-01-04 21:59 ` Trond Myklebust
2011-01-04 23:18 ` Dr. J. Bruce Fields
2011-01-04 23:23 ` J. Bruce Fields [this message]
2011-01-04 23:23 ` [PATCH 2/4] nfsd4: move idmap and acl header files into fs/nfsd J. Bruce Fields
2011-01-04 23:23 ` [PATCH 3/4] nfsd4: remove outdated pathname-comments J. Bruce Fields
2011-01-04 23:23 ` [PATCH 4/4] nfsd4: return nfs errno from name_to_id functions J. Bruce Fields
2010-11-30 3:15 ` [PATCH 0/4] Allow the admin to turn off NFSv4 uid/gid mapping Jim Rees
2010-11-30 3:24 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294183410-14688-1-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=sim@hostway.ca \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).