Skip to content

Conversation

@bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Nov 26, 2025

This is still missing tests.

Fixes #1249
Based on #1346

@bjorn3 bjorn3 added this to the askpass milestone Nov 26, 2025
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.
This makes it slightly easier to add options in the future.
In practice I didn't observe any dangerous fds leaking to the editor
process. Only the sockets used for communication with the parent process
got leaked. The parent process already does not blindly trust writes to
those sockets, so leaking them is fine. Still as a defence-in-depth when
for example a PAM module forgets to close a file, add the missing
mark_fds_as_cloexec anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for -A (askpass) commandline switch

1 participant