• Scott Kuhl's avatar
    Improve error messages related to sshuttle server. (#580) · b7730fc1
    Scott Kuhl authored
    * Improve error messages related to sshuttle server.
    
    There are many GitHub issues related to the cryptic message:
    fatal: expected server init string 'SSHUTTLE0001'; got b''
    
    The code that prints that message is after another check that is
    intended to verify that the server is still running. This code was
    faulty since the server is still running when rv==None (but exited
    when rv==0).
    
    I corrected this problem and then investigated ways to clarify the
    error message. I added additional exit codes for the server: 97 (exec
    in the shell returned), 98 (the python exec() function called
    returned). The end result is that the cryptic error message above will
    now print a more appropriate error message that should aid in
    debugging.
    
    I also changed the server so that it catches Fatal() and exits with
    exit code 99 (like the client does). Previously, it was just an
    unhandled exception on the server.
    
    I suspect some of the error messages were caused by restricted shells.
    I also investigated and added comments about how sshuttle might behave
    if it is being run on a server that has a restricted shell.
    
    This commit also replaces a couple of exit() calls in cmdline.py with
    'return' since exit() is intended for interactive use. This change
    doesn't impact the server.
    
    * Remind user to exclude remote host when server exits with 255.
    b7730fc1
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...