-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interactive sessions always exiting with code 0 #8081
Conversation
a5c7cb3
to
58f0f09
Compare
The issue linked to in the PR description seems to be incorrect BTW. |
26b7826
to
a1c5b99
Compare
a1c5b99
to
1fb30b4
Compare
case *ssh.ExitMissingError: | ||
tc.ExitStatus = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is semantically correct. Must ExitMissingError
imply a failed/non-zero ExitStatus
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the behavior of non interactive sessions: https://github.com/gravitational/teleport/blob/master/lib/client/api.go#L1918
5290e5a
to
7f2d900
Compare
2e1f82e
to
d4bbb01
Compare
d4bbb01
to
00e9299
Compare
* propogate error codes from interactive ssh sessions correctly (#3202)
Removes the call for wait for ssh.Session end to check for errors in web terminal which fixes a regression bug where typing "exit" in web terminal does not return session end event. PR #8081 removed the need to check for errors as it correctly returns exit errors whereas before it returned nil.
Removes the call for wait for ssh.Session end to check for errors in web terminal which fixes a regression bug where typing "exit" in web terminal does not return session end event. PR #8081 removed the need to check for errors as it correctly returns exit errors whereas before it returned nil.
Removes the call for wait for ssh.Session end to check for errors in web terminal which fixes a regression bug where typing "exit" in web terminal does not return session end event. PR #8081 removed the need to check for errors as it correctly returns exit errors whereas before it returned nil.
…8818) Removes the call for wait for ssh.Session end to check for errors in web terminal which fixes a regression bug where typing "exit" in web terminal does not return session end event. PR #8081 removed the need to check for errors as it correctly returns exit errors whereas before it returned nil.
…8816) Removes the call for wait for ssh.Session end to check for errors in web terminal which fixes a regression bug where typing "exit" in web terminal does not return session end event. PR #8081 removed the need to check for errors as it correctly returns exit errors whereas before it returned nil.
Purpose
Correctly propagate error codes from an interactive
tsh ssh
session - fixes #3202Implementation
Wait
on thessh.Session
for interactive sessionsTeleportClient.ExitStatus
if there was anssh.ExitError
orssh.ExitMissingError
returned byrunShell