PERFORCE change 26386 for review

Robert Watson rwatson at freebsd.org
Wed Mar 5 20:17:20 GMT 2003


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

Change 26386 by rwatson at rwatson_tislabs on 2003/03/05 12:17:00

	Correct a bug in the handling of mac_check_vnode_setflags()
	werein an uninitialized value is passed to the MAC Framework.
	Restructure the code a bit to look like the checks for
	setowner, setmode by initializing the vattr structure
	regardless of success of the MAC check.  This isn't the
	exact patch submitted, as a result.
	
	Submitted by:	mike halderman <mrh at spawar.navy.mil>

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#100 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#100 (text+ko) ====

@@ -1943,16 +1943,13 @@
 		return (error);
 	VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+	VATTR_NULL(&vattr);
+	vattr.va_flags = flags;
 #ifdef MAC
 	error = mac_check_vnode_setflags(td->td_ucred, vp, vattr.va_flags);
-	if (error == 0) {
+	if (error == 0)
 #endif
-		VATTR_NULL(&vattr);
-		vattr.va_flags = flags;
 		error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
-#ifdef MAC
-	}
-#endif
 	VOP_UNLOCK(vp, 0, td);
 	vn_finished_write(mp);
 	return (error);
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