Date: Sun, 30 Jan 2005 00:42:20 +0000 (GMT) From: rik <freebsd-ports@rikrose.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/76837: maintainer-update of security/tor Message-ID: <20050130004220.6F92E8B801@lost.little-black-kitty.net> Resent-Message-ID: <200501300050.j0U0oM1b044584@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 76837 >Category: ports >Synopsis: maintainer-update of security/tor >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Jan 30 00:50:20 GMT 2005 >Closed-Date: >Last-Modified: >Originator: rik >Release: FreeBSD 4.10-STABLE i386 >Organization: N/A >Environment: System: FreeBSD seventeen.build.internal 4.10-STABLE FreeBSD 4.10-STABLE #0: Fri Oct 29 21:35:01 BST 2004 root@one.build.internal:/usr/obj/usr/src/sys/BUILD i386 >Description: security/tor has moved up to 0.0.9.3. The last 2 updates were sent in by other people, with my approval, and so I've made the effort to actually maintain this port now. This update provides: - adds _tor user and gourp for tor to run as - puts data into /var/db/tor/data - TAKE NOTE WHEN UPGRADING! - working tor.sh!!! (finally. sorry for not doing this earlier!) There should be no patches present, except for patch-aa. >How-To-Repeat: >Fix: diff -ruN /usr/ports/security/tor/Makefile tor/Makefile --- /usr/ports/security/tor/Makefile Sat Jan 29 11:27:32 2005 +++ tor/Makefile Sat Jan 29 18:14:58 2005 @@ -23,6 +23,7 @@ MANCOMPRESSED= no MAN1= tor.1 tor-resolve.1 torify.1 + post-patch: @${MV} ${WRKSRC}/contrib/tor-tsocks.conf \ ${WRKSRC}/contrib/tor-tsocks.conf.sample @@ -34,6 +35,9 @@ -e 's!-g -O2!!' \ -e 's!-O2!!' +pre-install: + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + post-install: @${CP} ${WRKSRC}/contrib/tor.sh ${LOCALBASE}/etc/rc.d/tor.sh.sample diff -ruN /usr/ports/security/tor/files/patch-aa tor/files/patch-aa --- /usr/ports/security/tor/files/patch-aa Thu Jan 1 01:00:00 1970 +++ tor/files/patch-aa Sat Jan 29 21:05:05 2005 @@ -0,0 +1,29 @@ +--- contrib/tor.sh.in.orig Sat Jan 29 20:41:19 2005 ++++ contrib/tor.sh.in Sat Jan 29 20:46:14 2005 +@@ -5,12 +5,12 @@ + # chkconfig: 2345 90 10 + # description: Onion Router + +-TORUSER= +-TORGROUP= ++TORUSER=_tor ++TORGROUP=_tor + TORBIN=@BINDIR@/tor +-TORPID=@LOCALSTATEDIR@/run/tor/tor.pid +-TORLOG=@LOCALSTATEDIR@/log/tor/tor.log +-TORDATA=@LOCALSTATEDIR@/lib/tor ++TORPID=/var/run/tor.pid ++TORLOG=/var/log/tor.log ++TORDATA=/var/db/tor/data + + TORCONF=@CONFDIR@/torrc + # Strictly speaking, we don't need to su if we have --user and --group. +@@ -36,7 +36,7 @@ + if [ "x$TORUSER" = "x" ]; then + $TORBIN -f $TORCONF $TORARGS + else +- /bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER ++ /usr/bin/su $TORUSER -c "$TORBIN -f $TORCONF $TORARGS" + fi + RETVAL=$? + if [ $RETVAL -eq 0 ]; then diff -ruN /usr/ports/security/tor/pkg-install tor/pkg-install --- /usr/ports/security/tor/pkg-install Thu Jan 1 01:00:00 1970 +++ tor/pkg-install Sat Jan 29 20:17:02 2005 @@ -0,0 +1,36 @@ +#!/bin/sh + +if [ x"$2" = xPRE-INSTALL ]; then + USER="_tor" + UID="256" + GROUP="_tor" + GID="256" + + if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d /var/db/tor \ + -s /bin/sh \ + -c "Tor anonymising router"; then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi +fi + diff -ruN /usr/ports/security/tor/pkg-plist tor/pkg-plist --- /usr/ports/security/tor/pkg-plist Sat Jan 29 11:27:32 2005 +++ tor/pkg-plist Sat Dec 25 04:16:51 2004 @@ -4,6 +4,4 @@ etc/rc.d/tor.sh.sample etc/tor/torrc.sample etc/tor/tor-tsocks.conf.sample -@dirrm share/nls/en_US.US-ASCII -@dirrm share/nls/POSIX @dirrm etc/tor >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050130004220.6F92E8B801>