From bc8f233db9ce00480a260e00ad5932cd72df25ab Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 6 Feb 2018 16:39:04 -0500 Subject: [PATCH] Update patch as per the suggestion by @mig5 on https://github.com/micahflee/onionshare/pull/585 Tested on current snapshot, both gui and cli work --- onionshare/onion.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/onionshare/onion.py b/onionshare/onion.py index 6b2a0e77..ce412d79 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -131,7 +131,7 @@ class Onion(object): self.stealth = False self.service_id = None - self.system = platform.system() + self.system = common.get_platform() # Is bundled tor supported? if (self.system == 'Windows' or self.system == 'Darwin') and getattr(sys, 'onionshare_dev_mode', False): @@ -183,7 +183,7 @@ class Onion(object): raise OSError(strings._('no_available_port')) self.tor_torrc = os.path.join(self.tor_data_directory.name, 'torrc') else: - # Linux and Mac can use unix sockets + # Linux, Mac and BSD can use unix sockets with open(common.get_resource_path('torrc_template')) as f: torrc_template = f.read() self.tor_control_port = None @@ -316,8 +316,7 @@ class Onion(object): # guessing the socket file name next if not found_tor: try: - plat = common.get_platform() - if plat == 'Linux' or plat == 'BSD': + if self.system == 'Linux' or self.system == 'BSD': socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid()) elif self.system == 'Darwin': socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())