NetBSD Problem Report #44048

From liman@mail.cafax.se  Fri Nov  5 16:15:36 2010
Return-Path: <liman@mail.cafax.se>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id D011963BB30
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  5 Nov 2010 16:15:35 +0000 (UTC)
Message-Id: <201011051614.oA5GErqa026502@mail.cafax.se>
Date: Fri, 5 Nov 2010 17:14:53 +0100 (MET)
From: liman@cafax.se
Reply-To: liman@cafax.se
To: gnats-bugs@gnats.NetBSD.org
Subject: Prebuilt mailman pkg enforces uid/gid.
X-Send-Pr-Version: 3.95

>Number:         44048
>Category:       pkg
>Synopsis:       Prebuilt mailman pkg enforces uid/gid.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          feedback
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 05 16:20:00 +0000 2010
>Closed-Date:    
>Last-Modified:  Mon Jan 23 10:35:02 +0000 2012
>Originator:     Lars-Johan Liman
>Release:        NetBSD 5.0.2
>Organization:
#-------------------------------------------------------------------------
# Lars-Johan Liman, M.Sc.                ! E-mail: liman@cafax.se
# Cafax AB                               ! HTTP  : //www.cafax.se/
# Computer Consultants, Sweden           ! Voice : +46 8 - 564 702 30
#-------------------------------------------------------------------------
>Environment:
System: NetBSD mail.cafax.se 5.0.2 NetBSD 5.0.2 (XEN3_DOMU) #0: Sat Feb 6 13:42:20 UTC 2010 builds@b8.netbsd.org:/home/builds/ab/netbsd-5-0-2-RELEASE/amd64/201002061851Z-obj/home/builds/ab/netbsd-5-0-2-RELEASE/src/sys/arch/amd64/compile/XEN3_DOMU amd64
Architecture: x86_64
Machine: amd64
>Description:
	The prebuilt mailman package

	packages/NetBSD/amd64/5.0.2_2010Q3/All/mailman-2.1.12nb2.tgz

	contains +INSTALL requirements on specific UID and GID for the
	package. If you try to upgrade from a previous installation
	where different GID/UID were used, and the username/groupname
	"mailman" still exist, it will fail. You will
	either have to "chown" your entire existing mailman tree, or
	unpack the .pkg, change the GROUP:/USER: definitions at the
	end of the +INSTALL file, and pack it back together again.

	It would be appreciated if the +INSTALL script took note of
	any existing user/group "mailman" and used the already exising
	UID/GID for the installation.
>How-To-Repeat:
	Install old version of mailman.

	Upgrade to mentioned version of mailman.
>Fix:
	I'm note quite familiar with +INSTALL syntax, but I imagine
	that there is syntax for not requiring specific UID/GID
	numbers.

>Release-Note:

>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44048: Prebuilt mailman pkg enforces uid/gid.
Date: Fri, 5 Nov 2010 18:43:47 +0100

 On Fri, Nov 05, 2010 at 04:20:00PM +0000, liman@cafax.se wrote:
 > 	It would be appreciated if the +INSTALL script took note of
 > 	any existing user/group "mailman" and used the already exising
 > 	UID/GID for the installation.

 The problem here is that the uid/gid is hard-coded in mailman itself.

 Joerg

From: Lars-Johan Liman <liman@cafax.se>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/44048: Prebuilt mailman pkg enforces uid/gid.
Date: Sat, 06 Nov 2010 21:06:05 +0100

 On Fri, Nov 05, 2010 at 04:20:00PM +0000, liman@cafax.se wrote:
 >> 	It would be appreciated if the +INSTALL script took note of
 >> 	any existing user/group "mailman" and used the already exising
 >> 	UID/GID for the installation.

 joerg@britannica.bec.de:
 >  The problem here is that the uid/gid is hard-coded in mailman itself.

 Err... I hope I misunderstand you. AFAICT it is not hardcoded in mailman
 itself.

 I'm talking about the user _NUMBER_ and the group _NUMBER_ that the
 +INSTALL tries to enfoce during install.

 If you look at the pre-compiled package, you'll find that the +INSTALL
 fill wants to install a user with the username "mailman" and with UID
 (number) 1002, and a group with the groupname "mailman" and with GID
 (number) 1001.


 netbsd:pkgbin/mailman> egrep -w '100[12]' ./+*
 ./+INSTALL:# GROUP: mailman:1001
 ./+INSTALL:# USER: mailman:mailman:1002:Mailman user:/nonexistent:/bin/sh


 If you look further down the binary packages you will only find matches
 in PDF files, PS files, a module with translated strings (where it
 matches line numbers) and in test messages.


 mail:pkgbin/mailman> find . -type f | xargs egrep -l  -w '100[12]'
 /+INSTALL               <--- This is the offending one from above.
 ./lib/mailman/messages/sv/LC_MESSAGES/mailman.po
 ./lib/mailman/tests/bounces/simple_28.txt
 ./share/doc/mailman/mailman-admin.pdf
 ./share/doc/mailman/mailman-install.pdf
 ./share/doc/mailman/mailman-member-es.pdf
 ./share/doc/mailman/mailman-member-es.ps
 ./share/doc/mailman/mailman-member.pdf


 If you grep for '100[12]' in the _source_code_ (as distributed by GNU),
 you will, again, only find matches in roughly the same files. It doesn't
 match anywhere in the active code, and hence, it's not hardcoded in the
 mailman code.


 netbsd:src/mailman-2.1.12> find . -type f | xargs egrep -l  '100[12]'
 ./doc/mailman-admin.pdf
 ./doc/mailman-install.pdf
 ./doc/mailman-member-es.pdf
 ./doc/mailman-member-es.ps
 ./doc/mailman-member.pdf
 ./doc/mailman-member.ps
 ./messages/sv/LC_MESSAGES/mailman.po
 ./tests/bounces/dsn_08.txt
 ./tests/bounces/simple_08.txt
 ./tests/bounces/simple_28.txt
 ./tests/bounces/simple_31.txt
 ./tests/msgs/bad_01.txt


 There is, however, a default user _NAME_ "mailman" and a default group
 _NAME_ "mailman" hardcoded as default in the code, but that's not what
 I'm talking about. I can live with having a user called "mailman" on my
 system, as long as no one tries to enforce a specific UID (number) for
 it. Furthermore, it is even possible to change that default username at
 compile time:


 netbsd:src/mailman-2.1.12> ./configure --help | egrep 'with-(user|group)'
   --with-username      specify a user name other than \"mailman\"
   --with-groupname     specify a group name other than \"mailman\"


 ... but I'm not resquesting that you change that default name in the
 precompiled package.

 All I request is that the code in the +INSTALL file be changed so that
 it doesn't enforce the UID (number) 1002 and the GID (number) 1001,
 especially since that may not match on a system that one is upgrading,
 as older versions of the binary package seem to have had different
 numbers, and a "conflict" arises.

 I believe someome (robot? pkg-maintainer?) made an install from source
 (where I assume a suitably agnostic "useradd" command was issued as part
 of the installation procdure), and the UID and GID that happened to be
 created on _that_ specific machine were "picked up" and hardcoded it
 into +INSTALL, thus creating the situation above. That is unfortunate.
 It must be possible to "tell" +INSTALL to be agnostic about the numbers.

 				Best regards,
 				  /Liman

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44048: Prebuilt mailman pkg enforces uid/gid.
Date: Sun, 7 Nov 2010 21:19:52 +0000

 On Fri, Nov 05, 2010 at 05:45:04PM +0000, Joerg Sonnenberger wrote:
  >  On Fri, Nov 05, 2010 at 04:20:00PM +0000, liman@cafax.se wrote:
  >  > 	It would be appreciated if the +INSTALL script took note of
  >  > 	any existing user/group "mailman" and used the already exising
  >  > 	UID/GID for the installation.
  >  
  >  The problem here is that the uid/gid is hard-coded in mailman itself.

 If that were true, the package would be broken, because the package
 makefile does *not* hardcode the value. Fortunately, it's not true.

 There must be something wrong happening with PKG_USERS and PKG_GROUPS
 in the bulk build.

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44048: Prebuilt mailman pkg enforces uid/gid.
Date: Mon, 8 Nov 2010 21:51:59 +0000

 On Sun, Nov 07, 2010 at 09:20:04PM +0000, David Holland wrote:
  >>  The problem here is that the uid/gid is hard-coded in mailman itself.
  >  
  >  If that were true, the package would be broken, because the package
  >  makefile does *not* hardcode the value. Fortunately, it's not true.

 Joerg says it used to be true but no longer is. Anyway, it appears
 that the username to uid mapping is being done during package compile
 instead of at package install time, which is broken.

 Joerg suggests this patch, but it needs to be reviewed by tech-pkg:

 http://www.netbsd.org/~joerg/usergroup.diff

 -- 
 David A. Holland
 dholland@netbsd.org

From: Sergey Svishchev <svs@ropnet.ru>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44048
Date: Mon, 7 Nov 2011 23:48:52 +0300

 Has it been reviewed yet?

 -- 
 Sergey Svishchev

From: "Filip Hajny" <filip@joyent.com>
To: <gnats-bugs@NetBSD.org>
Cc: <pkg-manager@netbsd.org>,
	<gnats-admin@netbsd.org>,
	<pkgsrc-bugs@netbsd.org>,
	<liman@cafax.se>
Subject: Re: pkg/44048
Date: Tue, 8 Nov 2011 13:56:15 +0100

 The essence on the part of Mailman is that Mailman's configure *does* check=
  that the user picked truly exists. If either doesn't exist for real, it wi=
 ll still go on and install itself, but with the user/group bits blank in it=
 s core config files, which makes the package fail when installed. I run a m=
 odified mail/mailman package on my system which patches away the user/group=
  existence part in configure, which makes this entire problem go away (i.e.=
  the pkgsrc package can be switched back to the normal at-install-time user=
 /group handling). And the check_perms invocation in INSTALL takes care of a=
 ny file ownership/permission issues at package install time, anyway.

 Isn't that a better way to deal with this problem? I can patch the package =
 to work like this.

 -F=

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44048
Date: Sun, 13 Nov 2011 18:50:37 +0000

 On Tue, Nov 08, 2011 at 01:00:14PM +0000, Filip Hajny wrote:
  > The following reply was made to PR pkg/44048; it has been noted by GNATS.
  > 
  > The essence on the part of Mailman is that Mailman's configure *does* check=
  >  that the user picked truly exists. If either doesn't exist for real, it wi=
  > ll still go on and install itself, but with the user/group bits blank in it=
  > s core config files, which makes the package fail when installed. I run a m=
  > odified mail/mailman package on my system which patches away the user/group=
  >  existence part in configure, which makes this entire problem go away (i.e.=
  >  the pkgsrc package can be switched back to the normal at-install-time user=
  > /group handling). And the check_perms invocation in INSTALL takes care of a=
  > ny file ownership/permission issues at package install time, anyway.
  >  
  > Isn't that a better way to deal with this problem? I can patch the package =
  > to work like this.

 Yes, that seems like a much better approach.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Filip Hajny" <fhajny@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44048 CVS commit: pkgsrc/mail/mailman
Date: Thu, 22 Dec 2011 11:06:41 +0000

 Module Name:	pkgsrc
 Committed By:	fhajny
 Date:		Thu Dec 22 11:06:40 UTC 2011

 Modified Files:
 	pkgsrc/mail/mailman: Makefile distinfo
 Added Files:
 	pkgsrc/mail/mailman/patches: patch-configure

 Log Message:
 Disable configure-time check for Mailman user & group. Removes the need
 to hard code UID/GID when building a binary package.

 Fixes PR pkg/44048


 To generate a diff of this commit:
 cvs rdiff -u -r1.64 -r1.65 pkgsrc/mail/mailman/Makefile
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/mail/mailman/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/mail/mailman/patches/patch-configure

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 24 Dec 2011 22:24:38 +0000
State-Changed-Why:
It should work better now... can you try?


From: Lars-Johan Liman <liman@cafax.se>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, pkgsrc-bugs@NetBSD.org, gnats-admin@NetBSD.org,
        dholland@NetBSD.org
Subject: Re: pkg/44048 (Prebuilt mailman pkg enforces uid/gid.)
Date: Fri, 06 Jan 2012 10:25:54 +0100

 dholland@NetBSD.org:
 > Synopsis: Prebuilt mailman pkg enforces uid/gid.

 > State-Changed-From-To: open->feedback
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Sat, 24 Dec 2011 22:24:38 +0000
 > State-Changed-Why:
 > It should work better now... can you try?

 Thanks for your efforts!

 I've been trying to do a "make package" from current pkgsrc on my build
 host, but to begin with, it led to it updating every installed package on
 the host and then some, and with the unavoidable hiccups, it takes a
 while to walk through, but I just struck me (after two days of building)
 that the build host is i386 but the host that runs mailman is x86_64
 (sic!), so it will be kind of pointless anyhow ... :-(

 So ... is there a pre-built version for x86_64 I can pick up somewhere?

 This ...

 ftp://nyftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/5.0/All/mailman-2.1.14.1nb1.tgz

 ... doesn't seem to be it, since it was put there in November. What
 mailman version number should I be looking for? mailman-2.1.14.1nb2 ?

 				Cheers,
 				  /Liman

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44048 (Prebuilt mailman pkg enforces uid/gid.)
Date: Sun, 22 Jan 2012 16:50:25 +0000

 On Fri, Jan 06, 2012 at 09:30:07AM +0000, Lars-Johan Liman wrote:
  >  > It should work better now... can you try?
  >  
  >  Thanks for your efforts!
  >  
  >  I've been trying to do a "make package" from current pkgsrc on my build
  >  host, but to begin with, it led to it updating every installed package on
  >  the host and then some, and with the unavoidable hiccups, it takes a
  >  while to walk through, but I just struck me (after two days of building)
  >  that the build host is i386 but the host that runs mailman is x86_64
  >  (sic!), so it will be kind of pointless anyhow ... :-(

 doh :(

  >  So ... is there a pre-built version for x86_64 I can pick up somewhere?
  >  
  >  This ...
  >  
  >  ftp://nyftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/5.0/All/mailman-2.1.14.1nb1.tgz
  >  
  >  ... doesn't seem to be it, since it was put there in November. What
  >  mailman version number should I be looking for? mailman-2.1.14.1nb2 ?

 Yes. The 2011Q4 binary packages (which should be appearing any moment
 now, although they don't seem to have quite done so yet) should
 include it.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Lars-Johan Liman <liman@cafax.se>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/44048 (Prebuilt mailman pkg enforces uid/gid.)
Date: Mon, 23 Jan 2012 11:33:36 +0100

 dholland-pbugs@NetBSD.org:
 >  Yes. The 2011Q4 binary packages (which should be appearing any moment
 >  now, although they don't seem to have quite done so yet)

 (No, I was actually looking for that yesterday - for other purposes.)

 > should include it.

 Ack! Thanks!

 				Cheers,
 				  /Liman

>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.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.