ports/157578: [PATCH] Fix port: dns/dnrd should use USERS
Chris Rees
utisoft at gmail.com
Sat Jun 4 08:40:10 UTC 2011
>Number: 157578
>Category: ports
>Synopsis: [PATCH] Fix port: dns/dnrd 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 08:40:09 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)
This depends on ports/157528 for the UIDs patch
--- dns-dnrd.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/dns/dnrd/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile 21 Aug 2008 06:16:53 -0000 1.30
+++ Makefile 2 Jun 2011 15:16:50 -0000
@@ -28,14 +28,12 @@
DEBUG "Enable debugging" off \
RANDOM "Enable random source port" off
-DNRD_USER?= dnrd
-DNRD_GROUP?= dnrd
+USERS= dnrd
+GROUPS= dnrd
DNRD_DIR?= ${ETCDIR}
SUB_FILES= pkg-install
-SUB_LIST+= DNRD_USER=${DNRD_USER} \
- DNRD_GROUP=${DNRD_GROUP} \
- DNRD_DIR=${DNRD_DIR}
+SUB_LIST+= DNRD_DIR=${DNRD_DIR}
.include <bsd.port.pre.mk>
@@ -55,10 +53,6 @@
CONFIGURE_ARGS+= --enable-random-src
.endif
-pre-install:
- @${ECHO} "==> Creating custom user to run dnrd..."
- @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
do-install:
@${ECHO} "==> Creating dnrd directory"
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
Index: pkg-install
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/dns/dnrd/pkg-install,v
retrieving revision 1.1
diff -u -r1.1 pkg-install
--- pkg-install 6 Sep 2005 12:10:46 -0000 1.1
+++ pkg-install 2 Jun 2011 15:14:30 -0000
@@ -1,34 +1,9 @@
#!/bin/sh
-USER=${DNRDUSER:-dnrd}
-GROUP=${USER}
SYSCONF_DIR=${SYSCONF_DIR:-${PKG_PREFIX}/etc/dnrd}
case $2 in
- PRE-INSTALL)
- if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
- if pw groupadd ${GROUP}; then
- echo "Added group \"${GROUP}\"."
- else
- echo "Adding group \"${GROUP}\" failed..."
- exit 1
- fi
- fi
-
- if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
- if pw useradd ${USER} -g ${GROUP} -h - \
- -s "/sbin/nologin" -d "/var/empty" \
- -c "DNRD daemon"; \
- then
- echo "Added user \"${USER}\"."
- else
- echo "Adding user \"${USER}\" failed..."
- exit 1
- fi
- fi
- ;;
-
POST-INSTALL)
if [ ! -d ${SYSCONF_DIR} ]; then
mkdir -p ${SYSCONF_DIR}
--- dns-dnrd.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