From nobody Sat Nov 02 20:39:26 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 4XgqMy1bxLz5chFh; Sat, 02 Nov 2024 20:39:26 +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 4XgqMy1BWcz43rD; Sat, 2 Nov 2024 20:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579966; 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=1qhytyhP56yig/BL53kUz3E4mTsh3BYRNpytXS60tKo=; b=mrHa4684m5wb672QXKRf9rDjHrFyHU+qFe7+pv8WT/50TdcUU985i1Bn6j145bX05zUU7Y YA00qyvEQBcDKlklfFjrkkART9yYiCCKd+17qDR7WgD8UlgnkzRm54iqu88aQMIp4LuV9K M/NPM2vQuTZ0wzJaCksMQ7xH+3B1xDXJWDEEy6EJRxnXU4d2nDPb2pR7D1MmOsvC4TXkXg zbRgvp1BT030H2zaWHu8HZo/vwLP5W4SHKepNiYlOAib6jXb03aNVs1HXZuJNm83W+zBH0 LRmoIt8dWZ+WsXz1LEHFyRo2M8vCXFaphkQad9YngcSPHkxWJLUz8qkVKIWBig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579966; 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=1qhytyhP56yig/BL53kUz3E4mTsh3BYRNpytXS60tKo=; b=hFu7+eOclbRYQh+4kJsly+DHGuPZ7+H79ca/UKHODQo/FphevO7yJdh7+1zDkeg5OMBab5 2z5o7p9o5wZ9ebI5Mu5o8Mpg3Q7IZ5R/APWPJ7pY00Y0gAb71EjebPe2t6FvvkfV1VotKY l0SpbIpgXWZWUsauA7wuit/ocAuoP242o1m5Z/Un4HOCsKnvI6oEJWsdtW7N/L0zj7Vvfx i3ZcHdXslhjeByzJ4/5Ak6XRiwqZ/vmuNZsEDZowjy0K2NfrEAQG2EcySxbjaEydHaMiKe RW1ifblRHaTLIZDY7J5NsaxranxF/y1vGpkhfapSxtBivoH0W891ZSViJ2XQYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579966; a=rsa-sha256; cv=none; b=VT9NE/IjLg/tzEptdPksD3hfu0w/wXbEtXQc/jq9szOeHviL3lvZ2VG9Xh6LG312yYjcy9 N4P82yhNXJPjzNLeQbHIn/Do0riog/fzriOarkturTnmYzNSF84d3NdZ3F4SfUCVLpC1eq n3eGTzfQTh1pxOIYC6sFOuxwiwbKIqARPcLcQVkoxCA2VzM4UuOV6BdiKoivsOzKzdtrtn eZ+sfYGV++Lm5ualfSq0hBwzRX4a+chELi2lqOGi1IA0aM71EBssoIn/6CIYjpS8uefG4V l3VX5QCGTawF4JHmbQfPEYGnotumZBKxw95cwNVbqftiASHE7fwd3AT8Y0C/Uw== 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 4XgqMy0p3jzKF8; Sat, 2 Nov 2024 20:39:26 +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 4A2KdQDi046067; Sat, 2 Nov 2024 20:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdQ85046064; Sat, 2 Nov 2024 20:39:26 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:26 GMT Message-Id: <202411022039.4A2KdQ85046064@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: b15110fb0dc6 - main - cred: Constify signature of groupmember() and realgroupmember() 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: b15110fb0dc6f0480482616f22bda3a2a19fbd80 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b15110fb0dc6f0480482616f22bda3a2a19fbd80 commit b15110fb0dc6f0480482616f22bda3a2a19fbd80 Author: Olivier Certner AuthorDate: 2024-10-30 10:59:49 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:40 +0000 cred: Constify signature of groupmember() and realgroupmember() Reviewed by emaste Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47343 --- share/man/man9/groupmember.9 | 6 +++--- sys/kern/kern_prot.c | 4 ++-- sys/sys/ucred.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/share/man/man9/groupmember.9 b/share/man/man9/groupmember.9 index db2138ef088a..e7e28bae3ac9 100644 --- a/share/man/man9/groupmember.9 +++ b/share/man/man9/groupmember.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd August 18, 2023 +.Dd October 31, 2024 .Dt GROUPMEMBER 9 .Os .Sh NAME @@ -35,9 +35,9 @@ .In sys/param.h .In sys/ucred.h .Ft bool -.Fn groupmember "gid_t gid" "struct ucred *cred" +.Fn groupmember "gid_t gid" "const struct ucred *cred" .Ft bool -.Fn realgroupmember "gid_t gid" "struct ucred *cred" +.Fn realgroupmember "gid_t gid" "const struct ucred *cred" .Sh DESCRIPTION The .Fn groupmember diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 4668bdea3fdd..b2511ce1e6c8 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1307,7 +1307,7 @@ group_is_supplementary(const gid_t gid, const struct ucred *const cred) * supplementary groups). */ bool -groupmember(gid_t gid, struct ucred *cred) +groupmember(gid_t gid, const struct ucred *cred) { /* @@ -1328,7 +1328,7 @@ groupmember(gid_t gid, struct ucred *cred) * groups). */ bool -realgroupmember(gid_t gid, struct ucred *cred) +realgroupmember(gid_t gid, const struct ucred *cred) { if (gid == cred->cr_rgid) return (true); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 0d04a49eefb4..ee72af000a58 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -155,8 +155,8 @@ void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); -bool groupmember(gid_t gid, struct ucred *cred); -bool realgroupmember(gid_t gid, struct ucred *cred); +bool groupmember(gid_t gid, const struct ucred *cred); +bool realgroupmember(gid_t gid, const struct ucred *cred); #endif /* _KERNEL */ #endif /* !_SYS_UCRED_H_ */