Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
6dc368bd
Unverified
Commit
6dc368bd
authored
Sep 22, 2018
by
Brian May
Committed by
GitHub
Sep 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #271 from usabilla/no-sudo-pythonpath
Add --no-sudo-pythonpath option
parents
561b648e
f528bb98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
client.py
sshuttle/client.py
+8
-6
cmdline.py
sshuttle/cmdline.py
+2
-1
options.py
sshuttle/options.py
+8
-0
No files found.
sshuttle/client.py
View file @
6dc368bd
...
...
@@ -183,7 +183,7 @@ class MultiListener:
class
FirewallClient
:
def
__init__
(
self
,
method_name
):
def
__init__
(
self
,
method_name
,
sudo_pythonpath
):
# Default to sudo unless on OpenBSD in which case use built in `doas`
elevbin
=
'sudo'
...
...
@@ -198,10 +198,12 @@ class FirewallClient:
[
'--firewall'
])
if
ssyslog
.
_p
:
argvbase
+=
[
'--syslog'
]
elev_prefix
=
[
part
%
{
'eb'
:
elevbin
,
'pp'
:
python_path
}
elev_prefix
=
[
part
%
{
'eb'
:
elevbin
}
for
part
in
[
'
%(eb)
s'
,
'-p'
,
'[local
%(eb)
s] Password: '
,
'/usr/bin/env'
,
'PYTHONPATH=
%(pp)
s'
]]
'[local
%(eb)
s] Password: '
]]
if
sudo_pythonpath
:
elev_prefix
+=
[
'/usr/bin/env'
,
'PYTHONPATH=
%
s'
%
python_path
]
argv_tries
=
[
elev_prefix
+
argvbase
,
argvbase
]
# we can't use stdin/stdout=subprocess.PIPE here, as we normally would,
...
...
@@ -550,7 +552,7 @@ def main(listenip_v6, listenip_v4,
ssh_cmd
,
remotename
,
python
,
latency_control
,
dns
,
nslist
,
method_name
,
seed_hosts
,
auto_hosts
,
auto_nets
,
subnets_include
,
subnets_exclude
,
daemon
,
to_nameserver
,
pidfile
,
user
):
user
,
sudo_pythonpath
):
if
daemon
:
try
:
...
...
@@ -560,7 +562,7 @@ def main(listenip_v6, listenip_v4,
return
5
debug1
(
'Starting sshuttle proxy.
\n
'
)
fw
=
FirewallClient
(
method_name
)
fw
=
FirewallClient
(
method_name
,
sudo_pythonpath
)
# Get family specific subnet lists
if
dns
:
...
...
sshuttle/cmdline.py
View file @
6dc368bd
...
...
@@ -76,7 +76,8 @@ def main():
opt
.
daemon
,
opt
.
to_ns
,
opt
.
pidfile
,
opt
.
user
)
opt
.
user
,
opt
.
sudo_pythonpath
)
if
return_code
==
0
:
log
(
'Normal exit code, exiting...'
)
...
...
sshuttle/options.py
View file @
6dc368bd
...
...
@@ -310,3 +310,11 @@ parser.add_argument(
(internal use only)
"""
)
parser
.
add_argument
(
"--no-sudo-pythonpath"
,
action
=
"store_false"
,
dest
=
"sudo_pythonpath"
,
help
=
"""
do not set PYTHONPATH when invoking sudo
"""
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment