HomeFreeBSD

rpc.lockd: avoid embedding assumptions about cr_groups[0]

Description

rpc.lockd: avoid embedding assumptions about cr_groups[0]

sys/ucred.h provides a cr_gid macro that should be used to reference the
egid element of an xucred, so let's use that.

While we're here, avoid assuming that the first element is the egid and
include it in the group list unless it is actually the egid. This is
not a functional change today: the egid is always the first group in
the list, but we may want to consider changing that some day.

Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D51151

Details

Provenance
kevansAuthored on Jul 24 2025, 2:59 PM
Reviewer
olce
Differential Revision
D51151: rpc.lockd: avoid embedding assumptions about cr_groups[0]
Parents
rG5138a20765c7: tftpd: explicitly set egid after dropping supplemental groups
Branches
Unknown
Tags
Unknown