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 3, 2024
1 parent c3e594a commit d3fc98f
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 @@ -151,7 +151,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 d3fc98f

Please sign in to comment.