-
Notifications
You must be signed in to change notification settings - Fork 137
Propagate all error kinds from pam::converse not just timeouts #1346
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
base: main
Are you sure you want to change the base?
Conversation
779da35 to
ac1f3bf
Compare
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.
The one thing I'm looking at is the capitalization of error messages. In the main error module I think we go for "lower case" (as ogsudo), but the PAM module capitalizes error messages. We should probably make this consistent, but I feel that is better handled as part of the main l10n work. (Which I do think this PR probably also helps with). I.e. that can be left as-is in this PR.
But, Is it possible to write a compliance test for this? E.g. read the password from stdin, make sure there is nothing on stdin, and then verifying that both ogsudo and sudo-rs only give one error message?
og-sudo gives multiple error messages: without tty while |
What I'm particularly interested in, this PR changes behaviour, and it would be nice to have a e2e-test (or preferably: a compliance test) for that; I'm guessing that right now we give something like "Maximum 3 incorrect authentication attempts" in the This can then act as a regression test going forward. |
|
Needless to say the rest of the changes LGTM. |
|
Turns out the EOF handling was incorrect. It only worked for literal ctrl-d, not for a broken pipe. Pushed a commit to fix this and update all tests. |
2910eee to
654a8c5
Compare
This way they rather than silently discarding the error message and doing another authentication attempt, they properly report the error message and cause sudo to exit. This way for example pam_faillock won't cause a persistent error like incorrect SUDO_ASKPASS value (once implemented) to be treated as multiple successive failed password attempts.
For example a timeout or ctrl+d. In addition don't allow PAM to ask for another password when an input error happened. We will still retry if the password that was entered was incorrect of course. This matches the behavior of og sudo.
654a8c5 to
e48db36
Compare
This way they rather than silently discarding the error message and doing another authentication attempt, they properly report the error message and cause sudo to exit. This way for example pam_faillock won't cause a persistent error like incorrect SUDO_ASKPASS value (once implemented) to be treated as multiple successive failed password attempts.