freebsd-src/usr.bin/id
Kyle Evans 90b315233a 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 / 68b9b81e79.  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
2025-08-04 18:09:58 -05:00
..
groups.1 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
id.1 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
id.c id: revert to historical and documented behavior for id 2025-08-04 18:09:58 -05:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
whoami.1 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00