Skip to content
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

fix(pam/nativemodel): Do not report the authentication denied PAM error twice #553

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ invalid password 'wrongpass', should be 'goodpass'
Insert 'r' to cancel the request and go back
Gimme your password:
invalid password 'wrongpass', should be 'goodpass'
invalid password 'wrongpass', should be 'goodpass'
PAM Authenticate() for user "user-integration-max-attempts" exited with error (PAM exit code: 7)
: Authentication failure
acct=incomplete
Expand All @@ -294,6 +293,7 @@ dispatch




────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-integration-max-attempts
Expand All @@ -316,7 +316,6 @@ invalid password 'wrongpass', should be 'goodpass'
Insert 'r' to cancel the request and go back
Gimme your password:
invalid password 'wrongpass', should be 'goodpass'
invalid password 'wrongpass', should be 'goodpass'
PAM Authenticate() for user "user-integration-max-attempts" exited with error (PAM exit code: 7)
: Authentication failure
acct=incomplete
Expand All @@ -327,4 +326,5 @@ dispatch




────────────────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ invalid password 'wrongpass', should be 'goodpass'
Insert 'r' to cancel the request and go back
Gimme your password:
invalid password 'wrongpass', should be 'goodpass'
invalid password 'wrongpass', should be 'goodpass'
PAM ChangeAuthTok() for user "user-integration-max-attempts" exited with error (PAM exit code: 7
): Authentication failure
acct=incomplete
Expand All @@ -294,6 +293,7 @@ dispatch




────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK} force_native_client=true
Username: user-integration-max-attempts
Expand All @@ -316,7 +316,6 @@ invalid password 'wrongpass', should be 'goodpass'
Insert 'r' to cancel the request and go back
Gimme your password:
invalid password 'wrongpass', should be 'goodpass'
invalid password 'wrongpass', should be 'goodpass'
PAM ChangeAuthTok() for user "user-integration-max-attempts" exited with error (PAM exit code: 7
): Authentication failure
acct=incomplete
Expand All @@ -327,4 +326,5 @@ dispatch




────────────────────────────────────────────────────────────────────────────────
5 changes: 4 additions & 1 deletion pam/internal/adapter/nativemodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,11 @@ func (m nativeModel) Update(msg tea.Msg) (nativeModel, tea.Cmd) {
case brokers.AuthNext:
m.uiLayout = nil
return m, maybeSendPamError(m.sendInfo(authMsg))
case brokers.AuthDenied, brokers.AuthRetry:
case brokers.AuthRetry:
return m, maybeSendPamError(m.sendError(authMsg))
case brokers.AuthDenied:
// This is handled by the main authentication model
return m, nil
case brokers.AuthCancelled:
return m, sendEvent(isAuthenticatedCancelled{})
default:
Expand Down
Loading