diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2003-06-17 06:39:35 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-17 06:39:35 -0700 |
| commit | f36e10e58a69cba8b9aebea8a6c2324a655ce472 (patch) | |
| tree | 8cf2f14423bdc52a2d71283c08946e04cc35e495 | |
| parent | eaee716b4d469a0bb3adf352f8462b0d2bcffa1f (diff) | |
[PATCH] kNFSd: Set nfsd user every time a filehandle is verified.
request might traverse several export points which may
have different uid squashing.
| -rw-r--r-- | fs/nfsd/auth.c | 4 | ||||
| -rw-r--r-- | fs/nfsd/nfsfh.c | 7 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 1 | ||||
| -rw-r--r-- | net/sunrpc/svcsock.c | 1 |
4 files changed, 4 insertions, 9 deletions
diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c index 12fa97fe1bfa..6b1327d93106 100644 --- a/fs/nfsd/auth.c +++ b/fs/nfsd/auth.c @@ -17,9 +17,6 @@ nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) struct svc_cred *cred = &rqstp->rq_cred; int i; - if (rqstp->rq_userset) - return; - if (exp->ex_flags & NFSEXP_ALLSQUASH) { cred->cr_uid = exp->ex_anon_uid; cred->cr_gid = exp->ex_anon_gid; @@ -57,5 +54,4 @@ nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) current->cap_permitted); } - rqstp->rq_userset = 1; } diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 1b1e2d68bc94..6d023b27ff6b 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -161,9 +161,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) goto out; } - /* Set user creds if we haven't done so already. */ - nfsd_setuser(rqstp, exp); - /* * Look up the dentry using the NFS file handle. */ @@ -223,6 +220,10 @@ 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 diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index d2996007633b..20773282fada 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -125,7 +125,6 @@ struct svc_rqst { u32 rq_proc; /* procedure number */ u32 rq_prot; /* IP protocol */ unsigned short - rq_userset : 1, /* auth->setuser OK */ rq_secure : 1; /* secure port */ diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 57a1c77d6bd5..dc645b5dd41f 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1222,7 +1222,6 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout) } rqstp->rq_secure = ntohs(rqstp->rq_addr.sin_port) < 1024; - rqstp->rq_userset = 0; rqstp->rq_chandle.defer = svc_defer; if (serv->sv_stats) |
