diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-11-04 15:13:36 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-11-04 15:13:36 +0000 |
commit | b8dd64f5ef380fd8a17448566fccf0860a7adc19 (patch) | |
tree | 2f3ad50bb20fd5ec86fb6ebe751e49c2a3679686 /sys/kern/kern_mac.c | |
parent | f3f0e34ca816fad9a22f1b465eda33898a571ada (diff) | |
download | FreeBSD-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/kern/kern_mac.c')
-rw-r--r-- | sys/kern/kern_mac.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/kern/kern_mac.c b/sys/kern/kern_mac.c index d36fbea..64b6f09 100644 --- a/sys/kern/kern_mac.c +++ b/sys/kern/kern_mac.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; |