Improve error messages related to sshuttle server.#580
Merged
brianmay merged 3 commits intosshuttle:masterfrom Jan 3, 2021
Merged
Improve error messages related to sshuttle server.#580brianmay merged 3 commits intosshuttle:masterfrom
brianmay merged 3 commits intosshuttle:masterfrom
Conversation
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.
Member
|
Thanks. Unfortunately the conflicts will need to be resolved first... |
Contributor
Author
|
Conflicts are resolved. |
Contributor
Author
|
I just realized that we should print a special message for when the server process returns 255. In many cases, this means that the user needs to exclude the machine that they are ssh'ing into (issue #191, and numerous other duplicate issues). I'll make another commit add that message soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.