[tor-commits] [oonib/master] When specifying UID also drop privs for tor
art at torproject.org
art at torproject.org
Fri Jun 7 23:24:06 UTC 2013
commit 8ebc4dee6a7cbdef9e95e4c2fb8aa25a29adf50f
Author: Arturo Filastò <art at fuffa.org>
Date: Thu Jun 6 20:52:25 2013 +0200
When specifying UID also drop privs for tor
---
oonib/runner.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/oonib/runner.py b/oonib/runner.py
index 81fef38..e66aab1 100644
--- a/oonib/runner.py
+++ b/oonib/runner.py
@@ -32,7 +32,6 @@ class OBaseRunner(object):
_repo_dir = os.path.join(os.getcwd().split('ooni-backend')[0], 'ooni-backend')
-tempfile.tempdir = os.path.join(_repo_dir, 'tmp')
def txSetupFailed(failure):
log.err("Setup failed")
@@ -43,6 +42,7 @@ def setupCollector(tor_process_protocol):
print("Exposed collector Tor hidden service on httpo://%s"
% port.onion_uri)
+ tempfile.tempdir = os.path.join(_repo_dir, 'tmp')
if not os.path.isdir(tempfile.gettempdir()):
os.makedirs(tempfile.gettempdir())
_temp_dir = tempfile.mkdtemp()
@@ -72,6 +72,8 @@ def startTor():
torconfig = TorConfig()
torconfig.SocksPort = config.main.socks_port
+ if config.main.uid:
+ torconfig.User = config.main.uid
if config.main.tor2webmode:
torconfig.Tor2webMode = 1
torconfig.CircuitBuildTimeout = 60
More information about the tor-commits
mailing list