[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [oonib/master] Create tmp directory for tor only after having shed privs



commit 7bf37f8571f66665bc6bb5683149baca791c0d4e
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Jun 6 20:21:37 2013 +0200

    Create tmp directory for tor only after having shed privs
---
 oonib/runner.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/oonib/runner.py b/oonib/runner.py
index c3b57b0..81fef38 100644
--- a/oonib/runner.py
+++ b/oonib/runner.py
@@ -33,9 +33,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')
-if not os.path.isdir(tempfile.gettempdir()):
-    os.makedirs(tempfile.gettempdir())
-_temp_dir = tempfile.mkdtemp()
 
 def txSetupFailed(failure):
     log.err("Setup failed")
@@ -46,6 +43,10 @@ def setupCollector(tor_process_protocol):
         print("Exposed collector Tor hidden service on httpo://%s"
               % port.onion_uri)
 
+    if not os.path.isdir(tempfile.gettempdir()):
+        os.makedirs(tempfile.gettempdir())
+    _temp_dir = tempfile.mkdtemp()
+
     if config.main.tor_datadir is None:
         log.warn("Option 'tor_datadir' in oonib.conf is unspecified!")
         log.msg("Creating tmp directory in current directory for datadir.")



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits