From nobody Mon Dec 16 14:45:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YBjRT2mxbz5hWSr; Mon, 16 Dec 2024 14:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBjRS73gCz4d7X; Mon, 16 Dec 2024 14:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLK5aAVi3dlQmhI0b5G7Zl1vb8ckI0UGcPB54Dr0GSU=; b=fzSAsa1gGvg5oyjWb025Qr+8rr3xyKAmnoG2lcwbog3kFWhTdgVsQs7V58tHYV3SvMLahT sJmquZUDUH+FILHTWX80jqeb8q5lGHAb0om445/iWO1HREBm5z/SIb5Re8O8vBCv2juhED ic7tpmvsU4cXmUgwEZZgtuNPVTfz4wEZHW9Exs/AqAnAsAsVaUUfanOKpoyyNruSi+pZlp uCDilfmDxvQfxYLe6fDImVnVE0+qX0ix+kc2rGYP6AtuzIDp0AaWgKgnCSea3DdWYnLymV M+9uRI7wXCbMjy5/5HtX3ZLNHpESVZbsOzaim2bh0Wy52H9BjNLB+iWk5o3DYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLK5aAVi3dlQmhI0b5G7Zl1vb8ckI0UGcPB54Dr0GSU=; b=eZQGkL0jLHYVAHavHS02RhCOMBrFoJYQFjRJv41fp6SS/titqcuiQQrDHxLnp/gEACrZVT G0wsSBI3zlKom+yA9yzyeqsYhrmS/NEKzk/ilF7VtgafMV1iM3bcNjlTcC8aThKiC1n74u ezfsoV9DCz7JlE9Vfer8/S3NaT9I91K5OmzXtJiDwH7Oet/5zab8fDIp0yF4Cah3Pn7sy8 e7IhLCRewZhODLYTaJUigNgWPJdUOACteGn+0LCkYAxsZt1MzL32XKBkbCFYKFC79SMqtk xoIt/Qa4ea5xLHQ5zLiiIwwvVnwJ/2OcGm+Yf0AiNL5sKNi2QNaV6ALdA4ucrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360341; a=rsa-sha256; cv=none; b=Q+DCAgn/haC/VZK//F19U/jVvPPiv9fAkrEncGe3HzSAaIPWhskMDxA8+dU8AGOPD/qhkD /JyYNgzizDDKu5RPenOL4usqMqX0e8bBcUF4TRseISInXdDt8+Ku7ktSpXK53cKI+mtlP2 wVwMQVt4covzFWmsjcDogKxsRMhNaiJXo2Kss1rSTQ4VwjGUUlgw+eHfRp7C8F6cjZ/tXQ W03GAbphklhqWD0oVPUI8JDlk+7T4g5N7WQFG0v6yovq4v8SYBXXLimTgah20j3IyJ/Qpj sxc65eU46HA2FRbZobJFeRNdtcYonLvB4uCwzjhIcp1512jyFL6g60l07oHP7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YBjRS6YY0zxkZ; Mon, 16 Dec 2024 14:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGEjelN052635; Mon, 16 Dec 2024 14:45:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEjeoJ052632; Mon, 16 Dec 2024 14:45:40 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:45:40 GMT Message-Id: <202412161445.4BGEjeoJ052632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 8ce577060498 - main - MAC/do: Rename internal mac_do_rule_find() => find_rules() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ce5770604981a19884604ad532f9528e087c69a Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8ce5770604981a19884604ad532f9528e087c69a commit 8ce5770604981a19884604ad532f9528e087c69a Author: Olivier Certner AuthorDate: 2024-07-01 14:35:12 +0000 Commit: Olivier Certner CommitDate: 2024-12-16 14:42:33 +0000 MAC/do: Rename internal mac_do_rule_find() => find_rules() To simplify, be consistent with the rename 'struct mac_do_rule' => 'struct rules' and other functions, and because this function is internal (and thus is never the first mac_do(4)'s function to appear in a stack trace). Reviewed by: bapt Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47594 --- sys/security/mac_do/mac_do.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 5ac77974379c..1037a4811ada 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -154,7 +154,7 @@ out: } static struct rules * -mac_do_rule_find(struct prison *spr, struct prison **prp) +find_rules(struct prison *spr, struct prison **prp) { struct prison *pr; struct rules *rules; @@ -184,7 +184,7 @@ sysctl_rules(SYSCTL_HANDLER_ARGS) struct rules *rules; int error; - rules = mac_do_rule_find(req->td->td_ucred->cr_prison, &pr); + rules = find_rules(req->td->td_ucred->cr_prison, &pr); mtx_unlock(&pr->pr_mtx); if (req->newptr == NULL) return (sysctl_handle_string(oidp, rules->string, MAC_RULE_STRING_LEN, req)); @@ -235,14 +235,14 @@ mac_do_alloc_prison(struct prison *pr, struct rules **lrp) struct rules *rules, *new_rules; void **rsv; - rules = mac_do_rule_find(pr, &ppr); + rules = find_rules(pr, &ppr); if (ppr == pr) goto done; mtx_unlock(&ppr->pr_mtx); new_rules = malloc(sizeof(*new_rules), M_PRISON, M_WAITOK|M_ZERO); rsv = osd_reserve(mac_do_osd_jail_slot); - rules = mac_do_rule_find(pr, &ppr); + rules = find_rules(pr, &ppr); if (ppr == pr) { free(new_rules, M_PRISON); osd_free_reserved(rsv); @@ -322,7 +322,7 @@ mac_do_prison_get(void *obj, void *data) struct rules *rules; int jsys, error; - rules = mac_do_rule_find(pr, &ppr); + rules = find_rules(pr, &ppr); error = vfs_setopt(opts, "mdo", &jsys, sizeof(jsys)); if (error != 0 && error != ENOENT) goto done; @@ -425,7 +425,7 @@ priv_grant(struct ucred *cred, int priv) if (do_enabled == 0) return (EPERM); - rule = mac_do_rule_find(cred->cr_prison, &pr); + rule = find_rules(cred->cr_prison, &pr); TAILQ_FOREACH(r, &rule->head, r_entries) { if (rule_applies(cred, r)) { switch (priv) { @@ -464,7 +464,7 @@ check_setgroups(struct ucred *cred, int ngrp, gid_t *groups) } free(freebuf, M_TEMP); - rule = mac_do_rule_find(cred->cr_prison, &pr); + rule = find_rules(cred->cr_prison, &pr); TAILQ_FOREACH(r, &rule->head, r_entries) { if (rule_applies(cred, r)) { mtx_unlock(&pr->pr_mtx); @@ -500,7 +500,7 @@ check_setuid(struct ucred *cred, uid_t uid) free(freebuf, M_TEMP); error = EPERM; - rule = mac_do_rule_find(cred->cr_prison, &pr); + rule = find_rules(cred->cr_prison, &pr); TAILQ_FOREACH(r, &rule->head, r_entries) { if (r->from_type == RULE_UID) { if (cred->cr_uid != r->f_uid)