diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-10-25 11:31:11 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-10-25 11:31:11 +0000 |
commit | 2fd98af619b989e0cb105bb5b81e41d895fd8e20 (patch) | |
tree | 61b4f64bfe3a4b94291e8d7bf90db127671545c7 /sys/security/mac_seeotheruids | |
parent | 9d167f82e426b3c6481ebd3bcdba5afbae063a7d (diff) | |
download | FreeBSD-src-2fd98af619b989e0cb105bb5b81e41d895fd8e20.zip FreeBSD-src-2fd98af619b989e0cb105bb5b81e41d895fd8e20.tar.gz |
Consistently name functions for mac_<policy> as <policy>_whatever rather
than mac_<policy>_whatever, as this shortens the names and makes the code
a bit easier to read.
When dealing with label structures, name variables 'mb', 'ml', 'mm rather
than the longer 'mac_biba', 'mac_lomac', and 'mac_mls', likewise making
the code a little easier to read.
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security/mac_seeotheruids')
-rw-r--r-- | sys/security/mac_seeotheruids/mac_seeotheruids.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sys/security/mac_seeotheruids/mac_seeotheruids.c b/sys/security/mac_seeotheruids/mac_seeotheruids.c index 8681b86..ae88ac3 100644 --- a/sys/security/mac_seeotheruids/mac_seeotheruids.c +++ b/sys/security/mac_seeotheruids/mac_seeotheruids.c @@ -61,9 +61,9 @@ SYSCTL_DECL(_security_mac); SYSCTL_NODE(_security_mac, OID_AUTO, seeotheruids, CTLFLAG_RW, 0, "TrustedBSD mac_seeotheruids policy controls"); -static int mac_seeotheruids_enabled = 1; +static int seeotheruids_enabled = 1; SYSCTL_INT(_security_mac_seeotheruids, OID_AUTO, enabled, CTLFLAG_RW, - &mac_seeotheruids_enabled, 0, "Enforce seeotheruids policy"); + &seeotheruids_enabled, 0, "Enforce seeotheruids policy"); /* * Exception: allow credentials to be aware of other credentials with the @@ -97,10 +97,10 @@ SYSCTL_INT(_security_mac_seeotheruids, OID_AUTO, specificgid, CTLFLAG_RW, &specificgid, 0, "Specific gid to be exempt from seeotheruids policy"); static int -mac_seeotheruids_check(struct ucred *cr1, struct ucred *cr2) +seeotheruids_check(struct ucred *cr1, struct ucred *cr2) { - if (!mac_seeotheruids_enabled) + if (!seeotheruids_enabled) return (0); if (primarygroup_enabled) { @@ -126,50 +126,50 @@ mac_seeotheruids_check(struct ucred *cr1, struct ucred *cr2) } static int -mac_seeotheruids_cred_check_visible(struct ucred *cr1, struct ucred *cr2) +seeotheruids_cred_check_visible(struct ucred *cr1, struct ucred *cr2) { - return (mac_seeotheruids_check(cr1, cr2)); + return (seeotheruids_check(cr1, cr2)); } static int -mac_seeotheruids_proc_check_signal(struct ucred *cred, struct proc *p, +seeotheruids_proc_check_signal(struct ucred *cred, struct proc *p, int signum) { - return (mac_seeotheruids_check(cred, p->p_ucred)); + return (seeotheruids_check(cred, p->p_ucred)); } static int -mac_seeotheruids_proc_check_sched(struct ucred *cred, struct proc *p) +seeotheruids_proc_check_sched(struct ucred *cred, struct proc *p) { - return (mac_seeotheruids_check(cred, p->p_ucred)); + return (seeotheruids_check(cred, p->p_ucred)); } static int -mac_seeotheruids_proc_check_debug(struct ucred *cred, struct proc *p) +seeotheruids_proc_check_debug(struct ucred *cred, struct proc *p) { - return (mac_seeotheruids_check(cred, p->p_ucred)); + return (seeotheruids_check(cred, p->p_ucred)); } static int -mac_seeotheruids_socket_check_visible(struct ucred *cred, struct socket *so, +seeotheruids_socket_check_visible(struct ucred *cred, struct socket *so, struct label *solabel) { - return (mac_seeotheruids_check(cred, so->so_cred)); + return (seeotheruids_check(cred, so->so_cred)); } -static struct mac_policy_ops mac_seeotheruids_ops = +static struct mac_policy_ops seeotheruids_ops = { - .mpo_cred_check_visible = mac_seeotheruids_cred_check_visible, - .mpo_proc_check_debug = mac_seeotheruids_proc_check_debug, - .mpo_proc_check_sched = mac_seeotheruids_proc_check_sched, - .mpo_proc_check_signal = mac_seeotheruids_proc_check_signal, - .mpo_socket_check_visible = mac_seeotheruids_socket_check_visible, + .mpo_cred_check_visible = seeotheruids_cred_check_visible, + .mpo_proc_check_debug = seeotheruids_proc_check_debug, + .mpo_proc_check_sched = seeotheruids_proc_check_sched, + .mpo_proc_check_signal = seeotheruids_proc_check_signal, + .mpo_socket_check_visible = seeotheruids_socket_check_visible, }; -MAC_POLICY_SET(&mac_seeotheruids_ops, mac_seeotheruids, +MAC_POLICY_SET(&seeotheruids_ops, mac_seeotheruids, "TrustedBSD MAC/seeotheruids", MPC_LOADTIME_FLAG_UNLOADOK, NULL); |