Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2002 12:23:30 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 14621 for review
Message-ID:  <200207211923.g6LJNUNH093231@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14621

Change 14621 by rwatson@rwatson_curry on 2002/07/21 12:22:43

	A couple of VFS/MAC cleanups including:
	
	- Authorize readdir using readdir check rather than search check
	- Stick in an open check until the emulator is fixed to use
	  vn_open()

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/compat/linux/linux_file.c#6 edit
.. //depot/projects/trustedbsd/mac/sys/compat/linux/linux_getcwd.c#6 edit
.. //depot/projects/trustedbsd/mac/sys/compat/linux/linux_misc.c#12 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/compat/linux/linux_file.c#6 (text+ko) ====

@@ -331,7 +331,7 @@
 	/*
 	 * Do directory search MAC check using non-cached credentials.
 	 */
-	if ((error = mac_cred_check_search_vnode(td->td_proc->p_ucred, vp))
+	if ((error = mac_cred_check_readdir_vnode(td->td_proc->p_ucred, vp))
 		goto out;
 #endif /* MAC */
 	if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies,

==== //depot/projects/trustedbsd/mac/sys/compat/linux/linux_getcwd.c#6 (text+ko) ====

@@ -203,7 +203,7 @@
 		eofflag = 0;
 
 #ifdef MAC
-		error = mac_cred_check_search_vnode(td->td_ucred, uvp);
+		error = mac_cred_check_readdir_vnode(td->td_ucred, uvp);
 		if (error == 0)
 #endif /* MAC */
 			error = VOP_READDIR(uvp, &uio, td->td_ucred, &eofflag,

==== //depot/projects/trustedbsd/mac/sys/compat/linux/linux_misc.c#12 (text+ko) ====

@@ -307,6 +307,11 @@
 	 * authorized.  It would also remove lots of duplicated code
 	 * from vn_open().
 	 */
+#ifdef MAC
+	error = mac_cred_check_open_vnode(td->td_ucred, vp, FREAD);
+	if (error)
+		goto cleanup;
+#endif
 	error = VOP_OPEN(vp, FREAD, td->td_ucred, td);
 	if (error)
 		goto cleanup;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207211923.g6LJNUNH093231>