On Sat, 6 Dec 2025 14:02:28 +0000
Tom Hukins <[email protected]> wrote:
> On Sat, Dec 06, 2025 at 02:30:52PM +0300, Artem Bunichev wrote:
> > I couldn't find the following groups in FreeBSD: wsrc, maildrop,
> > postfix, named, _proxy (which in FreeBSD is called proxy), _timedc,
> > _sdpd, _httpd, _mdnsd, _tcpdump, _tss, _gpio, _dhcpcd (called dhcp in
> > FreeBSD), _rtadvd, etc... For most part, I guess these are missed
> > because their programs are not in the FreeBSD base?
>
> Yes, ports/packages specify UIDs and GIDS as described in
> https://docs.freebsd.org/en/books/porters-handbook/special/#users-and-groups
> which your manual page should mention.
>
> Tom
>
Thanks Tom! I guess we should mention the place where {U,G}IDs are specified
for ports, but provide a description only for those, which are in the base
system only (/usr/src/etc/group)?
By the way, do you know, is there a good way to determine which {U,G}IDs a
particular program requires? As for now, I haven't find a one unified way for
this. For example, I found via git-blame(1) and commit descriptions that groups
`realtime` (GID 47) and `idletime` (GID 48) are used for mac_priority(4). It
also described in rtprio(2) and mac_priority(4) manpages, but it's still not
very easy to trace the program by GID in /usr/src/etc/group only. Or, I found
that dhclient(8) uses group `_dhcp`: I found this line
in /usr/src/sbin/dhclient/dhclient.c: `if ((pw = getpwnam("_dhcp")) == NULL)`.
I tried to search for getpwnam(3) usage in sources for other programs, it does
give some clues, but not very much. And as I can see, string "_dhcp" used as
is, without any variable or #define, so I guess there is no really strict
policy for this matter. So far I didn't find anything related in Makefiles
either.
Long story short, for now, I'm collecting info for each group in a very
personal way so to speak, but it would be nice to make this process easier.