Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2025 19:15:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 284119] install(1): numeric -o / -g args produce uname and gname in METALOG
Message-ID:  <bug-284119-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284119

            Bug ID: 284119
           Summary: install(1): numeric -o / -g args produce uname and
                    gname in METALOG
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: emaste@freebsd.org

install -U -M can pass the owner and group through to the METALOG:

$ install -U -M /dev/stdout -o root -g wheel /usr/bin/true /tmp
./tmp/true type=3Dfile uname=3Droot gname=3Dwheel mode=3D0755 size=3D5008

install also accepts numeric uid and gid.  These should produce uid=3D and =
gid=3D
in the METALOG, but we still get uname and gname:

$ install -U -M /dev/stdout -o 0 -g 0 /usr/bin/true /tmp
./tmp/true type=3Dfile uname=3D0 gname=3D0 mode=3D0755 size=3D5008

In normal (non -U) mode we attempt to look up the name, and parse it as an =
id
if that fails:

        if (owner !=3D NULL && !dounpriv) {
                if (uid_from_user(owner, &uid) =3D=3D -1) {
                        id_t id;
                        if (!parseid(owner, &id))
                                errx(1, "unknown user %s", owner);
                        uid =3D id;
                }
        } else
                uid =3D (uid_t)-1;

Something similar is needed for -U -M mode

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284119-227>