From alex@trull.org  Mon Nov 17 01:35:01 2008
Return-Path: <alex@trull.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A568106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Nov 2008 01:35:01 +0000 (UTC)
	(envelope-from alex@trull.org)
Received: from mail.internationalconspiracy.org (mail.internationalconspiracy.org [85.234.142.62])
	by mx1.freebsd.org (Postfix) with ESMTP id E67998FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Nov 2008 01:35:00 +0000 (UTC)
	(envelope-from alex@trull.org)
Received: from localhost (mail.internationalconspiracy.org [85.234.142.62])
	by mail.internationalconspiracy.org (Postfix) with ESMTP id C22C44BC20
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Nov 2008 01:15:56 +0000 (GMT)
Received: from mail.internationalconspiracy.org ([85.234.142.62])
	by localhost (mail.internationalconspiracy.org [85.234.142.62]) (amavisd-new, port 10024)
	with LMTP id S6d3m0jRzOP0 for <FreeBSD-gnats-submit@freebsd.org>;
	Mon, 17 Nov 2008 01:15:43 +0000 (GMT)
Received: from _HOSTNAME_ (syndicate.internationalconspiracy.org [85.234.142.55])
	by mail.internationalconspiracy.org (Postfix) with SMTP id 5AB1A4BC0D
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Nov 2008 01:15:43 +0000 (GMT)
Received: by _HOSTNAME_ (sSMTP sendmail emulation); Mon, 17 Nov 2008 01:15:42 +0000
Message-Id: <20081117011541.GH5505@syndicate.internationalconspiracy.org>
Date: Mon, 17 Nov 2008 01:15:42 +0000
From: Alex Trull <alex@trull.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Fixed rc script for dovecot port

>Number:         128932
>Category:       ports
>Synopsis:       Fixed rc script for mail/dovecot port
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 17 01:40:01 UTC 2008
>Closed-Date:    Fri Nov 21 17:41:43 UTC 2008
>Last-Modified:  Fri Nov 21 17:41:43 UTC 2008
>Originator:     Alex Trull
>Release:        FreeBSD 7
>Organization:
>Environment:
>Description:
rc script from recent port update (ports/128469) won't get a gid, so
won't start up correctly.

>How-To-Repeat:
Run the v1.9 rc script with the start option.

>Fix:
See attached patch - single line changed to be simpler and more direct.

Regards,

Alex Trull

--- dovecot.sh.in.orig	2008-11-17 00:23:35.725323671 +0000
+++ dovecot.sh.in	2008-11-17 00:26:27.317580366 +0000
@@ -31,7 +31,7 @@
 	local base user gid
 	base=/var/run/${name}
 	user=$(/usr/bin/awk -F '[[:space:]]*=[[:space:]]*' '/^[[:space:]]*login_user[[:space:]]*=/ { print $2 }' ${required_files})
-	gid=$(/usr/sbin/pw usershow -n "${user:-${name}}" 2>/dev/null | /usr/bin/cut -d: -f4)
+	gid=$(/usr/sbin/pw groupshow -n ${user-${name}} 2>/dev/null | /usr/bin/cut -d: -f3)
 	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
 	/usr/bin/install -o root -g ${gid} -m 0750 -d ${base}/login
 }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 17 02:49:41 UTC 2008 
Responsible-Changed-Why:  
Reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128932 
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Mon Nov 17 18:43:40 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128932 

From: Yarema <yds@CoolRat.org>
To: bug-followup@FreeBSD.org
Cc: alex@trull.org, Wesley Shields <wxs@FreeBSD.org>, 
 Nicolas Letellier <nicolas@nicoelro.net>
Subject: Re: ports/128932: Fixed rc script for mail/dovecot port
Date: Fri, 21 Nov 2008 12:12:28 -0500

 I cannot reproduce the issue.
 
 Running the code in question on the command line:
 /usr/sbin/pw usershow -n "dovecot" 2>/dev/null | /usr/bin/cut -d: -f4
 returns: 143
 as expected.  Running the suggested fix does the same.  However "pw 
 usershow" makes more sense to me because we're going for the group of 
 the user specified with "login_user" and not for the group with the same 
 name as the user specified with "login_user".  The two are not 
 necessarily the same so this patch could introduce a subtle bug.
 
 I suspect there may be some sort of corruption in the PR submitter's 
 passwd db.  Make sure the "dovecot" user is created correctly.  And if 
 using a different "login_user" make sure the passwd and group records 
 are sensible.  This has been well tested before commiting to the port by 
 myself and Nicolas Letellier <nicolas@nicoelro.net>, who initially 
 brought this to my attention.
 
 -- 
 Yarema

From: Wesley Shields <wxs@FreeBSD.org>
To: Yarema <yds@CoolRat.org>
Cc: bug-followup@FreeBSD.org, alex@trull.org,
	Nicolas Letellier <nicolas@nicoelro.net>
Subject: Re: ports/128932: Fixed rc script for mail/dovecot port
Date: Fri, 21 Nov 2008 12:25:07 -0500

 On Fri, Nov 21, 2008 at 12:12:28PM -0500, Yarema wrote:
 > I cannot reproduce the issue.
 > 
 > Running the code in question on the command line:
 > /usr/sbin/pw usershow -n "dovecot" 2>/dev/null | /usr/bin/cut -d: -f4
 > returns: 143
 > as expected.  Running the suggested fix does the same.  However "pw 
 > usershow" makes more sense to me because we're going for the group of 
 > the user specified with "login_user" and not for the group with the same 
 > name as the user specified with "login_user".  The two are not 
 > necessarily the same so this patch could introduce a subtle bug.
 
 This was my assessment of the situation also.  Thanks for the
 confirmation.
 
 > I suspect there may be some sort of corruption in the PR submitter's 
 > passwd db.  Make sure the "dovecot" user is created correctly.  And if 
 > using a different "login_user" make sure the passwd and group records 
 > are sensible.  This has been well tested before commiting to the port by 
 > myself and Nicolas Letellier <nicolas@nicoelro.net>, who initially 
 > brought this to my attention.
 
 I agree with your suspicion.  I'll close out this PR and thanks for your
 work on this port.
 
 -- WXS
State-Changed-From-To: open->closed 
State-Changed-By: wxs 
State-Changed-When: Fri Nov 21 17:41:42 UTC 2008 
State-Changed-Why:  
Patch rejected by maintainer.  This may introduce a bug and is likely a 
symptom of a local problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128932 
>Unformatted:
