[tor-commits] [nyx/master] Don't use inference resolution if proc is unavailable

atagar at torproject.org atagar at torproject.org
Sat Nov 4 22:38:41 UTC 2017


commit 08dbde23c1b8e9f2415723cb08d882ec7add07c8
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Nov 4 15:27:59 2017 -0700

    Don't use inference resolution if proc is unavailable
    
    Oops. On reflection many platforms (OSX, BSD, etc) lack proc contents so we
    shouldn't attempt to use them when unavailable. Otherwise the connection panel
    will be delayed. Caught thanks to a report on tor-relays at .
---
 nyx/panel/connection.py | 2 --
 nyx/tracker.py          | 9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index ed0ec11..0fb4889 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -17,8 +17,6 @@ import nyx.panel
 import nyx.popups
 import nyx.tracker
 
-import stem.util.log
-
 from nyx import nyx_interface, tor_controller
 from nyx.curses import WHITE, NORMAL, BOLD, HIGHLIGHT
 from nyx.menu import MenuItem, Submenu, RadioMenuItem, RadioGroup
diff --git a/nyx/tracker.py b/nyx/tracker.py
index 8ef928a..a108433 100644
--- a/nyx/tracker.py
+++ b/nyx/tracker.py
@@ -510,10 +510,13 @@ class ConnectionTracker(Daemon):
     # resolution. Otherwise connection resolution by inference is the only game
     # in town.
 
+    self._resolvers = []
+
     if tor_controller().get_conf('DisableDebuggerAttachment', None) == '0':
-      self._resolvers = [CustomResolver.INFERENCE] + connection.system_resolvers()
-    else:
-      self._resolvers = [CustomResolver.INFERENCE]
+      self._resolvers = connection.system_resolvers()
+
+    if stem.util.proc.is_available():
+      self._resolvers = [CustomResolver.INFERENCE] + self._resolvers
 
     stem.util.log.info('Operating System: %s, Connection Resolvers: %s' % (os.uname()[0], ', '.join(self._resolvers)))
 





More information about the tor-commits mailing list