From gwk@hunter.munich.sgi.com  Tue Sep 11 03:14:21 2001
Return-Path: <gwk@hunter.munich.sgi.com>
Received: from rj.sgi.com (rj.SGI.COM [204.94.215.100])
	by hub.freebsd.org (Postfix) with ESMTP id 7F7EC37B40B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Sep 2001 03:14:21 -0700 (PDT)
Received: from yog-sothoth.sgi.com (eugate.neu.sgi.com [144.253.131.5])
	by rj.sgi.com (8.11.4/8.11.4/linux-outbound_gateway-1.0) with ESMTP id f8BAEK522773
	for <@rj.corp.sgi.com:FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Sep 2001 03:14:20 -0700
Received: from sgiger.munich.sgi.com (sgiger.munich.sgi.com [144.253.192.2]) by yog-sothoth.sgi.com (980305.SGI.8.8.8-aspam-6.2/980304.SGI-aspam-europe) via SMTP id MAA303092
	for <@eugate.sgi.com:FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Sep 2001 12:14:28 +0200 (CEST)
	mail_from (gwk@hunter.munich.sgi.com)
Received: from cuckoo.munich.sgi.com (cuckoo.munich.sgi.com [144.253.192.109]) by sgiger.munich.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA00906 for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Sep 2001 12:13:48 +0200
Received: from hunter.munich.sgi.com (hunter.munich.sgi.com [144.253.197.18])
	by cuckoo.munich.sgi.com (SGI-8.9.3/8.9.3) with ESMTP id MAA30773
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Sep 2001 12:13:32 +0200 (CEST)
Received: (from gwk@localhost)
	by hunter.munich.sgi.com (8.11.5/8.11.5) id f8BADT211538;
	Tue, 11 Sep 2001 12:13:29 +0200 (CEST)
	(envelope-from gwk)
Message-Id: <200109111013.f8BADT211538@hunter.munich.sgi.com>
Date: Tue, 11 Sep 2001 12:13:29 +0200 (CEST)
From: "Georg-W. Koltermann" <gwk@sgi.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: pkg_add fails with "chown: bin.bin: illegal user name"
X-Send-Pr-Version: 3.113

>Number:         30507
>Category:       bin
>Synopsis:       pkg_add fails with "chown: bin.bin: illegal user name"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 11 03:20:00 PDT 2001
>Closed-Date:    Tue Sep 11 04:11:41 PDT 2001
>Last-Modified:  Tue Sep 11 04:11:56 PDT 2001
>Originator:     Georg-W. Koltermann
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
SGI
>Environment:
System: FreeBSD hunter.munich.sgi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #25: Mon Aug 20 22:18:51 CEST 2001 root@hunter.munich.sgi.com:/usr/obj/usr/src/sys/HUNTER i386


>Description:
The pkg_add utility uses an old syntax (userid.groupid instead of
userid:groupid) when changing user and group after the install.
This causes a "chown: bin.bin: illegal user name" or some such
whenever you install a package which has both @owner and @group 
directives, e.g. openmotif-devel:

hunter#	make install
===>  Installing for open-motif-devel-2.1.30
===>   open-motif-devel-2.1.30 depends on shared library: X11.6 - found
Installing Open Motif 2.1.30 development...
chown: bin.bin: illegal user name
pkg_add: couldn't change owner/group of ''usr/X11R6/bin/uil' ' to 'bin.bin'
chown: bin.bin: illegal user name

...and so on.

See attached fix.

>How-To-Repeat:
Try to do a pkg_add for a package which has both @owner and @group directives,
e.g. open-motif-devel.
>Fix:

--- usr.sbin/pkg_install/add/futil.c.old	Tue Sep 11 12:02:31 2001
+++ usr.sbin/pkg_install/add/futil.c	Tue Sep 11 11:58:26 2001
@@ -83,7 +83,7 @@
 	if (vsystem("cd %s && chmod -R %s %s", cd_to, Mode, arg))
 	    warnx("couldn't change modes of '%s' to '%s'", arg, Mode);
     if (Owner && Group) {
-	if (vsystem("cd %s && chown -R %s.%s %s", cd_to, Owner, Group, arg))
+	if (vsystem("cd %s && chown -R %s:%s %s", cd_to, Owner, Group, arg))
 	    warnx("couldn't change owner/group of '%s' to '%s.%s'",
 		   arg, Owner, Group);
 	return;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Tue Sep 11 04:11:41 PDT 2001 
State-Changed-Why:  
applied, thanks.  I'll MFC after the release. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30507 
>Unformatted:
