Repository navigation
Retry fingerprint verification when the reader cannot be claimed - #14965
omarchybot wants to merge 1 commit into
Conversation
A reader that cannot be claimed straight after enrollment (reported on a Validity VFS5011) failed the single verify attempt, so setup ended without configuring PAM and told the user to enroll again, which cannot help. fprintd-verify exits 1 for both a claim failure and a mismatch, so its output tells them apart: a claim failure is retried twice after a pause, and one that persists says the reader could not be opened rather than pointing back at enrollment. Fixes #10091 Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
|
| verify_fingerprint() { | ||
| local attempt status log | ||
|
|
||
| log=$(mktemp) |
There was a problem hiding this comment.
verify_fingerprint removes its temporary log only after verification finishes. If the user presses Ctrl+C during verification or the five-second wait, that cleanup never runs and the log stays in /tmp. Repeated cancelled runs leave more unused files. Register cleanup when the file is created so interrupted runs remove it too.
|
Thanks for the careful VFS5011 handling and the tests. One blocking gap: fprintd-verify 2>&1 | tee "$log"
status=${PIPESTATUS[0]}(and keep the stub printing that line on stdout, or assert against a combined stream in the test). After that this looks ready. |
|
Looked at this at head 8aa3dcb. The diff and the review comments were read on the coordinator. Nothing was run on a worker, and no labels went on. On the stdout/stderr point raised above: fprintd prints the claim failure to stdout, so the Greptile's note holds as described: a Ctrl+C during verification or during the five-second wait leaves the The classification is unsettled, so nothing else was done this run. Two models classify every item. This session's answer was |
omarchy setup security fingerprintrunsfprintd-verifyonce, straight aftersudo fprintd-enroll, and only configures PAM when that one attempt matches. On a Validity VFS5011 (138a:0011) the reporter found the reader cannot be claimed at that moment (failed to claim device: ... Open failed with error: transfer failed), although verification succeeds when run on its own later. Setup then ends with a saved print, no PAM configuration, and a message to enroll again, which cannot help because enrollment was never the problem.fprintd-verifyexits 1 both when it cannot claim the device and when the finger does not match, so the exit status cannot tell them apart; what it prints can. Verification now tees its output to a temporary file, leaving what the user sees on stdout unchanged. When that output says the device could not be claimed, it waits five seconds and tries again, up to three attempts in all. A match configures PAM exactly as before. A mismatch is reported once, without a retry, with the same advice as before. A reader that stays unclaimable gets its own message: the print was enrolled, the reader could not be opened, nothing was configured, and setup should be run again after a wait or a reboot.PAM is still written only after a successful verification, so a reader libfprint cannot drive still leaves the stacks alone. The reporter's other suggestions, a
usbresetof the reader and a udev rule holding it out of autosuspend, are broader changes to how the machine treats the device and are left out; whether waiting is enough on this reader is for the reporter to confirm.test/shell.d/fingerprint-package-test.shcovers a reader that frees up after two failed claims, one that never does, and a plain mismatch.Fixes #10091