NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/42026: "mtree -C" should not map user/group names to/from numbers



>Number:         42026
>Category:       bin
>Synopsis:       "mtree -C" should not map user/group names to/from numbers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 08 20:40:03 +0000 2009
>Originator:     Alan Barrett
>Release:        NetBSD 5.99.16
>Organization:
Not much
>Environment:
System: NetBSD 5.99.16 i386
>Description:
        "mtree -C" tries to map user and group names to numeric values on
        input, and map them back to names on output.  It should
        simply preserve the input values unchanged.

>How-To-Repeat:
1.
        $ mtree -C -K all <<EOF
        . type=dir uid=0 gid=0
        EOF
        . type=dir uname=root gname=wheel

        See how the numeric values have been translated to names.  That
        should not happen.

2.
        During a cross-build on an OS X 10.6 system, the METALOG ends
        up with this line:

        ./var/db/postfix type=dir uid=12 gname=everyone mode=0755

        instead of the expected

        ./var/db/postfix type=dir uname=postfix gname=postfix mode=0755

        Note that user "postfix" is uid 12 on NetBSD, but there is
        no user with uid 12 on the OS X build host; group "postfix"
        is gid 12 on NetBSD, but group "everyone" is gid 12 on the
        OS X build host.  It appears that the uid_from_user() and
        gid_from_group() invocations on the input side are using a
        NetBSD group and passwd database as is appropriate in a cross
        build (and translating the input names to numeric value 12),
        but the user_from_uid() and group_from_gid() invocations on the
        output side are incorrectly using native OS X group and passwd
        databases.

>Fix:
        Augment the internal data structures to keep track of whether
        input was a name or a number, and use that information on
        output.



Home | Main Index | Thread Index | Old Index