aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2008-11-12 01:10:21 +0000
committerSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2008-11-12 01:10:21 +0000
commitdb94f36633ba0facf1dd1424a7adc60ed391868b (patch)
tree350df5fb513264b5bcceb9caf1eda294cecdd4b5 /contrib
parent5fbba9fa3387c0b2f2fd53f0e0d766a3f02bcfb5 (diff)
downloadtor-db94f36633ba0facf1dd1424a7adc60ed391868b.tar.gz
tor-db94f36633ba0facf1dd1424a7adc60ed391868b.zip
Backport of changesets 17200, 17201, 17203-17206, 17228, 17232, 17236: Patch from Jacob Appelbaum and me to make User option more robust, properly set supplementary groups, deprecated the Group option, and log more information on credential switching. Fixes bugs 848 and 857
svn:r17255
Diffstat (limited to 'contrib')
-rw-r--r--contrib/linux-tor-prio.sh6
-rw-r--r--contrib/rc.subr4
-rw-r--r--contrib/tor.sh.in2
-rw-r--r--contrib/torctl.in6
4 files changed, 5 insertions, 13 deletions
diff --git a/contrib/linux-tor-prio.sh b/contrib/linux-tor-prio.sh
index 0ebb47564a..d7481668ca 100644
--- a/contrib/linux-tor-prio.sh
+++ b/contrib/linux-tor-prio.sh
@@ -9,8 +9,8 @@
# This script provides prioritization of Tor traffic below other
# traffic on a Linux server. It has two modes of operation: UID based
# and IP based. The UID based method requires that Tor be launched from
-# a specific user ID. The "User" and "Group" Tor config settings are
-# insufficient, as they set the UID after the socket is created.
+# a specific user ID. The "User" Tor config setting is
+# insufficient, as it sets the UID after the socket is created.
# Here is a three line C wrapper you can use to execute Tor and drop
# privs to UID 501 before it creates any sockets. Change the UID
# to the UID for your tor server user, and compile with
@@ -49,7 +49,7 @@
DEV=eth0
-# NOTE! You must START Tor under this UID. Using the Tor User/Group
+# NOTE! You must START Tor under this UID. Using the Tor User
# config setting is NOT sufficient.
TOR_UID=$(id -u tor)
diff --git a/contrib/rc.subr b/contrib/rc.subr
index 8852b60466..117ae71d47 100644
--- a/contrib/rc.subr
+++ b/contrib/rc.subr
@@ -14,7 +14,6 @@
# tor_conf (str): Points to your tor conf file
# Default: /usr/local/etc/tor/torrc
# tor_user (str): Tor Daemon user. Default _tor
-# tor_groupr (str): Tor Daemon group. Default _tor
#
. /etc/rc.subr
@@ -27,7 +26,6 @@ load_rc_config ${name}
: ${tor_enable="NO"}
: ${tor_conf="/usr/local/etc/tor/torrc"}
: ${tor_user="_tor"}
-: ${tor_group="_tor"}
: ${tor_pidfile="/var/run/tor/tor.pid"}
: ${tor_logfile="/var/log/tor"}
: ${tor_datadir="/var/run/tor"}
@@ -35,7 +33,7 @@ load_rc_config ${name}
required_files=${tor_conf}
required_dirs=${tor_datadir}
command="/usr/local/bin/${name}"
-command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user} --group ${tor_group}"
+command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user}"
extra_commands="log"
log_cmd="${name}_log"
diff --git a/contrib/tor.sh.in b/contrib/tor.sh.in
index 362a455732..e169761a62 100644
--- a/contrib/tor.sh.in
+++ b/contrib/tor.sh.in
@@ -31,8 +31,6 @@ TORCTL=@BINDIR@/torctl
# torctl will use these environment variables
TORUSER=@TORUSER@
export TORUSER
-TORGROUP=@TORGROUP@
-export TORGROUP
if [ -x /bin/su ] ; then
SUPROG=/bin/su
diff --git a/contrib/torctl.in b/contrib/torctl.in
index 4136bd9434..4cc137da46 100644
--- a/contrib/torctl.in
+++ b/contrib/torctl.in
@@ -41,22 +41,18 @@ TORDATA="@LOCALSTATEDIR@/lib/tor"
TORARGS="--pidfile $PIDFILE --log \"notice file $LOGFILE\" --runasdaemon 1"
TORARGS="$TORARGS --datadirectory $TORDATA"
-# If user and group names are set in the environment, then use them;
+# If user name is set in the environment, then use it;
# otherwise run as the invoking user (or whatever user the config
# file says)... unless the invoking user is root. The idea here is to
# let an unprivileged user run tor for her own use using this script,
# while still providing for it to be used as a system daemon.
if [ "x`id -u`" = "x0" ]; then
TORUSER=@TORUSER@
- TORGROUP=@TORGROUP@
fi
if [ "x$TORUSER" != "x" ]; then
TORARGS="$TORARGS --user $TORUSER"
fi
-if [ "x$TORGROUP" != "x" ]; then
- TORARGS="$TORARGS --group $TORGROUP"
-fi
# We no longer wrap the Tor daemon startup in an su when running as
# root, because it's too painful to make the use of su portable.