NetBSD Problem Report #42026

From apb@cequrux.com  Tue Sep  8 20:39:13 2009
Return-Path: <apb@cequrux.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6393A63BC1D
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  8 Sep 2009 20:39:13 +0000 (UTC)
Message-Id: <20090908203900.66D94100AA4C@apb-laptoy.apb.alt.za>
Date: Tue,  8 Sep 2009 20:39:00 +0000 (UTC)
From: apb@cequrux.com
Reply-To: apb@cequrux.com
To: gnats-bugs@gnats.NetBSD.org
Subject: "mtree -C" should not map user/group names to/from numbers
X-Send-Pr-Version: 3.95

>Number:         42026
>Category:       toolchain
>Synopsis:       "mtree -C" should not map user/group names to/from numbers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 08 20:40:03 +0000 2009
>Last-Modified:  Mon Mar 12 00:33:55 +0000 2018
>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.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->apb
Responsible-Changed-By: apb@NetBSD.org
Responsible-Changed-When: Thu, 10 Sep 2009 07:38:13 +0000
Responsible-Changed-Why:
I'll work on this


Responsible-Changed-From-To: apb->toolchain-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Mon, 12 Mar 2018 00:33:55 +0000
Responsible-Changed-Why:
Reset responsible field for retired developer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.