mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
[bug 144] Have torctl.in/tor.sh.in check for location of su binary.
svn:r4311
This commit is contained in:
parent
9f24078452
commit
a94d7256ea
@ -24,6 +24,18 @@ if [ "x$TORGROUP" != "x" ]; then
|
||||
fi
|
||||
RETVAL=0
|
||||
|
||||
if [ -x /bin/su ] ; then
|
||||
SUPROG=/bin/su
|
||||
elif [ -x /sbin/su ] ; then
|
||||
SUPROG=/sbin/su
|
||||
elif [ -x /usr/bin/su ] ; then
|
||||
SUPROG=/usr/bin/su
|
||||
elif [ -x /usr/sbin/su ] ; then
|
||||
SUPROG=/usr/sbin/su
|
||||
else
|
||||
SUPROG=/bin/su
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
start)
|
||||
@ -36,7 +48,7 @@ case "$1" in
|
||||
if [ "x$TORUSER" = "x" ]; then
|
||||
$TORBIN -f $TORCONF $TORARGS
|
||||
else
|
||||
/bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER
|
||||
$SUPROG -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER
|
||||
fi
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
|
@ -54,11 +54,23 @@ if [ "x$TORGROUP" != "x" ]; then
|
||||
TORARGS="$TORARGS --group $TORGROUP"
|
||||
fi
|
||||
|
||||
if [ -x /bin/su ] ; then
|
||||
SUPROG=/bin/su
|
||||
elif [ -x /sbin/su ] ; then
|
||||
SUPROG=/sbin/su
|
||||
elif [ -x /usr/bin/su ] ; then
|
||||
SUPROG=/usr/bin/su
|
||||
elif [ -x /usr/sbin/su ] ; then
|
||||
SUPROG=/usr/sbin/su
|
||||
else
|
||||
SUPROG=/bin/su
|
||||
fi
|
||||
|
||||
# the command used to start
|
||||
if [ "x$TORUSER" = "x" ]; then
|
||||
START="$TORBIN -f $TORCONF $TORARGS"
|
||||
else
|
||||
START="/bin/su -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER"
|
||||
START="$SUPROG -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER"
|
||||
fi
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user