From nobody Sat Nov 02 20:39:24 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 4XgqMx0qrzz5chJW; Sat, 02 Nov 2024 20:39:25 +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 4XgqMx0F68z446w; Sat, 2 Nov 2024 20:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579965; 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=Mq7OwEnL2Cy4UtF9xdu1P3Buv4LGAZDbt7UEcgZ1IVI=; b=LJrGDEC6Al6o5MB6hOoXi1/MMPGTM6nNi1If+0wOM6LQyUw7fesIuQ6HsQXBCsd2atMTZI sEDXZ668TP7IgV5ti9kAtWkfIHuaiMS+KjyEyP7kQwOjwUuer9C3QTJEA3Hcls6g9jXl1L lSEY2ZxM0dlO4SWb9GZlJ5XjTM+iYkpQDZ2JhJ/ZjvkrKPUJho91y+SYdTpFuJvGLXVPF/ 50qGykFgYRtC0UY8uzoThPB/QFudFYHcr38SYuSkb5F3cMUbEoJpvgqky5S14wOYdVYQSy oY8hyo6O+UMzerB51X0VMRevx9oGIZbLe+RWUOaTWz63NjSixallcRd+2ReqaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579965; 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=Mq7OwEnL2Cy4UtF9xdu1P3Buv4LGAZDbt7UEcgZ1IVI=; b=cc5P2Kz8lwayvMZ9H8ifqC1Oe5BJ/J1fdv5gUnUqadxbZZqfe2zcT/ApXJeDycxJLQihMo SqwBBTZHvmLAchAIRJsD7vW2s3GHhwn4qj72zhK2cRG6PsbS/0wE56/EwaCtVyXdzOij6O yu+OxPKs7TleDT+2eYR3FzApA1QyveHU20xnBCNPv8CtNLj+aXoBQwMv/n931ZGOWxWLDH W06adqwcQSq7hDhaTEGXPimPDcX9aTEC7gZgVNoBUSeqeFca0cqe/rakASE/c2jd06qlLW 1mEPY/wsAeabxJjqJz8jfpL8kUPmRKXNwCYXg57PoGxeSxobAT3mWmo8M/rDbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579965; a=rsa-sha256; cv=none; b=jKhfnSDA47BqPofkp2IQZRhY69c+MuBlwRCrcdJF0ZyTDJz/R5tmFfbttv8VLMuEl38yL3 KABz0a8aWAR8pfCGlrZW6wjAwxjjVxJ+h3eOvwE2dkn267qBHP7fOKte5Eei/fK/5sJ9tA bCCcAHunY5+ud3LjqMwC1cmGeJ33GDs0cPtiG011kJt0sfD6jgHgdvSb5gvwlgzkkXbUUk M38EqjepNjJvZtdWixuRPFeHDtYa4E47eDmjNB9tTju4m2Oso8dXcv3AdXcVxeGtVB+D88 w78RwakTJkC2RRQFOeyX/WJWXyWMLWqaeAy/j38C85wSK/VZgNi6jLiFon4vwA== 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 4XgqMw6yBmzKQm; Sat, 2 Nov 2024 20:39:24 +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 4A2KdOxt046003; Sat, 2 Nov 2024 20:39:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdO9h046000; Sat, 2 Nov 2024 20:39:24 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:24 GMT Message-Id: <202411022039.4A2KdO9h046000@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: 2e031fd0719b - main - cred: supplementary_group_member() => group_is_supplementary() 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: 2e031fd0719b567e66198bc76c8a1c6c9b7f2920 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2e031fd0719b567e66198bc76c8a1c6c9b7f2920 commit 2e031fd0719b567e66198bc76c8a1c6c9b7f2920 Author: Olivier Certner AuthorDate: 2024-07-16 20:55:53 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:35 +0000 cred: supplementary_group_member() => group_is_supplementary() The new name seems more immediately descriptive. While here, constify its signature ('struct ucred' isn't modified). While here, replace "supplemental" => "supplementary" in some comments. No functional change (intended). Reviewed by: mhorne, emaste Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46906 --- sys/kern/kern_prot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 95362ce8a310..4668bdea3fdd 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1280,13 +1280,13 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) * Returns whether gid designates a supplementary group in cred. */ static bool -supplementary_group_member(gid_t gid, struct ucred *cred) +group_is_supplementary(const gid_t gid, const struct ucred *const cred) { int l, h, m; /* - * Perform a binary search of the supplemental groups. This is possible - * because we sort the groups in crsetgroups(). + * Perform a binary search of the supplementary groups. This is + * possible because we sort the groups in crsetgroups(). */ l = 1; h = cred->cr_ngroups; @@ -1320,7 +1320,7 @@ groupmember(gid_t gid, struct ucred *cred) if (gid == cred->cr_groups[0]) return (true); - return (supplementary_group_member(gid, cred)); + return (group_is_supplementary(gid, cred)); } /* @@ -1333,7 +1333,7 @@ realgroupmember(gid_t gid, struct ucred *cred) if (gid == cred->cr_rgid) return (true); - return (supplementary_group_member(gid, cred)); + return (group_is_supplementary(gid, cred)); } /* @@ -2316,7 +2316,7 @@ crextend(struct ucred *cr, int n) /* * Copy groups in to a credential, preserving any necessary invariants. - * Currently this includes the sorting of all supplemental gids. + * Currently this includes the sorting of all supplementary gids. * crextend() must have been called before hand to ensure sufficient * space is available. */