Skip to content

Commit 0284a49

Browse files
authored
fix: Correct PYTHONPATH for --sudoers-no-modify (sshuttle#1084)
The previous fix for --sudoers-no-modify in b7e8b7c looks to have dropped removal of `/sshuttle` from dist_packages var, leading to the PYTHONPATH pointing to the sshuttle module directly.
1 parent d6322fd commit 0284a49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sshuttle/sudoers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import getpass
4+
from pathlib import Path
45
from uuid import uuid4
56

67

@@ -10,7 +11,7 @@ def build_config(user_name):
1011
argv0 = os.path.abspath(sys.argv[0])
1112
is_python_script = argv0.endswith('.py')
1213
executable = f"{sys.executable} {argv0}" if is_python_script else argv0
13-
dist_packages = os.path.dirname(os.path.abspath(__file__))
14+
dist_packages = str(Path(os.path.abspath(__file__)).parent.parent)
1415
cmd_alias = f"SSHUTTLE{uuid4().hex[-3:].upper()}"
1516

1617
template = f"""

0 commit comments

Comments
 (0)