From isometry@ox.isometry.net  Mon Nov 27 00:40:16 2006
Return-Path: <isometry@ox.isometry.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AA4EB16A415
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Nov 2006 00:40:16 +0000 (UTC)
	(envelope-from isometry@ox.isometry.net)
Received: from mail.ox.isometry.net (mail.ox.isometry.net [195.137.51.154])
	by mx1.FreeBSD.org (Postfix) with SMTP id 2DFE143D64
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Nov 2006 00:39:11 +0000 (GMT)
	(envelope-from isometry@ox.isometry.net)
Received: by mail.ox.isometry.net (Postfix, from userid 1001)
	id 55EE7B841; Mon, 27 Nov 2006 00:40:00 +0000 (UTC)
Message-Id: <20061127004000.55EE7B841@mail.ox.isometry.net>
Date: Mon, 27 Nov 2006 00:40:00 +0000 (UTC)
From: Robin Breathe <robin@isometry.net>
Reply-To: Robin Breathe <robin@isometry.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Maintainer Update: ports/dovecot to 1.0.r15
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105899
>Category:       ports
>Synopsis:       Maintainer Update: ports/dovecot to 1.0.r15
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 27 00:50:11 GMT 2006
>Closed-Date:    Fri Dec 01 09:40:13 GMT 2006
>Last-Modified:  Fri Dec  1 09:40:16 GMT 2006
>Originator:     Robin Breathe
>Release:        FreeBSD 6.2-RC1 i386
>Organization:
>Environment:
	
>Description:
Update dovecot to the latest 1.0.rc15 release.
- Full release notes: http://dovecot.org/list/dovecot-news/2006-November/000024.html
- Amongst other things, fix a security bug with mmap_disable=yes (*not* in the default configuration).
- Register UID 143, GID 143 for the dovecot user in ports/UIDs, ports/GIDs; use these and reduce interactive component of install script.
>How-To-Repeat:
	
>Fix:
Apply the patch below at the base of the ports tree:

--- dovecot-1.0.r15.diff begins here ---
diff -ruN ports.orig/GIDs ports/GIDs
--- ports.orig/GIDs	Mon Nov 27 00:12:12 2006
+++ ports/GIDs	Mon Nov 27 00:12:44 2006
@@ -53,6 +53,7 @@
 vchat:*:128:
 _bgpd:*:130:
 _ospfd:*:131:
+dovecot:*:143:
 rbldns:*:153:
 sfs:*:171:
 agk:*:172:
diff -ruN ports.orig/UIDs ports/UIDs
--- ports.orig/UIDs	Mon Nov 27 00:12:08 2006
+++ ports/UIDs	Mon Nov 27 00:14:17 2006
@@ -62,6 +62,7 @@
 vchat:*:128:128:VChat Conferencing System:/nonexistent:/sbin/nologin
 _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin
 _ospfd:*:131:131:OSPF Daemon:/var/empty:/sbin/nologin
+dovecot:*:143:143:Dovecot User:/var/empty:/sbin/nologin
 rbldns:*:153:153:rbldnsd pseudo-user:/nonexistent:/sbin/nologin
 sfs:*:171:171:Self-Certifying File System:/nonexistent:/sbin/nologin
 agk:*:172:172:AquaGateKeeper:/nonexistent:/nonexistent
diff -ruN ports.orig/mail/dovecot/Makefile ports/mail/dovecot/Makefile
--- ports.orig/mail/dovecot/Makefile	Fri Nov 10 20:25:35 2006
+++ ports/mail/dovecot/Makefile	Sun Nov 26 22:32:06 2006
@@ -7,7 +7,7 @@
 #
 
 PORTNAME=	dovecot
-DISTVERSION=	1.0.rc13
+DISTVERSION=	1.0.rc15
 CATEGORIES=	mail ipv6
 MASTER_SITES=	http://www.dovecot.org/releases/
 
diff -ruN ports.orig/mail/dovecot/distinfo ports/mail/dovecot/distinfo
--- ports.orig/mail/dovecot/distinfo	Fri Nov 10 20:25:36 2006
+++ ports/mail/dovecot/distinfo	Sun Nov 26 22:32:19 2006
@@ -1,3 +1,3 @@
-MD5 (dovecot-1.0.rc13.tar.gz) = 47e86f3ee779e805ffca7b923dc50b19
-SHA256 (dovecot-1.0.rc13.tar.gz) = a653939eae55a6ddea7c97e6ddfcdafdfcbdb56727640d61761fc9bbfca62834
-SIZE (dovecot-1.0.rc13.tar.gz) = 1459922
+MD5 (dovecot-1.0.rc15.tar.gz) = 26f3d2b075856b1b1d180146363819e6
+SHA256 (dovecot-1.0.rc15.tar.gz) = e1e42e5c808301c5a709d54c5949cd8c1d3c43861e4e918548ded5841865487f
+SIZE (dovecot-1.0.rc15.tar.gz) = 1463069
diff -ruN ports.orig/mail/dovecot/pkg-deinstall ports/mail/dovecot/pkg-deinstall
--- ports.orig/mail/dovecot/pkg-deinstall	Wed Jul 28 12:18:11 2004
+++ ports/mail/dovecot/pkg-deinstall	Mon Nov 27 00:19:03 2006
@@ -29,13 +29,15 @@
 }
 
 delete_account() {
-	local u
+	local port user uid group gid
 
-	u=$1
-	if yesno "Do you want me to remove user \"${u}\"" n; then
-		pw userdel -n ${u}
-		echo "Done."
-	fi
+	port=$1
+	user=${2%:*}
+	uid=${2#*:}
+	group=${3%:*}
+	gid=${3#*:}
+
+	echo "If you do not intend to reinstall ${port}, you should manually remove the user '${user}' (uid='${uid}') and the group '${group}' (gid='${gid}')."
 }
 
 case $2 in
@@ -50,7 +52,7 @@
 		fi
 	fi
 
-	delete_account dovecot
+	delete_account Dovecot dovecot:143 dovecot:143
 
 	base=/var/run/dovecot
 	DIRLIST="${base}/login ${base}"
diff -ruN ports.orig/mail/dovecot/pkg-install ports/mail/dovecot/pkg-install
--- ports.orig/mail/dovecot/pkg-install	Mon Jul 24 16:29:10 2006
+++ ports/mail/dovecot/pkg-install	Mon Nov 27 00:29:59 2006
@@ -30,46 +30,60 @@
 	done
 }
 
-make_account() {
-	local u g gcos
+create_account() {
+	local port user uid group gid gcos home shell
 
-	u=$1
-	g=$2
-	gcos=$3
+	port=$1
+	user=${2%:*}
+	uid=${2#*:}
+	group=${3%:*}
+	gid=${3#*:}
+	gcos=$4
+	home=$5
+	shell=$6
 
-	if pw group show "${g}" >/dev/null 2>&1; then
-		echo "You already have a group \"${g}\", so I will use it."
+	pw_user_uid=$(pw usershow -n "${user}" 2>/dev/null | cut -d: -f3)
+	pw_uid_user=$(pw usershow -u "${uid}" 2>/dev/null | cut -d: -f1)
+	pw_group_gid=$(pw groupshow -n "${group}" 2>/dev/null | cut -d: -f3)
+	pw_gid_group=$(pw groupshow -g "${gid}" 2>/dev/null | cut -d: -f1)
+
+	if [ -z "${pw_group_gid}" -a -z "${pw_gid_group}" ]; then
+		echo "You need a ${group} group; creating it..."
+		pw groupadd "${group}" -g "${gid}" || exit
+		echo "Done."
+	elif [ "${gid}" = "${pw_group_gid}" -a "${group}" = "${pw_gid_group}" ]; then
+		echo "Using existing ${group} group."
 	else
-		echo "You need a group \"${g}\"."
-		if which -s pw && yesno "Would you like me to create it" y
-		then
-			pw groupadd ${g} || exit
-			echo "Done."
-		else
-			echo "Please create it, and try again."
-			exit 1
-		fi
+		echo "${port} has reserved the groupname '${group}' and gid '${gid}':"
+		[ -n "${pw_group_gid}" -a "${gid}"   != "${pw_group_gid}" ] \
+			&& echo "ERROR: groupname '${group}' already in use by gid '${pw_group_gid}'"
+		[ -n "${pw_gid_group}" -a "${group}" != "${pw_gid_group}" ] \
+			&& echo "ERROR: gid '${gid}' already in use by group '${pw_gid_group}'"
+		echo "Please resolve these issues and try again."
+		exit 1
 	fi
-    
-	if pw user show "${u}" >/dev/null 2>&1; then
-		echo "You already have a user \"${u}\", so I will use it."
+
+	if [ -z "${pw_user_uid}" -a -z "${pw_uid_user}" ]; then
+		echo "You need a ${user} user; creating it..."
+		pw useradd "${user}" -u "${uid}" -g "${group}" -c "${gcos}" -d "${home}" -s "${shell}"
+		echo "Done."
+	elif [ "${uid}" = "${pw_user_uid}" -a "${user}" = "${pw_uid_user}" ]; then
+		echo "Using existing ${user} user."
 	else
-		echo "You need a user \"${u}\"."
-		if which -s pw && yesno "Would you like me to create it" y
-		then
-			pw useradd ${u} -g ${g} -c "${gcos}" -d /nonexistent -s /sbin/nologin -h - || exit
-			echo "Done."
-		else
-			echo "Please create it, and try again."
-			exit 1
-		fi
+		echo "${port} has reserved the username '${user}' and uid '${uid}':"
+		[ -n "${pw_user_uid}" -a "${uid}"  != "${pw_user_uid}" ] \
+			&& echo "ERROR: username '${user}' already in use by uid '${pw_user_uid}'"
+		[ -n "${pw_uid_user}" -a "${user}" != "${pw_uid_user}" ] \
+			&& echo "ERROR: uid '${uid}' already in use by user '${pw_uid_user}'"
+		echo "Please resolve these issues and try again."
+		exit 1
 	fi
 }
 
 case $2 in
 
 PRE-INSTALL)
-	make_account dovecot dovecot "Dovecot"
+	create_account Dovecot dovecot:143 dovecot:143 "Dovecot User" /var/empty /sbin/nologin
 	;;
 
 POST-INSTALL)
--- dovecot-1.0.r15.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->alexbl 
Responsible-Changed-By: alexbl 
Responsible-Changed-When: Mon Nov 27 06:53:01 UTC 2006 
Responsible-Changed-Why:  
I will take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105899 
Responsible-Changed-From-To: alexbl->freebsd-bugs 
Responsible-Changed-By: alexbl 
Responsible-Changed-When: Thu Nov 30 04:39:18 UTC 2006 
Responsible-Changed-Why:  
Release this one to the wild so someone else can grab it 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105899 
Responsible-Changed-From-To: freebsd-bugs->freebsd-ports-bugs 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Nov 30 12:26:40 UTC 2006 
Responsible-Changed-Why:  
Reassign to the ports team. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105899 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Fri Dec 1 09:30:09 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/105899: commit references a PR
Date: Fri,  1 Dec 2006 09:39:40 +0000 (UTC)

 pav         2006-12-01 09:39:34 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/dovecot         Makefile distinfo pkg-deinstall 
                          pkg-install 
   Log:
   - Update to 1.0 rc15
   - Use UID/GID 143
   
   PR:             ports/105899
   Submitted by:   Robin Breathe <robin@isometry.net> (maintainer)
   
   Revision  Changes    Path
   1.57      +1 -1      ports/mail/dovecot/Makefile
   1.32      +3 -3      ports/mail/dovecot/distinfo
   1.4       +9 -7      ports/mail/dovecot/pkg-deinstall
   1.9       +45 -31    ports/mail/dovecot/pkg-install
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
