summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_system.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-11-04 15:13:36 +0000
committerrwatson <rwatson@FreeBSD.org>2002-11-04 15:13:36 +0000
commitb8dd64f5ef380fd8a17448566fccf0860a7adc19 (patch)
tree2f3ad50bb20fd5ec86fb6ebe751e49c2a3679686 /sys/security/mac/mac_system.c
parentf3f0e34ca816fad9a22f1b465eda33898a571ada (diff)
downloadFreeBSD-src-b8dd64f5ef380fd8a17448566fccf0860a7adc19.zip
FreeBSD-src-b8dd64f5ef380fd8a17448566fccf0860a7adc19.tar.gz
Permit MAC policies to instrument the access control decisions for
system accounting configuration and for nfsd server thread attach. Policies might use this to protect the integrity or confidentiality of accounting data, limit the ability to turn on or off accounting, as well as to prevent inappropriately labeled threads from becoming nfs server threads. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac/mac_system.c')
-rw-r--r--sys/security/mac/mac_system.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/security/mac/mac_system.c b/sys/security/mac/mac_system.c
index d36fbea..64b6f09 100644
--- a/sys/security/mac/mac_system.c
+++ b/sys/security/mac/mac_system.c
@@ -2470,6 +2470,37 @@ mac_check_socket_visible(struct ucred *cred, struct socket *socket)
}
int
+mac_check_system_acct(struct ucred *cred, struct vnode *vp)
+{
+ int error;
+
+ if (vp != NULL) {
+ ASSERT_VOP_LOCKED(vp, "mac_check_system_acct");
+ }
+
+ if (!mac_enforce_system)
+ return (0);
+
+ MAC_CHECK(check_system_acct, cred, vp,
+ vp != NULL ? &vp->v_label : NULL);
+
+ return (error);
+}
+
+int
+mac_check_system_nfsd(struct ucred *cred)
+{
+ int error;
+
+ if (!mac_enforce_system)
+ return (0);
+
+ MAC_CHECK(check_system_nfsd, cred);
+
+ return (error);
+}
+
+int
mac_check_system_reboot(struct ucred *cred, int howto)
{
int error;
OpenPOWER on IntegriCloud