ports/157608: Fix port: mail/dcc-dccd should use USERS

Chris Rees utisoft at gmail.com
Sat Jun 4 12:10:12 UTC 2011


>Number:         157608
>Category:       ports
>Synopsis:       Fix port: mail/dcc-dccd should use USERS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 04 12:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
bayofrum
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root at zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS

	Submitted by: Chris Rees (utisoft at gmail.com)

	Please note that files/pkg-deinstall.in has been removed


--- mail-dcc-dccd.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/dcc-dccd/Makefile,v
retrieving revision 1.46
diff -u -r1.46 Makefile
--- Makefile	31 Jan 2010 03:45:20 -0000	1.46
+++ Makefile	4 Jun 2011 10:50:48 -0000
@@ -56,9 +56,10 @@
 ## User for DCC files and SUID binaries
 #
 DCCUSER?=	dcc
-DCCUID?=	112
 DCCGROUP?=	dcc
-DCCGID?=	112
+
+USERS=		${DCCUSER}
+GROUPS=		${DCCGROUP}
 
 PLIST_SUB+=	DCCUSER="${DCCUSER}"
 
@@ -69,9 +70,8 @@
 
 .include <bsd.port.options.mk>
 
-SUB_FILES=		pkg-install pkg-deinstall pkg-message
-SUB_LIST+=		WRKSRC=${WRKSRC} DCCUSER=${DCCUSER} DCCUID=${DCCUID} \
-			DCCGROUP=${DCCGROUP} DCCGID=${DCCGID} DCCHOME=${DCCHOME}
+SUB_FILES=		pkg-install pkg-message
+SUB_LIST+=		WRKSRC=${WRKSRC} DCCHOME=${DCCHOME}
 
 ## /var/dcc home support
 #
@@ -176,10 +176,6 @@
 	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
 	@${ECHO_MSG} ' '
 
-pre-install:
-	@${SETENV} PKG_PREFIX=${PREFIX} \
-	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
-
 post-install:
 
 ## Make certain DCC's config files are owned by DCC's user
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in	31 Jan 2010 03:45:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/mail/dcc-dccd/files/pkg-deinstall.in,v 1.1 2010/01/31 03:45:21 pgollucci Exp $
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-	exit 0
-fi
-
-DCCUSER=%%DCCUSER%%
-
-if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
-	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
-fi
-exit 0
Index: files/pkg-install.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/dcc-dccd/files/pkg-install.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install.in
--- files/pkg-install.in	31 Jan 2010 03:45:21 -0000	1.1
+++ files/pkg-install.in	2 Jun 2011 21:06:01 -0000
@@ -3,35 +3,9 @@
 
 PREFIX=${PKG_PREFIX:-%%PREFIX%%}
 
-DCCUSER=%%DCCUSER%%
-DCCUID=%%DCCUID%%
-DCCGROUP=%%DCCGROUP%%
-DCCGID=%%DCCGID%%
 DCCHOME=%%DCCHOME%%
 
-if [ "$2" = "PRE-INSTALL" ]; then
-
-	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
-		if pw groupadd $DCCGROUP -g $DCCGID; then
-			echo "=> Added group \"$DCCGROUP\"."
-		else
-			echo "=> Adding group \"$DCCGROUP\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
-		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
-			-s "/sbin/nologin" -d "$DCCHOME" \
-			-c "Distributed Checksum Clearinghouse"; \
-		then
-			echo "=> Added user \"$DCCUSER\"."
-		else
-			echo "=> Adding user \"$DCCUSER\" failed..."
-			exit 1
-		fi
-	fi
-elif [ "$2" = "POST-INSTALL" ]; then
+if [ "$2" = "POST-INSTALL" ]; then
 
 	echo "=> Generating unique passwords for your DCC install..."
 	echo "=>"
--- mail-dcc-dccd.patch ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list