ports/88602: privoxy poor defaults
Pav Lucistnik
pav at FreeBSD.org
Sun Nov 13 23:10:18 UTC 2005
The following reply was made to PR ports/88602; it has been noted by GNATS.
From: Pav Lucistnik <pav at FreeBSD.org>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/88602: privoxy poor defaults
Date: Mon, 14 Nov 2005 00:03:03 +0100
Here is the patch from the originator:
--- privoxy/Makefile Wed Mar 2 15:28:43 2005
+++ privoxy/Makefile Sun Nov 13 02:41:38 2005
@@ -48,6 +48,8 @@
pre-install:
@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
${PKGDIR}/pkg-message.in > ${PKGMESSAGE}
+ @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
+ ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@${MKDIR} ${PREFIX}/etc/privoxy/templates
@@ -67,5 +69,11 @@
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/privoxy.sh ${PREFIX}/etc/rc.d/
@${CAT} ${PKGMESSAGE}
+ ${TOUCH} /var/log/privoxy
+ ${CHOWN} privoxy:privoxy /var/log/privoxy
+ ${CHMOD} 0640 /var/log/privoxy
+ ${TOUCH} /var/log/jarfile
+ ${CHOWN} privoxy:privoxy /var/log/jarfile
+ ${CHMOD} 0600 /var/log/jarfile
.include <bsd.port.mk>
--- privoxy/files/privoxy.sh.in Thu Feb 17 12:43:02 2005
+++ privoxy/files/privoxy.sh.in Sun Nov 13 02:34:08 2005
@@ -30,7 +30,7 @@
echo "${name} is already running"
else
echo "Starting ${name}."
- ${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile} \
+ su -m privoxy -c '${command} ${privoxy_flags} ${configfile} --pidfile ${pidfile}' \
1>/dev/null 2>&1
fi
}
--- privoxy/pkg-install Wed Dec 31 20:00:00 1969
+++ privoxy/pkg-install Sun Nov 13 02:36:35 2005
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+PW=/usr/sbin/pw
+ECHO=echo
+USER=privoxy
+GROUP=${USER}
+UIDGID=201
+
+if ! ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then
+ if ${PW} groupadd ${GROUP} -g ${UIDGID}; 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 "/nonexistent" \
+ -c "privoxy pseudo-user" -u ${UIDGID}; \
+ then
+ ${ECHO} "Added user \"${USER}\"."
+ else
+ ${ECHO} "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+exit 0
--
Pav Lucistnik <pav at oook.cz>
<pav at FreeBSD.org>
It's time for the penguin on top of your television set to explode.
More information about the freebsd-ports-bugs
mailing list