Repository navigation
fix(greeter): do not cancel the session on a non-fatal PAM error message - #512
Merged
mmstick merged 1 commit intoAug 25, 2026
Merged
Conversation
greetd delivers PAM_ERROR_MSG as an auth message of type Error, and ipc.rs turned that into Message::Error, which cancels the greetd session. But such a message describes the current attempt, not the end of the conversation: pam_fprintd reports "Failed to match fingerprint" this way and then retries until max-tries is reached. The consequence at the login screen is that a single failed fingerprint press ends the conversation. The greeter reconnects and immediately creates a new session, whose PAM worker calls fprintd's Claim 14 ms later while the previous worker still holds it, so the claim is denied and no fingerprint prompt ever appears again. The previous worker only exits when it next tries to talk to the greeter, which can be arbitrarily far in the future, so delaying the new session does not help either. Per the greetd protocol every auth message has to be acknowledged with PostAuthMessageResponse, and for a non-interactive one the response is None, which is what the Info arm already does. Route the Error message to its own Message::AuthError that shows the text and acknowledges it. Message::Error and the Response::Error path stay as they are, so a failed authentication still cancels the session. Drafted with AI assistance (Claude Code); the change and the measurements behind it were reviewed and tested by me on real hardware. Signed-off-by: chris-010 <10660568+chris-010@users.noreply.github.com>
mmstick
approved these changes
Aug 24, 2026
jacobktm
approved these changes
Aug 24, 2026
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.
One failed fingerprint press at the login screen ends the PAM conversation, and
the fingerprint reader stays unusable until the greeter restarts.
This is a different cause from the two open reports that share the symptom, and
neither is fixed by this change:
locker.rs, a conversation that went stale while the machine slept.before fprintd is ready, and greetd crashes. It needs no user interaction.
own session because it treats a PAM message about the attempt as fatal.
Cause
AuthMessageType::ErrorisPAM_ERROR_MSG— a message about the currentattempt, not the end of the conversation.
pam_fprintdsendsFailed to match fingerprintthat way and keeps going untilmax-triesisreached.
src/greeter/ipc.rsturned it intoMessage::Error, which cancels thegreetd session.
The session created right afterwards then loses the race for the fingerprint
reader: its PAM worker calls fprintd's
Claim14 ms after the cancel, while theprevious worker still holds it, so the claim is denied and no fingerprint prompt
ever appears again.
Delaying the new session does not help. The previous worker keeps the claim until
it next tries to talk to the greeter, which can be arbitrarily far away — in one
measurement 7.76 s, and it was the correct finger that finally woke it, which
the dead worker then consumed instead of logging in.
Change
The message is routed to its own
Message::AuthError, which shows the text andacknowledges it with
PostAuthMessageResponse { response: None }— the samehandling the
Infoarm already uses, as the greetd protocol requires for anon-interactive message.
Message::Errorand theResponse::Errorpath areunchanged, so a genuinely failed authentication still cancels the session.
Testing
ThinkPad T490, Synaptics
06cb:00bd,pam_fprintd max-tries=5, Pop!_OS 24.04.Four greeter sessions: three after logging out, one after a cold boot.
itself after 111 ms and the correct finger logs in. Before the change: reader
dead, password only.
max-triesis exhausted on a single device claim, PAM falls through topam_unix, and the password field appears on its own.Response::Error; the new session gets theclaim and fingerprint login works again.
In all four sessions a single greetd worker served the whole login, and there was
no
Device was already claimedin the journal.Measured on one sensor model; I cannot speak for other readers.