HomeFreeBSD

mdo(1): Avoid calling getgroups() in some unnecessary cases

Description

mdo(1): Avoid calling getgroups() in some unnecessary cases

If the basis for supplementary groups are the current ones, we do not
need to fetch them when they are to be replaced entirely (which we
already have been doing), as in the '!start_from_current_groups' case,
but specifically also when they are not going to be touched at all.

This change in passing makes the modified code block's comment saying
that SETCREDF_SUPP_GROUPS need not be set here correct.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53771

(cherry picked from commit b92b1b47583036bd02e656564ff22c92b8949077)

Details

Provenance
olceAuthored on Nov 14 2025, 11:59 AM
Differential Revision
D53771: mdo(1): Avoid calling getgroups() in some unnecessary cases
Parents
rG2815d86103ae: setcred(): Fix 32-bit compatibility copy-in
Branches
Unknown
Tags
Unknown