[or-cvs] r13818: Merge r13787 and r13788 into 0.2.0.x branch. r13787: Move co (tor/branches/tor-0_2_0-patches/debian)
weasel at seul.org
weasel at seul.org
Mon Mar 3 12:35:59 UTC 2008
Author: weasel
Date: 2008-03-03 07:35:58 -0500 (Mon, 03 Mar 2008)
New Revision: 13818
Modified:
tor/branches/tor-0_2_0-patches/debian/changelog
tor/branches/tor-0_2_0-patches/debian/tor.init
Log:
Merge r13787 and r13788 into 0.2.0.x branch.
r13787: Move config check to its own function
r13788: Run --verify-config before start/reload/restart as root.
Modified: tor/branches/tor-0_2_0-patches/debian/changelog
===================================================================
--- tor/branches/tor-0_2_0-patches/debian/changelog 2008-03-03 12:17:37 UTC (rev 13817)
+++ tor/branches/tor-0_2_0-patches/debian/changelog 2008-03-03 12:35:58 UTC (rev 13818)
@@ -1,3 +1,11 @@
+tor (0.2.0.20-rc-1+XX) XXperimental; urgency=low
+
+ * Run --verify-config before start/reload/restart as root. No longer
+ su - to debian-tor tor run it. Given that we now even start Tor as
+ root (it setuids later on) this should be fine (closes: #468566).
+
+ -- Peter Palfrader <weasel at debian.org> Sat, 1 Mar 2008 01:49:58 +0100
+
tor (0.2.0.20-rc-1) experimental; urgency=low
* New upstream version.
Modified: tor/branches/tor-0_2_0-patches/debian/tor.init
===================================================================
--- tor/branches/tor-0_2_0-patches/debian/tor.init 2008-03-03 12:17:37 UTC (rev 13817)
+++ tor/branches/tor-0_2_0-patches/debian/tor.init 2008-03-03 12:35:58 UTC (rev 13818)
@@ -89,7 +89,15 @@
fi
}
+check_config () {
+ if ! "$DAEMON --verify-config" > /dev/null; then
+ echo "ABORTED: Tor configuration invalid:" >&2
+ $DAEMON --verify-config >&2
+ exit 1
+ fi
+}
+
case "$1" in
start)
if [ "$RUN_DAEMON" != "yes" ]; then
@@ -109,11 +117,7 @@
check_torpiddir
echo "Starting $DESC: $NAME..."
- if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
- echo "ABORTED: Tor configuration invalid:" >&2
- su -s /bin/sh -c "$DAEMON --verify-config" debian-tor >&2
- exit 1
- fi
+ check_config
start-stop-daemon --start --quiet --oknodo \
--pidfile $TORPID \
@@ -149,11 +153,7 @@
exit 0
fi
- if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
- echo "ABORTED: Tor configuration invalid:" >&2
- su -s /bin/sh -c "$DAEMON --verify-config" debian-tor >&2
- exit 1
- fi
+ check_config
if start-stop-daemon --stop --signal 1 --quiet --pidfile $TORPID --exec $DAEMON
then
@@ -166,11 +166,7 @@
fi
;;
restart)
- if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
- echo "Restarting Tor ABORTED: Tor configuration invalid:" >&2
- su -s /bin/sh -c "$DAEMON --verify-config" debian-tor >&2
- exit 1
- fi
+ check_config
$0 stop
sleep 1
More information about the tor-commits
mailing list