Repository navigation
Conversation
PAM_SYSTEM_ERR (code 4) from pam_sss is a transient infrastructure failure, not a wrong password. It occurs when SSSD's krb5_child process has been killed by its hardcoded 300-second keep-alive timer before the user submits their password — the dead process can no longer receive credentials, so pam_sss returns a system error. Rather than surfacing this as an authentication failure and forcing the user to re-enter their password, detect PAM_SYSTEM_ERR specifically, wait retry_delay milliseconds, and retry pam_authenticate once with the same credentials. The retry uses the autoRetry flag to skip the conv() waitForInput() block since the password is already available. Two new auth:pam config options (both enabled by default): auth:pam:retry_on_error = true # enable/disable the retry auth:pam:retry_delay = 3000 # delay in ms before retrying If the retry also fails, the error is surfaced normally. PAM_AUTH_ERR (wrong password) is never retried. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Author
|
Closing while we investigate a follow-up issue — the retry sometimes fails due to PAM stack interaction (pam_faildelay + pam_sss forward_pass). Will reopen with a proper fix once confirmed working. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On systems using SSSD with Kerberos/IPA authentication (common in enterprise environments), hyprlock frequently requires the user to enter their password twice after long idle periods.
Root cause
When hyprlock locks,
pam_authenticate()is called immediately (necessary for fingerprint auth). This triggers SSSD's Kerberos preauth flow, which spawns akrb5_childsubprocess that contacts the KDC and then waits for the password via a pipe.SSSD's
krb5_child_handler.chas a hardcoded 300-second keep-alive timer for this child process:After 5 minutes, SSSD kills
krb5_child. When the user eventually unlocks,pam_sssattempts to send the password to the now-dead process and returnsPAM_SYSTEM_ERR(code 4). The second attempt spawns a fresh child and succeeds.There is no SSSD configuration option to change this hardcoded timeout.
Solution
Detect
PAM_SYSTEM_ERRspecifically — it is a transient infrastructure failure, never a wrong password — and automatically retrypam_authenticate()once after a short delay using the same credentials. AnautoRetryflag onSPamConversationStatetellsconv()to skipwaitForInput()and return the already-available password immediately.Two new
auth:pamconfig options (both with sensible defaults so no config change is required):PAM_AUTH_ERR(wrong password) is never retried.Behaviour
PAM_SYSTEM_ERRis rare when SSSD is healthyretry_on_error = false: restores previous behaviour exactly🤖 Generated with Claude Code