HomeFreeBSD

install: Fix METALOG ouptut for numeric -o and -g args

Description

install: Fix METALOG ouptut for numeric -o and -g args

install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.

If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.

Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.

PR: 284119
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48504

(cherry picked from commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f)

Details

Provenance
emasteAuthored on Jan 17 2025, 7:14 PM
Reviewer
jlduran
Differential Revision
D48504: install: Fix METALOG ouptut for numeric -o and -g args
Parents
rG8921c82b76e3: carp: don't unintentionally revert to multicast mode
Branches
Unknown
Tags
Unknown