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
This commit is contained in:
Olivier Certner 2024-07-16 22:55:53 +02:00
parent 856e158dc4
commit 2e031fd071
No known key found for this signature in database
GPG Key ID: 8CA13040971E2627

View File

@ -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.
*/