HomeFreeBSD

id: revert to historical and documented behavior for `id`

Description

id: revert to historical and documented behavior for id

The manpage claims that we display the credentials for the calling
process if no user/flags are specified, but this has not been true since
r145628 / 68b9b81e792a9108d. Currently, we display:

  • uid from the calling process
  • gid from /etc/passwd
  • egid from the calling process, if different from that gid
  • supplementary groups from the calling process

This doesn't really match the description in the manpage, and it doesn't
match other implementations. Fix it to use the current process
credentials for the gid as well.

Drop the extra arguments to id_print(), since these facts can be derived
from whether we're displaying live data (pw == NULL) or not.

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

Details

Provenance
kevansAuthored on Aug 4 2025, 11:09 PM
Reviewer
olce
Differential Revision
D51689: id: revert to historical and documented behavior for `id`
Parents
rG28f618fcc2b4: kern: fix a panic in crcopysafe() found by syzkaller
Branches
Unknown
Tags
Unknown