PAM: Improve error messages and align them with sudo.ws when no tty is available#1592
Open
3v1n0 wants to merge 4 commits into
Open
PAM: Improve error messages and align them with sudo.ws when no tty is available#15923v1n0 wants to merge 4 commits into
3v1n0 wants to merge 4 commits into
Conversation
0759714 to
ef28e5a
Compare
Member
|
Because this is a substantial change, could you open an issue for it as well with an explanation and link it to this PR? Thanks! |
Member
|
Similarly for the other two PR's. We track this project using the issue tracker; e.g. it is used to create the release notes and to categorise and prioritise work; see https://github.com/trifectatechfoundation/sudo-rs/blob/main/CONTRIBUTING.md#working-on-a-bigger-issue. Because the two other PR's already have an extensive description, it's OK to simply refer to them and the problem description doesn't need to be cut-and-pasted, of course :-) Thanks again for your efforts! |
When `/dev/tty` is unavailable, sudo-rs conversation handling could fail in cases where sudo.ws still has a valid fallback path. In particular: - Password prompt: when askpass and a DISPLAY are set - Non hidden conversation without a tty. This made behavior less predictable in headless/no-tty environments and diverged from sudo.ws. Refactor the PAM CLI converser I/O open path to mirror sudo's conversation behavior when `/dev/tty` is unavailable. Add coverage for the new behavior
Following what has been proposed via sudo-project/sudo#540
In case no TTY is available, sudo suggests using `-S` option, while we do not do it in sudo-rs. Use the same logic of sudo.ws here.
The current error does not provide any relevant information to the user, so use the same hint that sudo.ws does. Mimic original sudo commit 516f7296.
ef28e5a to
1a0b28d
Compare
Contributor
Author
|
Ok, issues should be all there now. |
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.
Adjust the logic to pick a TTY and to warn if none is found with sudo.ws
See each commits for details.
Closes: #1595