NetBSD Problem Report #44068

From www@NetBSD.org  Mon Nov  8 15:33:43 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2BB8663BAC6
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  8 Nov 2010 15:33:43 +0000 (UTC)
Message-Id: <20101108153343.0CD7E63BAC2@www.NetBSD.org>
Date: Mon,  8 Nov 2010 15:33:43 +0000 (UTC)
From: andras@freeshell.de
Reply-To: andras@freeshell.de
To: gnats-bugs@NetBSD.org
Subject: Mailman's build process uses uid/gid of 'daemon' instead of 'mailman' and breaks package
X-Send-Pr-Version: www-1.0

>Number:         44068
>Category:       pkg
>Synopsis:       Mailman's build process uses uid/gid of 'daemon' instead of 'mailman' and breaks package
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 08 15:35:00 +0000 2010
>Last-Modified:  Sun Nov 14 03:50:02 +0000 2010
>Originator:     Andras Horvath
>Release:        5.0.2
>Organization:
>Environment:
NetBSD $hostname 5.0.2 NetBSD 5.0.2 (GENERIC) #0: Sat Feb  6 13:44:19 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/GENERIC amd64
>Description:
The Makefile of Mailman contains unsuitable definitions of these two variables:

MAILMAN_USER
MAILMAN_GROUP

Which both default do the daemon user/group, although mailman should run under the 'mailman' group and the 'mailman' user.
>How-To-Repeat:
Simply compile the latest Mailman version from pkgsrc.
>Fix:
Edit /usr/pkgsrc/mail/mailman/Makefile

Changes made:
  MAILMAN_USER?=          mailman
  MAILMAN_GROUP?=         mailman

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Mon, 8 Nov 2010 21:49:46 +0000

 On Mon, Nov 08, 2010 at 03:35:00PM +0000, andras@freeshell.de wrote:
  > The Makefile of Mailman contains unsuitable definitions of these
  > two variables:
  > 
  > MAILMAN_USER
  > MAILMAN_GROUP
  > 
  > Which both default do the daemon user/group, although mailman
  > should run under the 'mailman' group and the 'mailman' user.
  > >How-To-Repeat:
  > Simply compile the latest Mailman version from pkgsrc.
  > >Fix:
  > Edit /usr/pkgsrc/mail/mailman/Makefile
  > 
  > Changes made:
  >   MAILMAN_USER?=          mailman
  >   MAILMAN_GROUP?=         mailman

 The mailman package makefile has defined MAILMAN_USER and
 MAILMAN_GROUP this way since the package was first imported in 2002.

 Is your pkgsrc tree corrupted?

 -- 
 David A. Holland
 dholland@netbsd.org

From: andras@freeshell.de
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Mon, 8 Nov 2010 23:31:57 +0100

 On Mon, Nov 08, 2010 at 09:50:04PM +0000, David Holland wrote:
 > The following reply was made to PR pkg/44068; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 >  instead of 'mailman' and breaks package
 > Date: Mon, 8 Nov 2010 21:49:46 +0000
 > 
 >  On Mon, Nov 08, 2010 at 03:35:00PM +0000, andras@freeshell.de wrote:
 >   > The Makefile of Mailman contains unsuitable definitions of these
 >   > two variables:
 >   > 
 >   > MAILMAN_USER
 >   > MAILMAN_GROUP
 >   > 
 >   > Which both default do the daemon user/group, although mailman
 >   > should run under the 'mailman' group and the 'mailman' user.
 >   > >How-To-Repeat:
 >   > Simply compile the latest Mailman version from pkgsrc.
 >   > >Fix:
 >   > Edit /usr/pkgsrc/mail/mailman/Makefile
 >   > 
 >   > Changes made:
 >   >   MAILMAN_USER?=          mailman
 >   >   MAILMAN_GROUP?=         mailman
 >  
 >  The mailman package makefile has defined MAILMAN_USER and
 >  MAILMAN_GROUP this way since the package was first imported in 2002.
 >  
 >  Is your pkgsrc tree corrupted?
 >  
 >  -- 
 >  David A. Holland
 >  dholland@netbsd.org
 >  

 The pkgsrc tree was freshly untared from pkgsrc-current. Is it possible that a
 long build process including lots of packages (using pkg_rolling-replace)
 corrupts the pkgsrc tree?


 Cheers,
 Andras

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Wed, 10 Nov 2010 02:22:47 +0000

 On Mon, Nov 08, 2010 at 11:50:04PM +0000, andras@freeshell.de wrote:
  >  >   > Edit /usr/pkgsrc/mail/mailman/Makefile
  >  >   > 
  >  >   > Changes made:
  >  >   >   MAILMAN_USER?=          mailman
  >  >   >   MAILMAN_GROUP?=         mailman
  >  >  
  >  >  The mailman package makefile has defined MAILMAN_USER and
  >  >  MAILMAN_GROUP this way since the package was first imported in 2002.
  >  >  
  >  >  Is your pkgsrc tree corrupted?
  >  
  > The pkgsrc tree was freshly untared from pkgsrc-current. Is it
  > possible that a long build process including lots of packages
  > (using pkg_rolling-replace) corrupts the pkgsrc tree?

 It's *possible* (after all, we're talking about computers) but it
 seems extremely unlikely. Then again, what you're describing is
 unlikely anyhow. Just to be clear, you're saying that the mailman
 package makefile (/usr/pkgsrc/mail/mailman/Makefile) contained

    MAILMAN_USER?=	daemon
    MAILMAN_GROUP?=	daemon

 when you untarred? Which tarball did you use and where did you get it
 from?

 -- 
 David A. Holland
 dholland@netbsd.org

From: andras@freeshell.de
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Wed, 10 Nov 2010 18:47:18 +0100

 On Wed, Nov 10, 2010 at 02:25:02AM +0000, David Holland wrote:
 > The following reply was made to PR pkg/44068; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 >  instead of 'mailman' and breaks package
 > Date: Wed, 10 Nov 2010 02:22:47 +0000
 > 
 >  On Mon, Nov 08, 2010 at 11:50:04PM +0000, andras@freeshell.de wrote:
 >   >  >   > Edit /usr/pkgsrc/mail/mailman/Makefile
 >   >  >   > 
 >   >  >   > Changes made:
 >   >  >   >   MAILMAN_USER?=          mailman
 >   >  >   >   MAILMAN_GROUP?=         mailman
 >   >  >  
 >   >  >  The mailman package makefile has defined MAILMAN_USER and
 >   >  >  MAILMAN_GROUP this way since the package was first imported in 2002.
 >   >  >  
 >   >  >  Is your pkgsrc tree corrupted?
 >   >  
 >   > The pkgsrc tree was freshly untared from pkgsrc-current. Is it
 >   > possible that a long build process including lots of packages
 >   > (using pkg_rolling-replace) corrupts the pkgsrc tree?
 >  
 >  It's *possible* (after all, we're talking about computers) but it
 >  seems extremely unlikely. Then again, what you're describing is
 >  unlikely anyhow. Just to be clear, you're saying that the mailman
 >  package makefile (/usr/pkgsrc/mail/mailman/Makefile) contained
 >  
 >     MAILMAN_USER?=	daemon
 >     MAILMAN_GROUP?=	daemon
 >  
 >  when you untarred? Which tarball did you use and where did you get it
 >  from?
 >  
 >  -- 
 >  David A. Holland
 >  dholland@netbsd.org
 >  

 The pkgsrc was from ftp://ftp.netbsd.net/pub/pkgsrc/current/pkgsrc.tar.gz . The
 previously installed tree was deleted completely and the new tree untared. To
 clear things up a litte: you are absolutely right about the contents of
 /usr/pkgsrc/mail/mailman/Makefile:

 MAILMAN_USER?=          mailman
 MAILMAN_GROUP?=         mailman

 I posted the wrong lines in the heat of the battle. Mea culpa. What I
 _actually_ wanted to propose as a temporary fix was this:

 /usr/pkgsrc/mail/mailman/Makefile:

 + CONFIGURE_ARGS+=        --with-groupname=mailman
 + CONFIGURE_ARGS+=        --with-mail-gid=mailman
 - CONFIGURE_ARGS+=        --with-groupname=${MAILMAN_GROUP:Q}
 - CONFIGURE_ARGS+=        --with-mail-gid=${MAILMAN_MAILGROUP:Q}

 make resolves ${MAILMAN_GROUP:Q} and ${MAILMAN_MAILGROUP:Q} to 'daemon', which
 subsequently causes troubles.


 Sorry for causing inconvenience.


 Best,
 Andras

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Thu, 11 Nov 2010 10:03:00 +0900

 On Thu, 11 Nov 2010 02:55:02 +0900, <andras@freeshell.de> wrote:

 >  make resolves ${MAILMAN_GROUP:Q} and ${MAILMAN_MAILGROUP:Q} to 'daemon', which
 >  subsequently causes troubles.

 Don't you have those settings in your /etc/mk.conf?

 -- 
 OBATA Akio / obache@NetBSD.org

From: andras@freeshell.de
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Fri, 12 Nov 2010 18:50:19 +0100

 On Thu, Nov 11, 2010 at 01:05:03AM +0000, OBATA Akio wrote:
 > The following reply was made to PR pkg/44068; it has been noted by GNATS.
 > 
 > From: "OBATA Akio" <obache@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 >  instead of 'mailman' and breaks package
 > Date: Thu, 11 Nov 2010 10:03:00 +0900
 > 
 >  On Thu, 11 Nov 2010 02:55:02 +0900, <andras@freeshell.de> wrote:
 >  
 >  >  make resolves ${MAILMAN_GROUP:Q} and ${MAILMAN_MAILGROUP:Q} to 'daemon', which
 >  >  subsequently causes troubles.
 >  
 >  Don't you have those settings in your /etc/mk.conf?
 >  
 >  -- 
 >  OBATA Akio / obache@NetBSD.org
 >  


 I didn't have the settings in /etc/mk.conf.

 When I added

 MAILMAN_GROUP=mailman
 MAILMAN_MAILGROUP=mailman

 to /etc/mk.conf configuring worked like expected.

 There have been discussions in the past about setting the variables manually.
 Anyhow: a user without (detailed) knowledge of the build process is likely to
 have a broken installation of mailman without manual setting of MAILMAN_GROUP
 and MAILMAN_MAILGROUP in /etc/mk.conf.

 Shouldn't those variables be accessible from the option framework? Just a
 suggestion...


 Cheers,
 Andras

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Sat, 13 Nov 2010 10:19:42 +0900

 On Sat, 13 Nov 2010 02:55:02 +0900, <andras@freeshell.de> wrote:

 >  When I added
 > MAILMAN_GROUP=mailman
 >  MAILMAN_MAILGROUP=mailman
 > to /etc/mk.conf configuring worked like expected.

 I'm confused.
 First, you said "MAILMAN_USER and MAILMAN_GROUP should be 'mailman', but 'daemon'",
 Curently "MAILMAN_GROUP and MAILMAN_MAILGROUP should be 'mailman', but...".
 I feel you just want to change MAILMAN_MAILGROUP to adjust your environment.

 >  There have been discussions in the past about setting the variables manually.
 >  Anyhow: a user without (detailed) knowledge of the build process is likely to
 >  have a broken installation of mailman without manual setting of MAILMAN_GROUP
 >  and MAILMAN_MAILGROUP in /etc/mk.conf.
 > Shouldn't those variables be accessible from the option framework? Just a
 >  suggestion...

 If so, MAILMAN_MAILGROUP must be defined automatically from user's choice.
 Do you know how to determine it automatically? by selection of MTA? using OS? or something else?
 i.e. you want to change MAILMAN_MAILGOUP to "mailman", where it came from?

From: "Filip Hajny" <filip@joyent.com>
To: <gnats-bugs@NetBSD.org>
Cc: <pkg-manager@netbsd.org>,
	<gnats-admin@netbsd.org>,
	<pkgsrc-bugs@netbsd.org>,
	<andras@freeshell.de>
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon' instead of 'mailman' and breaks package
Date: Sat, 13 Nov 2010 10:58:51 +0100

 On 13.11.2010, at 2:20, OBATA Akio wrote:

 > On Sat, 13 Nov 2010 02:55:02 +0900, <andras@freeshell.de> wrote:
 >=20
 >> When I added
 >> MAILMAN_GROUP=3Dmailman
 >> MAILMAN_MAILGROUP=3Dmailman
 >> to /etc/mk.conf configuring worked like expected.
 >=20
 > I'm confused.
 > First, you said "MAILMAN_USER and MAILMAN_GROUP should be 'mailman', but =
 'daemon'",
 > Curently "MAILMAN_GROUP and MAILMAN_MAILGROUP should be 'mailman', but...=
 ".
 > I feel you just want to change MAILMAN_MAILGROUP to adjust your environme=
 nt.
 >=20
 >> There have been discussions in the past about setting the variables manu=
 ally.
 >> Anyhow: a user without (detailed) knowledge of the build process is like=
 ly to
 >> have a broken installation of mailman without manual setting of MAILMAN_=
 GROUP
 >> and MAILMAN_MAILGROUP in /etc/mk.conf.
 >> Shouldn't those variables be accessible from the option framework? Just a
 >> suggestion...
 >=20
 > If so, MAILMAN_MAILGROUP must be defined automatically from user's choice.
 > Do you know how to determine it automatically? by selection of MTA? using=
  OS? or something else?
 > i.e. you want to change MAILMAN_MAILGOUP to "mailman", where it came from?
 >=20

 I think this article sums it up:

 http://www.seaglass.com/postfix/mailman-gid.html

 In other words, with Postfix you either compile with MAILMAN_MAILGROUP=3Dno=
 body and then make sure the alias files are owned as root (so that Postfix =
 falls back to 'nobody' when executing the Mailman commands), or you compile=
  with an arbitrary GID (like 'mailman') and then keep the alias files owned=
  that way.=20

 I haven't tested what happens if you compile with 'mailman' and then try to=
  deploy on a system where the actual GID of 'mailman' is different from the=
  building system. My only world is that of Solaris, so 'nobody' is pretty c=
 onsistent there, and that's what I went with. No issues. Therefore the inst=
 ruction in mail/mailman/Makefile to use 'nobody' with Postfix is still a go=
 od one IMO.

 I think it needs to be cleared up that the zest of this PR has nothing to d=
 o with what user/group Mailman runs as (MAILMAN_USER, MAILMAN_GROUP), but w=
 hat group Mailman expects its binaries executed under by the MTA (i.e. MAIL=
 MAN_MAILGROUP). And this option is largely dependent on the particular MTA-=
 Mailman scenario.

 -F=

From: andras@freeshell.de
To: Filip Hajny <filip@joyent.com>
Cc: gnats-bugs@NetBSD.org, pkg-manager@netbsd.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Sat, 13 Nov 2010 12:54:32 +0100

 On Sat, Nov 13, 2010 at 10:58:51AM +0100, Filip Hajny wrote:
 > [...]
 > I think this article sums it up:
 > 
 > http://www.seaglass.com/postfix/mailman-gid.html
 > [...]
 > 
 > I think it needs to be cleared up that the zest of this PR has nothing to do
 > with what user/group Mailman runs as (MAILMAN_USER, MAILMAN_GROUP), but what
 > group Mailman expects its binaries executed under by the MTA (i.e.
 > MAILMAN_MAILGROUP). And this option is largely dependent on the particular
 > MTA-Mailman scenario.
 > 
 > -F

 I am totally with you, that the build process is highly system dependent. One
 last question: is it possible to 'automagically' let configure set the correct
 GID/UID of mailman depending on the system configuration? Because that's what
 pkgsrc is all about, right?

 Cheers,
 Andras

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44068: Mailman's build process uses uid/gid of 'daemon'
 instead of 'mailman' and breaks package
Date: Sun, 14 Nov 2010 03:45:50 +0000

 On Wed, Nov 10, 2010 at 05:55:02PM +0000, andras@freeshell.de wrote:
  >  To clear things up a litte: you are absolutely right about the
  >  contents of /usr/pkgsrc/mail/mailman/Makefile:
  >  
  >  MAILMAN_USER?=          mailman
  >  MAILMAN_GROUP?=         mailman

 Right, so MAILMAN_USER and MAILMAN_GROUP both default to "mailman".

  >  I posted the wrong lines in the heat of the battle. Mea culpa. What I
  >  _actually_ wanted to propose as a temporary fix was this:
  >  
  >  /usr/pkgsrc/mail/mailman/Makefile:
  >  
  >  + CONFIGURE_ARGS+=        --with-groupname=mailman
  >  + CONFIGURE_ARGS+=        --with-mail-gid=mailman
  >  - CONFIGURE_ARGS+=        --with-groupname=${MAILMAN_GROUP:Q}
  >  - CONFIGURE_ARGS+=        --with-mail-gid=${MAILMAN_MAILGROUP:Q}

 ...but if MAILMAN_GROUP defaults to "mailman", this shouldn't be
 necessary, and:

  >  make resolves ${MAILMAN_GROUP:Q} and ${MAILMAN_MAILGROUP:Q} to
  > 'daemon', which subsequently causes troubles.

 ...this shouldn't be happening at all.

 Well, at least MAILMAN_GROUP shouldn't be. It does appear that
 MAILMAN_MAILGROUP defaults to "daemon".

 (Do I want to know why mailman needs to know in advance the group that
 mail stuff will run as? Probably not.)

 -- 
 David A. Holland
 dholland@netbsd.org

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.