Skip to contentSkip to conversation

kNFSd - 8 of 8 - Set nfsd user every time a filehandle is verified.

PATCH New NeilBrown 1 participant 1 message Jun 17, 2003

Subsystems (3)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 kNFSd - 8 of 8 - Set nfsd user every time a filehandle is verified.

### Comments for ChangeSet
request might traverse several export points which may have different uid squashing.

----------- Diffstat output ------------

 ./fs/nfsd/auth.c             |    4 ----
 ./fs/nfsd/nfsfh.c            |    7 ++++---
 ./include/linux/sunrpc/svc.h |    1 -
 ./net/sunrpc/svcsock.c       |    1 -
 4 files changed, 4 insertions(+), 9 deletions(-)
fs/nfsd/auth.c renamed from fs/nfsd/auth.c~current~ +0 -4
diff ./fs/nfsd/auth.c~current~ ./fs/nfsd/auth.c
@@ -17,9 +17,6 @@ nfsd_setuser(struct svc_rqst *rqstp, str
 	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, str
 						  current->cap_permitted);
 	}
 
-	rqstp->rq_userset = 1;
 }
fs/nfsd/nfsfh.c renamed from fs/nfsd/nfsfh.c~current~ +4 -3
diff ./fs/nfsd/nfsfh.c~current~ ./fs/nfsd/nfsfh.c
@@ -161,9 +161,6 @@ fh_verify(struct svc_rqst *rqstp, struct
 			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
 
 	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
include/linux/sunrpc/svc.h renamed from include/linux/sunrpc/svc.h~current~ +0 -1
diff ./include/linux/sunrpc/svc.h~current~ ./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 */
 
 
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c~current~ +0 -1
diff ./net/sunrpc/svcsock.c~current~ ./net/sunrpc/svcsock.c
@@ -1222,7 +1222,6 @@ svc_recv(struct svc_serv *serv, struct s
 	}
 
 	rqstp->rq_secure  = ntohs(rqstp->rq_addr.sin_port) < 1024;
-	rqstp->rq_userset = 0;
 	rqstp->rq_chandle.defer = svc_defer;
 
 	if (serv->sv_stats)

-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs