• Scott Kuhl's avatar
    Improve consistency of PATH, environments, and which() · 68c9c9bb
    Scott Kuhl authored
    This patch attempts to fix (or aid in debugging) issue #350.
    
    sshuttle didn't explicitly search /sbin and /usr/sbin and they may be
    missing in the user's PATH. If PATH is missing, these folders wouldn't
    be searched either. There was also a program_exists function which is
    redundant to which(). This consolidates everything into the helpers.py
    file.
    
    This patch introduces get_path() to return PATH + some extra hardcoded
    paths. A new get_env() function can be called to create a consistent
    environment when calling external programs. The new which() wrapper
    function also ensures we use the same set of paths.
    
    If -vv is supplied, messages clearly indicate the programs we are
    looking for, if they are found, and where we looked if we failed to
    find them.
    
    I haven't tested the changes to ipfw or pf.
    68c9c9bb
Name
Last commit
Last update
.github/workflows Loading commit data...
bin Loading commit data...
docs Loading commit data...
sshuttle Loading commit data...
tests Loading commit data...
.gitignore Loading commit data...
.prospector.yml Loading commit data...
CHANGES.rst Loading commit data...
LICENSE Loading commit data...
MANIFEST.in Loading commit data...
README.rst Loading commit data...
bandit.yml Loading commit data...
requirements-tests.txt Loading commit data...
requirements.txt Loading commit data...
run Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...