Improve error messages related to sshuttle server. (#580)
* 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.
Showing
Please register or sign in to comment