From 38bd700bf2663ce6dc76939a28c8d71de2f51d6e Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:56:34 -0800 Subject: [PATCH] [PATCH] kNFSd: Fix problem with stale filehandles. From: NeilBrown 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 9d16338bad4bc..cd73e8d3ab724 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -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 -- 2.53.0