aboutsummaryrefslogtreecommitdiffstats
path: root/community/tor/tor.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-25 17:05:15 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-25 21:56:02 +0200
commitcd0b52445f8f8a6208e524335f6de9ca0854f94c (patch)
tree814e96d5bf12ed472f986f58129059f8e08ae0a8 /community/tor/tor.initd
parentbd84b03391292e67b44989744a3ff28691fcddeb (diff)
downloadaports-cd0b52445f8f8a6208e524335f6de9ca0854f94c.tar.gz
aports-cd0b52445f8f8a6208e524335f6de9ca0854f94c.tar.bz2
aports-cd0b52445f8f8a6208e524335f6de9ca0854f94c.tar.xz
community/tor: run as unprivileged user
Diffstat (limited to 'community/tor/tor.initd')
-rw-r--r--community/tor/tor.initd6
1 files changed, 4 insertions, 2 deletions
diff --git a/community/tor/tor.initd b/community/tor/tor.initd
index 16faa64bc6..99ec8ae853 100644
--- a/community/tor/tor.initd
+++ b/community/tor/tor.initd
@@ -2,12 +2,14 @@
conffile="/etc/tor/torrc"
pidfile="/run/tor/tor.pid"
-graceful_timeout=${GRACEFUL_TIMEOUT:-60}
+user="${user:-tor}"
+graceful_timeout="${GRACEFUL_TIMEOUT:-60}"
command="/usr/bin/tor"
command_args="-f $conffile"
command_background="yes"
start_stop_daemon_args="
+ --user $user
--chdir /var/lib/tor
--env HOME=/var/lib/tor"
@@ -43,7 +45,7 @@ checkconfig() {
start_pre() {
checkconfig || return 1
- checkpath -d -m 0755 -o tor "$(dirname "$pidfile")"
+ checkpath -d -m 0755 -o "$user" "$(dirname "$pidfile")"
}
gracefulstop() {