PERFORCE change 100744 for review

Robert Watson rwatson at FreeBSD.org
Thu Jul 6 13:16:34 UTC 2006


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

Change 100744 by rwatson at rwatson_zoo on 2006/07/06 13:15:26

	More renaming.

Affected files ...

.. //depot/projects/trustedbsd/mac2/sys/kern/uipc_mbuf2.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/uipc_socket.c#4 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/uipc_usrreq.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_lookup.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_mount.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_subr.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_syscalls.c#3 edit
.. //depot/projects/trustedbsd/mac2/sys/kern/vfs_vnops.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/mac2/sys/kern/uipc_mbuf2.c#3 (text+ko) ====

@@ -308,7 +308,7 @@
 {
 #ifdef MAC
 	if (t->m_tag_id == PACKET_TAG_MACLABEL)
-		mac_destroy_mbuf_tag(t);
+		mac_mbuf_tag_destroy(t);
 #endif
 	free(t, M_PACKET_TAGS);
 }
@@ -412,11 +412,11 @@
 	 * special from the mbuf code?
 	 */
 	if (t->m_tag_id == PACKET_TAG_MACLABEL) {
-		if (mac_init_mbuf_tag(p, how) != 0) {
+		if (mac_mbuf_tag_init(p, how) != 0) {
 			m_tag_free(p);
 			return (NULL);
 		}
-		mac_copy_mbuf_tag(t, p);
+		mac_mbuf_tag_copy(t, p);
 	} else
 #endif
 		bcopy(t + 1, p + 1, t->m_tag_len); /* Copy the data */

==== //depot/projects/trustedbsd/mac2/sys/kern/uipc_socket.c#4 (text+ko) ====

@@ -101,6 +101,7 @@
 #include <sys/fcntl.h>
 #include <sys/limits.h>
 #include <sys/lock.h>
+#include <sys/mac.h>
 #include <sys/mac_framework.h>
 #include <sys/malloc.h>
 #include <sys/mbuf.h>

==== //depot/projects/trustedbsd/mac2/sys/kern/uipc_usrreq.c#3 (text+ko) ====

@@ -817,7 +817,7 @@
 	vattr.va_type = VSOCK;
 	vattr.va_mode = (ACCESSPERMS & ~td->td_proc->p_fd->fd_cmask);
 #ifdef MAC
-	error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
+	error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
 	    &vattr);
 #endif
 	if (error == 0) {
@@ -951,8 +951,8 @@
 			unp3->unp_flags |= UNP_WANTCRED;
 #ifdef MAC
 		SOCK_LOCK(so);
-		mac_set_socket_peer_from_socket(so, so3);
-		mac_set_socket_peer_from_socket(so3, so);
+		mac_socket_set_peer_from_socket(so, so3);
+		mac_socket_set_peer_from_socket(so3, so);
 		SOCK_UNLOCK(so);
 #endif
 

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_lookup.c#3 (text+ko) ====

@@ -244,7 +244,7 @@
 		}
 #ifdef MAC
 		if ((cnp->cn_flags & NOMACCHECK) == 0) {
-			error = mac_check_vnode_readlink(td->td_ucred,
+			error = mac_vnode_check_readlink(td->td_ucred,
 			    ndp->ni_vp);
 			if (error)
 				break;
@@ -536,7 +536,7 @@
 unionlookup:
 #ifdef MAC
 	if ((cnp->cn_flags & NOMACCHECK) == 0) {
-		error = mac_check_vnode_lookup(td->td_ucred, dp, cnp);
+		error = mac_vnode_check_lookup(td->td_ucred, dp, cnp);
 		if (error)
 			goto bad;
 	}

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_mount.c#3 (text+ko) ====

@@ -479,8 +479,8 @@
 	strlcpy(mp->mnt_stat.f_mntonname, fspath, MNAMELEN);
 	mp->mnt_iosize_max = DFLTPHYS;
 #ifdef MAC
-	mac_init_mount(mp);
-	mac_create_mount(td->td_ucred, mp);
+	mac_mount_init(mp);
+	mac_mount_create(td->td_ucred, mp);
 #endif
 	arc4rand(&mp->mnt_hashseed, sizeof mp->mnt_hashseed, 0);
 	return (mp);
@@ -558,7 +558,7 @@
 	mp->mnt_secondary_writes = -1000;
 	MNT_IUNLOCK(mp);
 #ifdef MAC
-	mac_destroy_mount(mp);
+	mac_mount_destroy(mp);
 #endif
 	if (mp->mnt_opt != NULL)
 		vfs_freeopts(mp->mnt_opt);

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_subr.c#3 (text+ko) ====

@@ -797,7 +797,7 @@
 	lockdestroy(vp->v_vnlock);
 	mtx_destroy(&vp->v_interlock);
 #ifdef MAC
-	mac_destroy_vnode(vp);
+	mac_vnode_destroy(vp);
 #endif
 	uma_zfree(vnode_zone, vp);
 }
@@ -920,9 +920,9 @@
 	v_incr_usecount(vp);
 	vp->v_data = 0;
 #ifdef MAC
-	mac_init_vnode(vp);
+	mac_vnode_init(vp);
 	if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0)
-		mac_associate_vnode_singlelabel(mp, vp);
+		mac_vnode_associate_singlelabel(mp, vp);
 	else if (mp == NULL)
 		printf("NULL mp in getnewvnode()\n");
 #endif

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

@@ -252,7 +252,7 @@
 	NDFREE(&nd, NDF_ONLY_PNBUF);
 	vput(nd.ni_vp);
 #ifdef MAC
-	error = mac_check_mount_stat(td->td_ucred, mp);
+	error = mac_mount_check_stat(td->td_ucred, mp);
 	if (error) {
 		vfs_rel(mp);
 		goto out;
@@ -341,7 +341,7 @@
 		goto out;
 	}
 #ifdef MAC
-	error = mac_check_mount_stat(td->td_ucred, mp);
+	error = mac_mount_check_stat(td->td_ucred, mp);
 	if (error) {
 		vfs_rel(mp);
 		goto out;
@@ -434,7 +434,7 @@
 			continue;
 		}
 #ifdef MAC
-		if (mac_check_mount_stat(td->td_ucred, mp) != 0) {
+		if (mac_mount_check_stat(td->td_ucred, mp) != 0) {
 			nmp = TAILQ_NEXT(mp, mnt_list);
 			continue;
 		}
@@ -700,7 +700,7 @@
 	if (vp->v_type != VDIR)
 		error = ENOTDIR;
 #ifdef MAC
-	else if ((error = mac_check_vnode_chdir(td->td_ucred, vp)) != 0) {
+	else if ((error = mac_vnode_check_chdir(td->td_ucred, vp)) != 0) {
 	}
 #endif
 	else
@@ -860,7 +860,7 @@
 	if ((error = change_dir(nd.ni_vp, td)) != 0)
 		goto e_vunlock;
 #ifdef MAC
-	if ((error = mac_check_vnode_chroot(td->td_ucred, nd.ni_vp)))
+	if ((error = mac_vnode_check_chroot(td->td_ucred, nd.ni_vp)))
 		goto e_vunlock;
 #endif
 	VOP_UNLOCK(nd.ni_vp, 0, td);
@@ -892,7 +892,7 @@
 	if (vp->v_type != VDIR)
 		return (ENOTDIR);
 #ifdef MAC
-	error = mac_check_vnode_chdir(td->td_ucred, vp);
+	error = mac_vnode_check_chdir(td->td_ucred, vp);
 	if (error)
 		return (error);
 #endif
@@ -902,8 +902,8 @@
 
 /*
  * Common routine for kern_chroot() and jail_attach().  The caller is
- * responsible for invoking suser() and mac_check_chroot() to authorize this
- * operation.
+ * responsible for invoking suser() and mac_vnode_check_chroot() to authorize
+ * this operation.
  */
 int
 change_root(vp, td)
@@ -1102,7 +1102,7 @@
 		vat.va_size = 0;
 		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
 #ifdef MAC
-		error = mac_check_vnode_write(td->td_ucred, fp->f_cred, vp);
+		error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp);
 		if (error == 0)
 #endif
 			error = VOP_SETATTR(vp, &vat, td->td_ucred, td);
@@ -1254,7 +1254,7 @@
 	}
 #ifdef MAC
 	if (error == 0 && !whiteout)
-		error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp,
+		error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp,
 		    &nd.ni_cnd, &vattr);
 #endif
 	if (!error) {
@@ -1337,7 +1337,7 @@
 	vattr.va_mode = (mode & ALLPERMS) & ~td->td_proc->p_fd->fd_cmask;
 	FILEDESC_UNLOCK_FAST(td->td_proc->p_fd);
 #ifdef MAC
-	error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
+	error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
 	    &vattr);
 	if (error)
 		goto out;
@@ -1466,7 +1466,7 @@
 			error = can_hardlink(vp, td, td->td_ucred);
 			if (error == 0)
 #ifdef MAC
-				error = mac_check_vnode_link(td->td_ucred,
+				error = mac_vnode_check_link(td->td_ucred,
 				    nd.ni_dvp, vp, &nd.ni_cnd);
 			if (error == 0)
 #endif
@@ -1554,7 +1554,7 @@
 	FILEDESC_UNLOCK_FAST(td->td_proc->p_fd);
 #ifdef MAC
 	vattr.va_type = VLNK;
-	error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
+	error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
 	    &vattr);
 	if (error)
 		goto out2;
@@ -1692,7 +1692,7 @@
 			goto restart;
 		}
 #ifdef MAC
-		error = mac_check_vnode_delete(td->td_ucred, nd.ni_dvp, vp,
+		error = mac_vnode_check_unlink(td->td_ucred, nd.ni_dvp, vp,
 		    &nd.ni_cnd);
 		if (error)
 			goto out;
@@ -1853,7 +1853,7 @@
 		if (user_flags & X_OK)
 			flags |= VEXEC;
 #ifdef MAC
-		error = mac_check_vnode_access(cred, vp, flags);
+		error = mac_vnode_check_access(cred, vp, flags);
 		if (error)
 			return (error);
 #endif
@@ -2322,7 +2322,7 @@
 	vfslocked = NDHASGIANT(&nd);
 	vp = nd.ni_vp;
 #ifdef MAC
-	error = mac_check_vnode_readlink(td->td_ucred, vp);
+	error = mac_vnode_check_readlink(td->td_ucred, vp);
 	if (error) {
 		vput(vp);
 		VFS_UNLOCK_GIANT(vfslocked);
@@ -2381,7 +2381,7 @@
 	VATTR_NULL(&vattr);
 	vattr.va_flags = flags;
 #ifdef MAC
-	error = mac_check_vnode_setflags(td->td_ucred, vp, vattr.va_flags);
+	error = mac_vnode_check_setflags(td->td_ucred, vp, vattr.va_flags);
 	if (error == 0)
 #endif
 		error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
@@ -2509,7 +2509,7 @@
 	VATTR_NULL(&vattr);
 	vattr.va_mode = mode & ALLPERMS;
 #ifdef MAC
-	error = mac_check_vnode_setmode(td->td_ucred, vp, vattr.va_mode);
+	error = mac_vnode_check_setmode(td->td_ucred, vp, vattr.va_mode);
 	if (error == 0)
 #endif
 		error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
@@ -2651,7 +2651,7 @@
 	vattr.va_uid = uid;
 	vattr.va_gid = gid;
 #ifdef MAC
-	error = mac_check_vnode_setowner(td->td_ucred, vp, vattr.va_uid,
+	error = mac_vnode_check_setowner(td->td_ucred, vp, vattr.va_uid,
 	    vattr.va_gid);
 	if (error == 0)
 #endif
@@ -2854,7 +2854,7 @@
 	if (nullflag)
 		vattr.va_vaflags |= VA_UTIMES_NULL;
 #ifdef MAC
-	error = mac_check_vnode_setutimes(td->td_ucred, vp, vattr.va_atime,
+	error = mac_vnode_check_setutimes(td->td_ucred, vp, vattr.va_atime,
 	    vattr.va_mtime);
 #endif
 	if (error == 0)
@@ -3050,7 +3050,7 @@
 	if (vp->v_type == VDIR)
 		error = EISDIR;
 #ifdef MAC
-	else if ((error = mac_check_vnode_write(td->td_ucred, NOCRED, vp))) {
+	else if ((error = mac_vnode_check_write(td->td_ucred, NOCRED, vp))) {
 	}
 #endif
 	else if ((error = vn_writechk(vp)) == 0 &&
@@ -3110,7 +3110,7 @@
 	if (vp->v_type == VDIR)
 		error = EISDIR;
 #ifdef MAC
-	else if ((error = mac_check_vnode_write(td->td_ucred, fp->f_cred,
+	else if ((error = mac_vnode_check_write(td->td_ucred, fp->f_cred,
 	    vp))) {
 	}
 #endif
@@ -3275,7 +3275,7 @@
 	fvfslocked = NDHASGIANT(&fromnd);
 	tvfslocked = 0;
 #ifdef MAC
-	error = mac_check_vnode_rename_from(td->td_ucred, fromnd.ni_dvp,
+	error = mac_vnode_check_rename_from(td->td_ucred, fromnd.ni_dvp,
 	    fromnd.ni_vp, &fromnd.ni_cnd);
 	VOP_UNLOCK(fromnd.ni_dvp, 0, td);
 	VOP_UNLOCK(fromnd.ni_vp, 0, td);
@@ -3325,7 +3325,7 @@
 		error = -1;
 #ifdef MAC
 	else
-		error = mac_check_vnode_rename_to(td->td_ucred, tdvp,
+		error = mac_vnode_check_rename_to(td->td_ucred, tdvp,
 		    tond.ni_vp, fromnd.ni_dvp == tdvp, &tond.ni_cnd);
 #endif
 out:
@@ -3435,7 +3435,7 @@
 	vattr.va_mode = (mode & ACCESSPERMS) &~ td->td_proc->p_fd->fd_cmask;
 	FILEDESC_UNLOCK_FAST(td->td_proc->p_fd);
 #ifdef MAC
-	error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
+	error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
 	    &vattr);
 	if (error)
 		goto out;
@@ -3509,7 +3509,7 @@
 		goto out;
 	}
 #ifdef MAC
-	error = mac_check_vnode_delete(td->td_ucred, nd.ni_dvp, vp,
+	error = mac_vnode_check_unlink(td->td_ucred, nd.ni_dvp, vp,
 	    &nd.ni_cnd);
 	if (error)
 		goto out;
@@ -3598,7 +3598,7 @@
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
 	loff = auio.uio_offset = fp->f_offset;
 #ifdef MAC
-	error = mac_check_vnode_readdir(td->td_ucred, vp);
+	error = mac_vnode_check_readdir(td->td_ucred, vp);
 	if (error) {
 		VOP_UNLOCK(vp, 0, td);
 		fdrop(fp, td);
@@ -3752,7 +3752,7 @@
 	AUDIT_ARG(vnode, vp, ARG_VNODE1);
 	loff = auio.uio_offset = fp->f_offset;
 #ifdef MAC
-	error = mac_check_vnode_readdir(td->td_ucred, vp);
+	error = mac_vnode_check_readdir(td->td_ucred, vp);
 	if (error == 0)
 #endif
 		error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL,
@@ -3884,7 +3884,7 @@
 		goto out;
 	}
 #ifdef MAC
-	error = mac_check_vnode_revoke(td->td_ucred, vp);
+	error = mac_vnode_check_revoke(td->td_ucred, vp);
 	if (error)
 		goto out;
 #endif
@@ -4109,7 +4109,7 @@
 	if (fmode & O_APPEND)
 		mode |= VAPPEND;
 #ifdef MAC
-	error = mac_check_vnode_open(td->td_ucred, vp, mode);
+	error = mac_vnode_check_open(td->td_ucred, vp, mode);
 	if (error)
 		goto bad;
 #endif
@@ -4131,7 +4131,7 @@
 		 * We don't yet have fp->f_cred, so use td->td_ucred, which
 		 * should be right.
 		 */
-		error = mac_check_vnode_write(td->td_ucred, td->td_ucred, vp);
+		error = mac_vnode_check_write(td->td_ucred, td->td_ucred, vp);
 		if (error == 0) {
 #endif
 			VATTR_NULL(vap);
@@ -4323,7 +4323,7 @@
 	if (error)
 		goto out;
 #ifdef MAC
-	error = mac_check_mount_stat(td->td_ucred, mp);
+	error = mac_mount_check_stat(td->td_ucred, mp);
 	if (error)
 		goto out;
 #endif
@@ -4477,7 +4477,7 @@
 	cnt = nbytes;
 
 #ifdef MAC
-	error = mac_check_vnode_setextattr(td->td_ucred, vp, attrnamespace,
+	error = mac_vnode_check_setextattr(td->td_ucred, vp, attrnamespace,
 	    attrname, &auio);
 	if (error)
 		goto done;
@@ -4648,7 +4648,7 @@
 		sizep = &size;
 
 #ifdef MAC
-	error = mac_check_vnode_getextattr(td->td_ucred, vp, attrnamespace,
+	error = mac_vnode_check_getextattr(td->td_ucred, vp, attrnamespace,
 	    attrname, &auio);
 	if (error)
 		goto done;
@@ -4795,7 +4795,7 @@
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
 
 #ifdef MAC
-	error = mac_check_vnode_deleteextattr(td->td_ucred, vp, attrnamespace,
+	error = mac_vnode_check_deleteextattr(td->td_ucred, vp, attrnamespace,
 	    attrname);
 	if (error)
 		goto done;
@@ -4952,7 +4952,7 @@
 		sizep = &size;
 
 #ifdef MAC
-	error = mac_check_vnode_listextattr(td->td_ucred, vp, attrnamespace);
+	error = mac_vnode_check_listextattr(td->td_ucred, vp, attrnamespace);
 	if (error)
 		goto done;
 #endif

==== //depot/projects/trustedbsd/mac2/sys/kern/vfs_vnops.c#3 (text+ko) ====

@@ -145,7 +145,7 @@
 				goto restart;
 			}
 #ifdef MAC
-			error = mac_check_vnode_create(cred, ndp->ni_dvp,
+			error = mac_vnode_check_create(cred, ndp->ni_dvp,
 			    &ndp->ni_cnd, vap);
 			if (error == 0) {
 #endif
@@ -210,7 +210,7 @@
 	if (fmode & O_APPEND)
 		mode |= VAPPEND;
 #ifdef MAC
-	error = mac_check_vnode_open(cred, vp, mode);
+	error = mac_vnode_check_open(cred, vp, mode);
 	if (error)
 		goto bad;
 #endif
@@ -381,10 +381,10 @@
 #ifdef MAC
 	if ((ioflg & IO_NOMACCHECK) == 0) {
 		if (rw == UIO_READ)
-			error = mac_check_vnode_read(active_cred, file_cred,
+			error = mac_vnode_check_read(active_cred, file_cred,
 			    vp);
 		else
-			error = mac_check_vnode_write(active_cred, file_cred,
+			error = mac_vnode_check_write(active_cred, file_cred,
 			    vp);
 	}
 #endif
@@ -514,7 +514,7 @@
 	ioflag |= sequential_heuristic(uio, fp);
 
 #ifdef MAC
-	error = mac_check_vnode_read(active_cred, fp->f_cred, vp);
+	error = mac_vnode_check_read(active_cred, fp->f_cred, vp);
 	if (error == 0)
 #endif
 		error = VOP_READ(vp, uio, ioflag, fp->f_cred);
@@ -574,7 +574,7 @@
 		uio->uio_offset = fp->f_offset;
 	ioflag |= sequential_heuristic(uio, fp);
 #ifdef MAC
-	error = mac_check_vnode_write(active_cred, fp->f_cred, vp);
+	error = mac_vnode_check_write(active_cred, fp->f_cred, vp);
 	if (error == 0)
 #endif
 		error = VOP_WRITE(vp, uio, ioflag, fp->f_cred);
@@ -629,7 +629,7 @@
 	u_short mode;
 
 #ifdef MAC
-	error = mac_check_vnode_stat(active_cred, file_cred, vp);
+	error = mac_vnode_check_stat(active_cred, file_cred, vp);
 	if (error)
 		return (error);
 #endif
@@ -782,7 +782,7 @@
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 #ifdef MAC
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
-	error = mac_check_vnode_poll(active_cred, fp->f_cred, vp);
+	error = mac_vnode_check_poll(active_cred, fp->f_cred, vp);
 	VOP_UNLOCK(vp, 0, td);
 	if (!error)
 #endif


More information about the trustedbsd-cvs mailing list