This is a note to let you know that I've just added the patch titled

    nfsd4: name->id mapping should fail with BADOWNER not BADNAME

to the 2.6.37-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsd4-name-id-mapping-should-fail-with-badowner-not-badname.patch
and it can be found in the queue-2.6.37 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From f6af99ec1b261e21219d5eba99e3af48fc6c32d4 Mon Sep 17 00:00:00 2001
From: J. Bruce Fields <[email protected]>
Date: Tue, 4 Jan 2011 18:02:15 -0500
Subject: nfsd4: name->id mapping should fail with BADOWNER not BADNAME

From: J. Bruce Fields <[email protected]>

commit f6af99ec1b261e21219d5eba99e3af48fc6c32d4 upstream.

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.

Reported-by: Trond Myklebust <[email protected]>
Reported-by: Simon Kirby <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/nfsd/nfs4idmap.c |    4 ++--
 fs/nfsd/nfsd.h      |    1 +
 fs/nfsd/nfsproc.c   |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -524,13 +524,13 @@ idmap_name_to_id(struct svc_rqst *rqstp,
        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;
--- 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)
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -737,7 +737,7 @@ nfserrno (int errno)
                { nfserr_jukebox, -ERESTARTSYS },
                { nfserr_dropit, -EAGAIN },
                { nfserr_dropit, -ENOMEM },
-               { nfserr_badname, -ESRCH },
+               { nfserr_badowner, -ESRCH },
                { nfserr_io, -ETXTBSY },
                { nfserr_notsupp, -EOPNOTSUPP },
                { nfserr_toosmall, -ETOOSMALL },


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.37/nfsd4-name-id-mapping-should-fail-with-badowner-not-badname.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to