Page MenuHomeFreeBSD

getgroups.2: Clarify, mention ascending order, add SECURITY CONSIDERATIONS
ClosedPublic

Authored by olce on Aug 29 2025, 11:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 1:53 PM
Unknown Object (File)
Sat, Oct 11, 1:53 PM
Unknown Object (File)
Sat, Oct 11, 1:53 PM
Unknown Object (File)
Sat, Oct 11, 1:53 PM
Unknown Object (File)
Sat, Oct 11, 9:01 AM
Unknown Object (File)
Sat, Oct 11, 5:55 AM
Unknown Object (File)
Sat, Oct 11, 5:35 AM
Unknown Object (File)
Fri, Oct 3, 4:58 PM

Details

Summary

Clarify and be more precise about the behavior of getgroups(2), in
particular with respect to 'gidsetlen'.

Prefer a terminology referring to POSIX terms, i.e., use "supplementary
groups" instead of "group access list".

Say that getgroups(2) reports the supplementary groups in strictly
ascending order and returns the cardinal of the set they form (and
mention this has been the case since FreeBSD 14.3).

Add a new SECURITY CONSIDERATIONS section contrasting the new behavior
after commit 9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to
match other platforms") with the historical one.

While here, fix some style.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Aug 29 2025, 11:05 PM
gbe added a subscriber: gbe.

LGTM from manpages

This revision is now accepted and ready to land.Aug 30 2025, 4:53 AM
olce edited the summary of this revision. (Show Details)
  • Emphasize that the supplementary groups form a set, and that the number of elements we return is its cardinal.
  • SECURITY CONSIDERATIONS: Emphasize that the effective GID is not necessarily part of the set, and that initgroups(3) and setgroups(2) differ in this respect.
  • "current process" => "calling process"
This revision now requires review to proceed.Tue, Sep 16, 10:16 AM
This revision was not accepted when it landed; it landed in state Needs Review.Wed, Sep 17, 12:21 PM
This revision was automatically updated to reflect the committed changes.