PERFORCE change 52309 for review

Andrew Reisse areisse at FreeBSD.org
Wed May 5 19:20:57 GMT 2004


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

Change 52309 by areisse at areisse_ibook on 2004/05/05 12:20:57

	mac_check_vnode_open passes open flags, not access flags.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin73/apsl/xnu/security/sebsd/sebsd.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin73/apsl/xnu/security/sebsd/sebsd.c#2 (text+ko) ====

@@ -48,6 +48,7 @@
 #include <sys/systm.h>
 #include <sys/vnode.h>
 #include <sys/dirent.h>
+#include <sys/fcntl.h>
 
 #ifdef __APPLE__
 /*
@@ -1788,8 +1789,15 @@
 
 static int
 sebsd_check_vnode_open(struct ucred *cred, struct vnode *vp,
-    struct label *filelabel, int acc_mode)
+    struct label *filelabel, int fmode)
 {
+        int acc_mode = 0;
+	if (fmode & O_TRUNC)
+	  acc_mode |= VWRITE;
+	if (fmode & FWRITE)
+	  acc_mode |= VWRITE;
+	if (fmode & FREAD)
+	  acc_mode |= VREAD;
 
 	if (!acc_mode)
 		return 0;
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