Skip to content

fix(fingerprint): retry verify after enroll settles reader - #10235

Open
kvnloo wants to merge 8 commits into
omacom:quattrofrom
kvnloo:fix/10091-fingerprint-verify-settle
Open

kvnloo wants to merge 8 commits into
omacom:quattrofrom
kvnloo:fix/10091-fingerprint-verify-settle

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • after fprintd-enroll, retry fprintd-verify up to 5× with 0.5s settle
  • PAM still only configured on successful verify

Fixes #10091.

Verification

  • bash -n + mocked retry success / hard-fail paths

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry helps a busy reader after enroll, but it also retries a real verify mismatch up to 5× — user puts the wrong finger, waits ~2.5s, then pam still gets skipped. if fprintd distinguishes busy vs no-match, gate the sleep on that; otherwise maybe 2 tries is enough.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retrying every verify failure 5× punishes a wrong swipe. settle with a short sleep and/or retry only on claim/busy errors from #10091, not on verify-no-match.

@kvnloo
kvnloo force-pushed the fix/10091-fingerprint-verify-settle branch from cc33db0 to bd8fa74 Compare September 22, 2026 22:12
@kvnloo

kvnloo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current quattro (d3cfd53).

Verify retry now settles once, then retries only claim/busy/already-in-use errors; verify-no-match fails immediately. Covered by fingerprint-verify-settle-test.sh.

Tests: bash test/shell.d/fingerprint-verify-settle-test.sh — 3 ok.

@kvnloo

kvnloo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Verified against current quattro (fail-then-pass on scoped shell tests). Ready for maintainer review.

Scoped: fingerprint-verify-settle-test (claim/busy retry only).

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at bd8fa748829f76383f747b803fee6a582ae1a0a8. The code is clean, and it now waits on a hardware confirmation from @m4dmurd0c, who reported #10091.

What was checked

  • verify_fingerprint (bin/omarchy-setup-security-fingerprint:68) runs as the condition of an if, so the script's set -e cannot cut it short. PIPESTATUS[0] is read straight after the pipeline, so tee cannot turn a failed verify into a pass. The temp file is removed on every return.
  • In fprintd 1.94.5 (utils/verify.c), a failed Claim prints failed to claim device: … on stdout and exits 1, so the failed to claim match catches the exact error in omarchy setup security fingerprint aborts before configuring PAM when verify can't claim the reader after enroll (Validity VFS5011) #10091. A wrong finger (verify-no-match) fails on the first try, which settles the earlier review asking for exactly that. glib's g_print flushes after every line, so piping through tee still shows fprintd's prompts as they happen; I checked that on a pipe.
  • Ran on a disposable Omarchy worker: the new fingerprint-verify-settle-test.sh passes on this head, and fails with the script change reverted. ./test/cli and every other fingerprint test pass. Of 251 shell test files, 4 fail (ascii, branding-about-animation, kernel-headers-migration, omarchy-kernel-migration), and they fail the same way on the base, so this PR doesn't cause them.
  • Second opinion from Codex Medium. It found no blocking defect, judged the change proportionate, and agreed that only the affected hardware can prove it. It had my reasoning in front of it, so this is agreement, not independent confirmation.

What it can't show

The test stubs fprintd-verify. It proves the retry logic, not that 0.5s settles plus up to five tries (2.5s of waiting) is long enough for a VFS5011 to free up after enrolling. A worker has no fingerprint reader, so only the affected machine can show that.

@m4dmurd0c, could you run this exact commit on the E550?

curl -fsSL https://raw.githubusercontent.com/kvnloo/omarchy/bd8fa748829f76383f747b803fee6a582ae1a0a8/bin/omarchy-setup-security-fingerprint -o /tmp/omarchy-setup-security-fingerprint
bash /tmp/omarchy-setup-security-fingerprint
grep -r fprintd /etc/pam.d/

Like current quattro, this script installs libfprint-git if it is missing, replacing stock libfprint. Please paste everything printed after "Now let's verify that it's working correctly". If verify keeps failing to claim the device, that output will show the retries running out, which points toward the usbreset you suggested. Please also paste the grep result.

No other open pull request fixes #10091. #13467, #13542 and #13612 change the same verify step for a different case (a print that was already enrolled), so whichever lands second will need a small rebase.

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues remain.

Summary

Adds a short wait after enrollment and retries fingerprint verification up to five times when the reader cannot be claimed.

  • Fingerprint setup retries checks while the reader settles after enrollment.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Enrollment succeeds] --> B[Wait 0.5 seconds]
  B --> C[Verify fingerprint]
  C --> D{Result}
  D -->|Success| E[Configure PAM and lock]
  D -->|Claim failure, attempts remain| B
  D -->|Other failure or fifth claim failure| F[Stop without changing authentication]
Loading

Reviews (4) · Last reviewed commit: "Merge quattro and route the verify retry..." · Reviewed by Greptile

Comment thread bin/omarchy-setup-security-fingerprint Resolved
kvnloo and others added 2 commits October 19, 2026 19:13
Keep default SIGINT behavior and verify cancellation after a bounded verification-start handshake.
omacom#15512 replaced the single fprintd-verify with a pipe through verify_progress, which turns fprintd's results into guidance. The retry now tees into that filter instead of replacing it, so each attempt shows the same guidance and a claim failure is still printed for the user.

The settle test follows setup as quattro now runs it: it stubs the sudo -n check and the busctl reader lookups, so it never reaches the worker's own sudo or system bus, and it expects setup to exit 1 when verification fails, as a1fa8cd made it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot removed the compatibility Make Omarchy work better on everything! label Oct 21, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 6396f76abb75895268df2f46592d8a7de54918c1, then merged current quattro into the branch, since #15512 landed today and rewrote the verify step this pull request changes. The new head is 0ce7c38faa19b49afca4e12d11cb929a9aca16f9. The code is clean. It still waits on a hardware confirmation from @m4dmurd0c, who reported #10091.

What changed in the merge

  • quattro now pipes fprintd-verify through verify_progress, which turns fprintd's results into guidance. verify_fingerprint keeps that: each attempt runs fprintd-verify 2>&1 | tee "$output_file" | verify_progress "$again", so the retry doesn't drop the new guidance, and PIPESTATUS[0] is still fprintd's status.
  • fingerprint-verify-settle-test.sh now matches how quattro runs setup. It stubs the sudo -n check and the busctl reader lookups, so it never reaches the worker's own sudo or system bus. It also expects setup to exit 1 when verification fails, which quattro now does.

What was checked

  • Your commits since the last review (the subshell with its EXIT/TERM traps, and the match narrowed to failed to claim device:) are correct. A wrong finger still fails on the first attempt, and the temp file is removed on SIGINT and SIGTERM.
  • Ran on a disposable Omarchy worker. The settle test passes on the new head (7 of 7). Against quattro's script it fails at the claim failure, after one attempt, the way omarchy setup security fingerprint aborts before configuring PAM when verify can't claim the reader after enroll (Validity VFS5011) #10091 describes. ./test/cli and all ten fingerprint and lock-fingerprint test files pass. Across the full shell suite, 9 of 468 files fail. All 9 fail on quattro too and none involve fingerprint code (ascii, background-instant-reload, background-intro-clone, branding-about-animation, hyprland-startup-cursor-cold, i18n, lock-appear-budget, runtime-smoke, screenshot-sanity).
  • Second opinion from Codex Medium on the merged head. It found no defect, judged the change proportionate, and agreed that only the affected reader can show whether the 0.5s waits are long enough. My conclusions were already written down when it ran, so this is agreement, not independent confirmation.

The other fix for #10091

#14965 fixes the same bug: it waits 5s instead of 0.5s, makes 3 attempts, and prints its own message when the reader never frees up. This pull request is older and catches the same claim failure, so it is the one to carry forward. Codex Medium, asked separately, reached the same answer. #14965 does have one thing worth adopting here. When every attempt fails to claim the reader, this pull request still prints "Verification failed. You may want to try enrolling again", which is the advice #10091 says cannot help. #14965 says instead that the print was enrolled, the reader could not be opened, and nothing was configured. That message is to be folded in from #14965's side.

Waiting on

@m4dmurd0c, could you run this exact commit on the E550? It calls omarchy-apply-lock, which Omarchy 4.0.4 and later have, so update first if you're still on 4.0.2:

curl -fsSL https://raw.githubusercontent.com/kvnloo/omarchy/0ce7c38faa19b49afca4e12d11cb929a9aca16f9/bin/omarchy-setup-security-fingerprint -o /tmp/omarchy-setup-security-fingerprint
bash /tmp/omarchy-setup-security-fingerprint
grep -r fprintd /etc/pam.d/

Like quattro, it installs libfprint-git if it is missing, and it only adds PAM lines that are missing, so your hand-made ones stay. Please paste everything printed after "Now let's verify that it's working correctly", plus the grep result. Each failed claim prints a failed to claim device: line, so the output shows how many attempts it took, or that all five failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy setup security fingerprint aborts before configuring PAM when verify can't claim the reader after enroll (Validity VFS5011)

3 participants