[tor-commits] [chutney/master] Do not use the system torrc when generating router keys.

teor at torproject.org teor at torproject.org
Tue May 10 16:26:09 UTC 2016


commit 8e4f5cbbca4f0b310bceae88e0a3fd88469124fe
Author: anonym <anonym at riseup.net>
Date:   Mon Apr 25 18:32:13 2016 +0200

    Do not use the system torrc when generating router keys.
    
    Otherwise it may make this step of the configuration fail, e.g. if a
    hidden service is configured system wise.
---
 lib/chutney/TorNet.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 327e1ed..7de5911 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -397,13 +397,14 @@ class LocalNodeBuilder(NodeBuilder):
         """
         datadir = self._env['dir']
         tor = self._env['tor']
+        torrc = self._getTorrcFname()
         cmdline = [
             tor,
             "--quiet",
+            "--ignore-missing-torrc",
+            "-f", torrc,
             "--list-fingerprint",
             "--orport", "1",
-            "--dirserver",
-            "xyzzy 127.0.0.1:1 ffffffffffffffffffffffffffffffffffffffff",
             "--datadirectory", datadir]
         try:
             p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
@@ -417,7 +418,7 @@ class LocalNodeBuilder(NodeBuilder):
             else:
                 raise
         stdout, stderr = p.communicate()
-        fingerprint = "".join(stdout.split()[1:])
+        fingerprint = "".join((stdout.rstrip().split('\n')[-1]).split()[1:])
         if not re.match(r'^[A-F0-9]{40}$', fingerprint):
             print (("Error when calling %r. It gave %r as a fingerprint "
                     " and %r on stderr.")%(" ".join(cmdline), stdout, stderr))



More information about the tor-commits mailing list