diff options
author | Scott Kuhl <kuhl@mtu.edu> | 2022-02-03 13:42:35 -0500 |
---|---|---|
committer | Scott Kuhl <kuhl@mtu.edu> | 2022-02-03 13:53:39 -0500 |
commit | 0f92735ee596b15283154c95060a6b5ae7156f95 (patch) | |
tree | 967e45aa6a279acf1ece99d411def7894c8c2e0d /sshuttle | |
parent | 3d51bcba95a89b30d593a38b124b10278d2393c7 (diff) |
Make --sudoers option work properly, fix regression in v1.1.0
Commit d6f75fa unintentionally changed the order of some of the
parameters when running the firewall process. This prevented the
--sudoers option from working properly. This patch restores the
previous ordering.
Most discussion was in issue #724. Also fixes #722 and #723.
Diffstat (limited to 'sshuttle')
-rw-r--r-- | sshuttle/client.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sshuttle/client.py b/sshuttle/client.py index 100d2ba..83b96c7 100644 --- a/sshuttle/client.py +++ b/sshuttle/client.py @@ -205,8 +205,8 @@ class FirewallClient: else: # Linux typically uses sudo; OpenBSD uses doas. However, some # Linux distributions are starting to use doas. - sudo_cmd = ['sudo', '-p', '[local sudo] Password: ']+argvbase - doas_cmd = ['doas']+argvbase + sudo_cmd = ['sudo', '-p', '[local sudo] Password: '] + doas_cmd = ['doas'] # For clarity, try to replace executable name with the # full path. @@ -225,8 +225,13 @@ class FirewallClient: pp_prefix = ['/usr/bin/env', 'PYTHONPATH=%s' % os.path.dirname(os.path.dirname(__file__))] - sudo_cmd = pp_prefix + sudo_cmd - doas_cmd = pp_prefix + doas_cmd + sudo_cmd = sudo_cmd + pp_prefix + doas_cmd = doas_cmd + pp_prefix + + # Final order should be: sudo/doas command, env + # pythonpath, and then argvbase (sshuttle command). + sudo_cmd = sudo_cmd + argvbase + doas_cmd = doas_cmd + argvbase # If we can find doas and not sudo or if we are on # OpenBSD, try using doas first. |