summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mac.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-27 06:54:06 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-27 06:54:06 +0000
commit8cd9e638192b755dfb25a68d8cef5abe0c9e00be (patch)
tree1612d5b0cc84eb1545dbda241cb9bb8369f47bd2 /sys/kern/kern_mac.c
parent09dbfe82dc55ef20e7c63a4c84529f2efcda0c9c (diff)
downloadFreeBSD-src-8cd9e638192b755dfb25a68d8cef5abe0c9e00be.zip
FreeBSD-src-8cd9e638192b755dfb25a68d8cef5abe0c9e00be.tar.gz
Merge from MAC tree: rename mac_check_vnode_swapon() to
mac_check_system_swapon(), to reflect the fact that the primary object of this change is the running kernel as a whole, rather than just the vnode. We'll drop additional checks of this class into the same check namespace, including reboot(), sysctl(), et al. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/kern/kern_mac.c')
-rw-r--r--sys/kern/kern_mac.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/kern/kern_mac.c b/sys/kern/kern_mac.c
index 2ff4162..b757be6 100644
--- a/sys/kern/kern_mac.c
+++ b/sys/kern/kern_mac.c
@@ -899,6 +899,10 @@ mac_policy_register(struct mac_policy_conf *mpc)
mpc->mpc_ops->mpo_check_socket_visible =
mpe->mpe_function;
break;
+ case MAC_CHECK_SYSTEM_SWAPON:
+ mpc->mpc_ops->mpo_check_system_swapon =
+ mpe->mpe_function;
+ break;
case MAC_CHECK_VNODE_ACCESS:
mpc->mpc_ops->mpo_check_vnode_access =
mpe->mpe_function;
@@ -1019,10 +1023,6 @@ mac_policy_register(struct mac_policy_conf *mpc)
mpc->mpc_ops->mpo_check_vnode_stat =
mpe->mpe_function;
break;
- case MAC_CHECK_VNODE_SWAPON:
- mpc->mpc_ops->mpo_check_vnode_swapon =
- mpe->mpe_function;
- break;
case MAC_CHECK_VNODE_WRITE:
mpc->mpc_ops->mpo_check_vnode_write =
mpe->mpe_function;
@@ -2304,20 +2304,6 @@ mac_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred,
}
int
-mac_check_vnode_swapon(struct ucred *cred, struct vnode *vp)
-{
- int error;
-
- ASSERT_VOP_LOCKED(vp, "mac_check_vnode_swapon");
-
- if (!mac_enforce_fs)
- return (0);
-
- MAC_CHECK(check_vnode_swapon, cred, vp, &vp->v_label);
- return (error);
-}
-
-int
mac_check_vnode_write(struct ucred *active_cred, struct ucred *file_cred,
struct vnode *vp)
{
@@ -3011,6 +2997,20 @@ mac_check_socket_visible(struct ucred *cred, struct socket *socket)
}
int
+mac_check_system_swapon(struct ucred *cred, struct vnode *vp)
+{
+ int error;
+
+ ASSERT_VOP_LOCKED(vp, "mac_check_system_swapon");
+
+ if (!mac_enforce_fs)
+ return (0);
+
+ MAC_CHECK(check_system_swapon, cred, vp, &vp->v_label);
+ return (error);
+}
+
+int
mac_ioctl_ifnet_get(struct ucred *cred, struct ifreq *ifr,
struct ifnet *ifnet)
{
OpenPOWER on IntegriCloud