[Pkg-privacy-commits] [onionshare] 61/256: Guess the default socket file path for new versions of Tor Browser in OS X
Ulrike Uhlig
ulrike at moszumanska.debian.org
Fri May 26 12:53:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch master
in repository onionshare.
commit d069cc2a29d7a80273fc2c02d755a89de2d5b0fe
Author: Micah Lee <micah at micahflee.com>
Date: Fri Jan 6 11:46:41 2017 -0800
Guess the default socket file path for new versions of Tor Browser in OS X
---
onionshare/onion.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/onionshare/onion.py b/onionshare/onion.py
index a8f6d4e..483d019 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -108,6 +108,7 @@ class Onion(object):
if self.settings.get('connection_type') == 'automatic':
# Automatically try to guess the right way to connect to Tor Browser
+ p = platform.system()
# Try connecting to control port
found_tor = False
@@ -131,11 +132,19 @@ class Onion(object):
except:
pass
+ # If this still didn't work, try guessing the default socket file path
+ socket_file_path = ''
+ if not found_tor:
+ if p == 'Darwin':
+ socket_file_path = os.path.expanduser('~/Library/Application Support/TorBrowser-Data/Tor/control.socket')
+
+ self.c = Controller.from_socket_file(path=socket_file_path)
+ found_tor = True
+
# If connecting to default control ports failed, so let's try
# guessing the socket file name next
if not found_tor:
try:
- p = platform.system()
if p == 'Linux':
socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())
elif p == 'Darwin':
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list