]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: Fix problem with stale filehandles.
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:56:34 +0000 (18:56 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:56:34 +0000 (18:56 -0800)
From: NeilBrown <neilb@cse.unsw.edu.au>

nfsd_setuser was not called until after filehandle lookup was done, so
filehandle lookup would use the wrong userid, and so the permission checking
in nfsd_acceptable would be bogus.

fs/nfsd/nfsfh.c

index 9d16338bad4bc7b14fa84eb4b64c63722ad63606..cd73e8d3ab724f21cec0556120d937e357769a8b 100644 (file)
@@ -164,6 +164,9 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        goto out;
                }
 
+               /* Set user creds for this exportpoint */
+               nfsd_setuser(rqstp, exp);
+
                /*
                 * Look up the dentry using the NFS file handle.
                 */
@@ -224,9 +227,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
        inode = dentry->d_inode;
 
 
-       /* Set user creds for this exportpoint */
-       nfsd_setuser(rqstp, exp);
-
        /* Type check. The correct error return for type mismatches
         * does not seem to be generally agreed upon. SunOS seems to
         * use EISDIR if file isn't S_IFREG; a comment in the NFSv3