PERFORCE change 27243 for review

Robert Watson rwatson at freebsd.org
Sun Mar 23 02:58:03 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=27243

Change 27243 by rwatson at rwatson_paprika on 2003/03/22 18:57:46

	Apply the cmask to nfs_mnod().  Note that due to the semantics
	of the vap->nfsattr conversion macro for NFSv3, we have to
	modify caller-owned vap memory, which is unfortunate.

Affected files ...

.. //depot/projects/trustedbsd/acl/sys/nfsclient/nfs_vnops.c#5 edit

Differences ...

==== //depot/projects/trustedbsd/acl/sys/nfsclient/nfs_vnops.c#5 (text+ko) ====

@@ -1184,7 +1184,7 @@
  */
 static int
 nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
-    struct vattr *vap)
+    struct vattr *vap, int cmask)
 {
 	struct nfsv2_sattr *sp;
 	u_int32_t *tl;
@@ -1197,6 +1197,12 @@
 	u_int32_t rdev;
 	int v3 = NFS_ISV3(dvp);
 
+	/*
+	 * XXXACL: This changes the value in vap, which is caller-owned
+	 * memory.  Unfortunately, nfsm_v3attrbuild accepts a full
+	 * vattr, not just the elements.
+	 */
+	vap->va_mode &= ~cmask;
 	if (vap->va_type == VCHR || vap->va_type == VBLK)
 		rdev = txdr_unsigned(vap->va_rdev);
 	else if (vap->va_type == VFIFO || vap->va_type == VSOCK)
@@ -1273,7 +1279,8 @@
 nfs_mknod(struct vop_mknod_args *ap)
 {
 
-	return nfs_mknodrpc(ap->a_dvp, ap->a_vpp, ap->a_cnp, ap->a_vap);
+	return nfs_mknodrpc(ap->a_dvp, ap->a_vpp, ap->a_cnp, ap->a_vap,
+	    ap->a_cmask);
 }
 
 static u_long create_verf;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list