Skip to content

Commit

Permalink
Treat conversation error as authentication failure
Browse files Browse the repository at this point in the history
On FreeBSD PAM returns a conversation error when there is nowhere to
read the password from.
  • Loading branch information
bjorn3 committed Dec 16, 2024
1 parent 491e667 commit cbf0296
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sudo/pam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub fn attempt_authenticate<C: Converser>(
}

// there was an authentication error, we can retry
Err(PamError::Pam(PamErrorType::AuthError, _)) => {
Err(PamError::Pam(PamErrorType::AuthError | PamErrorType::ConversationError, _)) => {
max_tries -= 1;
if max_tries == 0 {
return Err(Error::MaxAuthAttempts(current_try));
Expand Down

0 comments on commit cbf0296

Please sign in to comment.