mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-08 00:54:06 +01:00
Merge pull request #727 from skuhl/fix-sudoers-in-1.1.0
Make --sudoers option work properly, fix regression in v1.1.0
This commit is contained in:
commit
c783fdb472
@ -205,8 +205,8 @@ class FirewallClient:
|
|||||||
else:
|
else:
|
||||||
# Linux typically uses sudo; OpenBSD uses doas. However, some
|
# Linux typically uses sudo; OpenBSD uses doas. However, some
|
||||||
# Linux distributions are starting to use doas.
|
# Linux distributions are starting to use doas.
|
||||||
sudo_cmd = ['sudo', '-p', '[local sudo] Password: ']+argvbase
|
sudo_cmd = ['sudo', '-p', '[local sudo] Password: ']
|
||||||
doas_cmd = ['doas']+argvbase
|
doas_cmd = ['doas']
|
||||||
|
|
||||||
# For clarity, try to replace executable name with the
|
# For clarity, try to replace executable name with the
|
||||||
# full path.
|
# full path.
|
||||||
@ -225,8 +225,13 @@ class FirewallClient:
|
|||||||
pp_prefix = ['/usr/bin/env',
|
pp_prefix = ['/usr/bin/env',
|
||||||
'PYTHONPATH=%s' %
|
'PYTHONPATH=%s' %
|
||||||
os.path.dirname(os.path.dirname(__file__))]
|
os.path.dirname(os.path.dirname(__file__))]
|
||||||
sudo_cmd = pp_prefix + sudo_cmd
|
sudo_cmd = sudo_cmd + pp_prefix
|
||||||
doas_cmd = pp_prefix + doas_cmd
|
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
|
# If we can find doas and not sudo or if we are on
|
||||||
# OpenBSD, try using doas first.
|
# OpenBSD, try using doas first.
|
||||||
|
Loading…
Reference in New Issue
Block a user