Skip to content

Let fingerprint setup adopt an already-enrolled print - #13467

Open
AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:fix/fingerprint-setup-existing-print
Open

AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:fix/fingerprint-setup-existing-print

Conversation

@AnPod

@AnPod AnPod commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

omarchy setup security fingerprint only called setup_pam_config/setup_lock_fingerprint_pam from the enroll-success branch, and fprintd-enroll exits non-zero for a finger that already has a print (enroll-duplicate) (#13433). So a machine with a print enrolled but no PAM configuration could never recover from the wizard: every re-run died at the enroll step and exited 1 before writing anything, leaving the enrolled print unusable for sudo, polkit, and the lock screen. (omarchy-remove-security-fingerprint doesn't run fprintd-delete, so even remove-then-setup lands back on enroll-duplicate.)

The wizard now checks fprintd-list $USER up front: a print that is already enrolled skips straight to verify + PAM setup; the fresh-enroll path is unchanged.

Fixes #13433

Testing

  • bash -n passes; the wizard has no shell.d coverage today (it needs live fprintd/reader + writes to /etc/pam.d via sudo).
  • Dry behavior: prints present → 'A fingerprint is already enrolled … skipping enrollment' → verify → PAM written; no prints → unchanged flow; enroll failure still exits 1.

PAM configuration only ran from the enroll-success branch, but
fprintd-enroll exits non-zero when the finger already has a print
(enroll-duplicate). A machine that enrolled but never got its PAM stacks
written could never recover through the wizard: every re-run died at
enroll before reaching setup_pam_config. Check fprintd-list up front and
skip straight to verify + PAM when a print exists.

Fixes omacom#13433
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro. The approach is right (check for an existing print up front, then go straight to verify and PAM), but the check never matches, so this does not fix #13433.

bin/omarchy-setup-security-fingerprint looks for has [0-9]+ fingerprints? enrolled in the output of fprintd-list. fprintd never prints that. On a worker with fprintd 1.94.5-2 (the version in #13433), the only user-facing strings in the fprintd-list binary are Fingerprints for user %s on %s (%s):, - #%d: %s (one line per enrolled finger) and User %s has no fingers enrolled for %s.. With a print enrolled, enrolled stays false, the wizard runs fprintd-enroll, gets enroll-duplicate and exits 1 before writing PAM, exactly as on quattro. (enrolled is also assigned but never read after that.) I checked the binary's strings on the worker and read the code. I didn't run the wizard, since the strings alone settle it.

Two other open pull requests fix the same issue, and both match the real - #N: entry lines: #13542 and #13612. Codex Medium compared all three separately from me. It reached the same conclusion about this one and judged #13542 the best of the three: it has the same shape as this PR with working detection, adds no prompt, and when an existing print fails verification it tells the user to run fprintd-delete before running setup again. #13612 also works but adds a gum confirm prompt and broader fallback behaviour. That reviewer could read my notes, so its agreement isn't a guaranteed independent check.

Choosing among competing fixes is up to the maintainer, so this is waiting on them. I'd suggest #13542 over this PR.

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 cannot configure PAM once a print is already enrolled

2 participants