diff options
author | Krouton <krouton@hatena.ne.jp> | 2020-11-16 10:36:39 +0900 |
---|---|---|
committer | Krouton <krouton@hatena.ne.jp> | 2020-11-16 10:36:39 +0900 |
commit | 5ff834bd329f7a8e0e548ddba64564d33d0b3ac4 (patch) | |
tree | 034259c645fc192b67d7b733c02b37aac64fc4f7 /sshuttle/client.py | |
parent | 6b75d62d6823ae4894ab72ac5e9c0ff9289bd343 (diff) |
Fix handling OSError in FirewallClient#__init__
Diffstat (limited to 'sshuttle/client.py')
-rw-r--r-- | sshuttle/client.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sshuttle/client.py b/sshuttle/client.py index 671f7b6..3235925 100644 --- a/sshuttle/client.py +++ b/sshuttle/client.py @@ -223,7 +223,6 @@ class FirewallClient: def setup(): # run in the child process s2.close() - e = None if os.getuid() == 0: argv_tries = argv_tries[-1:] # last entry only for argv in argv_tries: @@ -232,16 +231,13 @@ class FirewallClient: sys.stderr.write('[local su] ') self.p = ssubprocess.Popen(argv, stdout=s1, preexec_fn=setup) # No env: Talking to `FirewallClient.start`, which has no i18n. - e = None break - except OSError: - pass + except OSError as e: + log('Spawning firewall manager: %r\n' % argv) + raise Fatal(e) self.argv = argv s1.close() self.pfile = s2.makefile('rwb') - if e: - log('Spawning firewall manager: %r\n' % self.argv) - raise Fatal(e) line = self.pfile.readline() self.check() if line[0:5] != b'READY': |