ports/157587: Fix port: dns/powerdns-recursor should use USERS

Chris Rees utisoft at gmail.com
Sat Jun 4 09:30:15 UTC 2011


>Number:         157587
>Category:       ports
>Synopsis:       Fix port: dns/powerdns-recursor 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 09:30:14 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 pkg-install and pkg-deinstall have been removed.

--- dns-powerdns-recursor.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/dns/powerdns-recursor/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- Makefile	30 Sep 2010 05:05:16 -0000	1.22
+++ Makefile	2 Jun 2011 15:27:13 -0000
@@ -41,6 +41,8 @@
 
 .if defined(WITH_SETUID)
 EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-setuid
+USERS=		pdns_recursor
+GROUPS=		pdns
 .endif
 
 .if defined(WITH_LUA)
@@ -71,12 +73,6 @@
 	@${REINPLACE_CMD} -e 's;"/etc/powerdns/";"${PREFIX}/etc/pdns/";' \
 		${WRKSRC}/config.h
 
-.if defined(WITH_SETUID)
-pre-install:
-		@${ECHO} "==>  Creating custom user to run pdns_recursor..."
-		@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-.endif
-
 post-install:
 .if !exists(${PREFIX}/etc/pdns/recursor.conf)
 	${INSTALL_DATA} ${PREFIX}/etc/pdns/recursor.conf-dist \
Index: pkg-deinstall
===================================================================
RCS file: pkg-deinstall
diff -N pkg-deinstall
--- pkg-deinstall	6 Aug 2008 20:48:41 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-    exit 0
-fi
-
-PDNSUSER=${PDNSUSER:-pdns_recursor}
-PDNSUID=${PDNSUID:-120}
-PDNSGROUP=${PDNSGROUP:-pdns}
-PDNSGID=${PDNSGID:-120}
-
-if pw groupshow "$PDNSGROUP" 2>/dev/null 1>&2; then
-	echo "To delete the PowerDNS group permanently, use 'pw groupdel ${PDNSGROUP}'"
-fi
-
-if pw usershow "$PDNSUSER" 2>/dev/null 1>&2; then
-	echo "To delete the PowerDNS user permanently, use 'pw userdel ${PDNSUSER}'"
-fi
-exit 0
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	18 Jan 2007 18:57:25 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-if [ "$2" != "PRE-INSTALL" ]; then
-    exit 0
-fi
-
-PDNSUSER=${PDNSUSER:-pdns_recursor}
-PDNSUID=${PDNSUID:-120}
-PDNSGROUP=${PDNSGROUP:-pdns}
-PDNSGID=${PDNSGID:-120}
-
-if ! pw groupshow "$PDNSGROUP" 2>/dev/null 1>&2; then
-	if pw groupadd $PDNSGROUP -g $PDNSGID; then
-		echo "=> Added group \"$PDNSGROUP\"."
-	else
-		echo "=> Adding group \"$PDNSGROUP\" failed..."
-		exit 1
-	fi
-fi
-
-if ! pw usershow "$PDNSUSER" 2>/dev/null 1>&2; then
-	if pw useradd $PDNSUSER -u $PDNSUID -g $PDNSGROUP -h - \
-		-s "/sbin/nologin" -d "/nonexistent" \
-		-c "pdns_recursor pseudo-user"; \
-	then
-		echo "=> Added user \"$PDNSUSER\"."
-	else
-		echo "=> Adding user \"$PDNSUSER\" failed..."
-		exit 1
-	fi
-fi
-exit 0
--- dns-powerdns-recursor.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