- 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!) PR: ports/76837 Submitted by: rik <freebsd-ports@rikrose.net> (maintainer)
This commit is contained in:
parent
de2f97f40e
commit
c7397b2f5d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127713
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= tor
|
||||
PORTVERSION= 0.0.9.2
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= security net
|
||||
MASTER_SITES= http://tor.eff.org/dist/
|
||||
|
||||
@ -34,6 +35,9 @@ post-patch:
|
||||
-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
|
||||
|
||||
|
29
security/tor-devel/files/patch-contrib-tor.sh.in
Normal file
29
security/tor-devel/files/patch-contrib-tor.sh.in
Normal file
@ -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
|
35
security/tor-devel/pkg-install
Normal file
35
security/tor-devel/pkg-install
Normal file
@ -0,0 +1,35 @@
|
||||
#!/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
|
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= tor
|
||||
PORTVERSION= 0.0.9.2
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= security net
|
||||
MASTER_SITES= http://tor.eff.org/dist/
|
||||
|
||||
@ -34,6 +35,9 @@ post-patch:
|
||||
-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
|
||||
|
||||
|
29
security/tor/files/patch-contrib-tor.sh.in
Normal file
29
security/tor/files/patch-contrib-tor.sh.in
Normal file
@ -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
|
35
security/tor/pkg-install
Normal file
35
security/tor/pkg-install
Normal file
@ -0,0 +1,35 @@
|
||||
#!/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
|
Loading…
Reference in New Issue
Block a user