Repository navigation
Propagate exit's status so Cockpit accepts ash as a login shell - #31
Merged
Merged
Conversation
Cockpit decides whether a login shell is usable by running `<shell> -c "exit 71;"` and accepting only exit status 71; anything else is reported at login as "unsupported shell" (issue #30). ash intercepted `exit` to break out of the REPL/-c loop but always exited 0, so setting ash as the default shell locked Cockpit out. run_command_line now returns the status alongside the "exiting" flag, and `exit n` follows POSIX rules: keep the last status when no argument is given, use the low eight bits of n otherwise, and report 2 for a non-numeric argument. The interactive REPL hands the same status back too.
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.
Cockpit decides whether a login shell is usable by running
<shell> -c "exit 71;"and accepting only exit status 71; anything else is reported at login as "unsupported shell" (issue #30). ash interceptedexitto break out of the REPL/-c loop but always exited 0, so setting ash as the default shell locked Cockpit out.run_command_line now returns the status alongside the "exiting" flag, and
exit nfollows POSIX rules: keep the last status when no argument is given, use the low eight bits of n otherwise, and report 2 for a non-numeric argument. The interactive REPL hands the same status back too.