git: 02ed945ccec4 - main - MAC/do: Rename private struct 'mac_do_rule' => 'rules'
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Dec 2024 14:45:39 UTC
The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=02ed945ccec43340208d3a9c152fb98f55dbed69 commit 02ed945ccec43340208d3a9c152fb98f55dbed69 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2024-07-01 14:28:20 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2024-12-16 14:42:33 +0000 MAC/do: Rename private struct 'mac_do_rule' => 'rules' To simplify and be consistent with 'struct rule'. Reviewed by: bapt Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47593 --- sys/security/mac_do/mac_do.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 4cc2a7971545..5ac77974379c 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -53,12 +53,12 @@ struct rule { TAILQ_ENTRY(rule) r_entries; }; -struct mac_do_rule { +struct rules { char string[MAC_RULE_STRING_LEN]; TAILQ_HEAD(rulehead, rule) head; }; -static struct mac_do_rule rules0; +static struct rules rules0; static void toast_rules(struct rulehead *head) @@ -153,11 +153,11 @@ out: return (error); } -static struct mac_do_rule * +static struct rules * mac_do_rule_find(struct prison *spr, struct prison **prp) { struct prison *pr; - struct mac_do_rule *rules; + struct rules *rules; for (pr = spr;; pr = pr->pr_parent) { mtx_lock(&pr->pr_mtx); @@ -181,7 +181,7 @@ sysctl_rules(SYSCTL_HANDLER_ARGS) char *new_string; struct rulehead head, saved_head; struct prison *pr; - struct mac_do_rule *rules; + struct rules *rules; int error; rules = mac_do_rule_find(req->td->td_ucred->cr_prison, &pr); @@ -229,10 +229,10 @@ destroy(struct mac_policy_conf *mpc) } static void -mac_do_alloc_prison(struct prison *pr, struct mac_do_rule **lrp) +mac_do_alloc_prison(struct prison *pr, struct rules **lrp) { struct prison *ppr; - struct mac_do_rule *rules, *new_rules; + struct rules *rules, *new_rules; void **rsv; rules = mac_do_rule_find(pr, &ppr); @@ -261,7 +261,7 @@ done: static void mac_do_dealloc_prison(void *data) { - struct mac_do_rule *r = data; + struct rules *r = data; toast_rules(&r->head); } @@ -272,7 +272,7 @@ mac_do_prison_set(void *obj, void *data) struct prison *pr = obj; struct vfsoptlist *opts = data; struct rulehead head, saved_head; - struct mac_do_rule *rules; + struct rules *rules; char *rules_string; int error, jsys, len; @@ -319,7 +319,7 @@ mac_do_prison_get(void *obj, void *data) { struct prison *ppr, *pr = obj; struct vfsoptlist *opts = data; - struct mac_do_rule *rules; + struct rules *rules; int jsys, error; rules = mac_do_rule_find(pr, &ppr); @@ -348,7 +348,7 @@ static int mac_do_prison_remove(void *obj, void *data __unused) { struct prison *pr = obj; - struct mac_do_rule *r; + struct rules *r; mtx_lock(&pr->pr_mtx); r = osd_jail_get(pr, mac_do_osd_jail_slot); @@ -420,7 +420,7 @@ priv_grant(struct ucred *cred, int priv) { struct rule *r; struct prison *pr; - struct mac_do_rule *rule; + struct rules *rule; if (do_enabled == 0) return (EPERM); @@ -449,7 +449,7 @@ check_setgroups(struct ucred *cred, int ngrp, gid_t *groups) char *fullpath = NULL; char *freebuf = NULL; struct prison *pr; - struct mac_do_rule *rule; + struct rules *rule; if (do_enabled == 0) return (0); @@ -484,7 +484,7 @@ check_setuid(struct ucred *cred, uid_t uid) char *fullpath = NULL; char *freebuf = NULL; struct prison *pr; - struct mac_do_rule *rule; + struct rules *rule; if (do_enabled == 0) return (0);