git: 9d0d6174840a - stable/13 - cred: supplementary_group_member() => group_is_supplementary()

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Fri, 15 Nov 2024 13:00:42 UTC
The branch stable/13 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d0d6174840a124271a11f2cbd22f6664f9f7fcf

commit 9d0d6174840a124271a11f2cbd22f6664f9f7fcf
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-07-16 20:55:53 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-11-15 12:59:03 +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
    
    (cherry picked from commit 2e031fd0719b567e66198bc76c8a1c6c9b7f2920)
    
    Approved by:    markj (mentor)
---
 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 abe989045fb8..c80db8efeee8 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1276,13 +1276,13 @@ sys___setugid(struct thread *td, struct __setugid_args *uap)
  * Returns whether gid designates a supplementary group in cred.
  */
 static int
-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;
@@ -1316,7 +1316,7 @@ groupmember(gid_t gid, struct ucred *cred)
 	if (cred->cr_groups[0] == gid)
 		return (1);
 
-	return (supplementary_group_member(gid, cred));
+	return (group_is_supplementary(gid, cred));
 }
 
 /*
@@ -1329,7 +1329,7 @@ realgroupmember(gid_t gid, struct ucred *cred)
 	if (gid == cred->cr_rgid)
 		return (1);
 
-	return (supplementary_group_member(gid, cred));
+	return (group_is_supplementary(gid, cred));
 }
 
 /*
@@ -2324,7 +2324,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.
  */