Skip to content

Finish fingerprint setup when a print is already enrolled - #13542

Open
stevederico wants to merge 15 commits into
omacom:quattrofrom
stevederico:fix/fingerprint-setup-enrolled
Open

stevederico wants to merge 15 commits into
omacom:quattrofrom
stevederico:fix/fingerprint-setup-enrolled

Conversation

@stevederico

@stevederico stevederico commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

omarchy setup security fingerprint stops at "Enrollment failed" when your finger is already saved under another finger name, so sudo, polkit and the lock screen never get fingerprint auth. Refs #13433

Before: fprintd answers enroll-duplicate, and setup only configures PAM after a fresh enroll.
After: when a print is already saved on fprintd's default reader, setup skips enrolling, verifies it, then sets up sudo, polkit and the lock screen. A failed verify prints how to delete prints (fprintd-list $USER, fprintd-delete $USER -f <finger>). If fprintd can't be asked, setup stops instead of treating it as no prints.

How I tested

  • bash test/shell.d/fingerprint-setup-enrolled-test.sh passes (10 ok) and fails with the fix reverted. fingerprint-package-test.sh passes and no longer reads the host's fprintd
  • omarchybot reproduced it with real fprintd 1.94.5 and libfprint's virtual reader, before and after (see its review). No reader on my machine

Refs, not Fixes: a finger saved for another account (the case in #13433's output) still ends at "Enrollment failed". #13467's check never matches real fprintd-list output. #13612 adds a confirm prompt.

@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: A new print that fails verification still gets "try enrolling again", which a rerun now skips.

Fresh print that fails verification gets the old advice

The fprintd-delete advice is printed only when already_enrolled is true, so a print enrolled in this run gets the old message. Impact: the rerun only re-verifies that print; the useful advice comes after a second failure.

Suggested change: merge the elif $already_enrolled and else branches so every verification failure gets the fprintd-delete advice.

Reproducer (fails at 2b24db0)

Reproducer: fresh enrollment that fails verification still says "try enrolling again"

Reviewed head: 2b24db055dbf71cb5e152d3f131f36481ebda988. Merge-base: 97a9fce54f5df007afe7b8637ddc09314f38ad00.

A test in the PR's own style. The stubbed fprintd-list reports whatever the stubbed fprintd-enroll stored, as fprintd does. First run: nothing enrolled, enrollment works, fprintd-verify fails. Second run: the print from the first run is still there, so setup skips enrollment. The test fails if the first run's advice does not say how to enroll again under those conditions.

Save as test/shell.d/fingerprint-setup-rerun-test.sh and run from the repository root:

bash test/shell.d/fingerprint-setup-rerun-test.sh
#!/bin/bash
#
# A print that fresh enrollment stored is still enrolled when its verification
# fails, so the next run of setup skips enrollment. The advice printed after
# that failure has to work on the next run.

set -euo pipefail

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

setup="$ROOT/bin/omarchy-setup-security-fingerprint"
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
mkdir -p "$scratch/bin"
export CALL_LOG="$scratch/calls"
export PRINTS="$scratch/prints"
export PATH="$scratch/bin:$ROOT/bin:$PATH"

stub() {
  printf '#!/bin/bash\n%s\n' "$2" > "$scratch/bin/$1"
  chmod +x "$scratch/bin/$1"
}

stub sudo '[[ $1 == fprintd-enroll ]] && exec "$@"; printf "sudo %s\n" "$*" >> "$CALL_LOG"'
stub omarchy-hw-fingerprint 'exit 0'
stub omarchy-pkg-missing 'exit 1'
# Like fprintd, list what an earlier fprintd-enroll stored.
stub fprintd-list 'if [[ -e $PRINTS ]]; then printf "Fingerprints for user %s on Validity VFS5011 (swipe):\n - #0: right-index-finger\n" "$1"; else printf "User %s has no fingers enrolled for Validity VFS5011.\n" "$1"; fi'
stub fprintd-enroll 'echo "fprintd-enroll $*" >> "$CALL_LOG"; touch "$PRINTS"'
stub fprintd-verify 'echo "fprintd-verify" >> "$CALL_LOG"; exit 1'

run_setup() {
  : > "$CALL_LOG"
  USER=tester bash "$setup" > "$scratch/out" 2>&1 || true
}

# First run: nothing enrolled, enrollment works, verification fails.
run_setup
grep -qx 'fprintd-enroll tester' "$CALL_LOG" || fail "the first run enrolls" "$(<"$CALL_LOG")"
first_run=$(sed 's/\x1b\[[0-9;]*m//g' "$scratch/out")

# Second run: does setup enroll again, as the first run's advice suggests?
run_setup
if ! grep -q '^fprintd-enroll' "$CALL_LOG" && ! grep -q 'fprintd-delete tester' <<< "$first_run"; then
  fail "a fresh print that fails to verify says how to enroll again" \
    "first run said: $(grep -i 'verification failed' <<< "$first_run")
second run calls: $(tr '\n' ' ' < "$CALL_LOG")"
fi
pass "a fresh print that fails to verify says how to enroll again"

Actual output at 2b24db0 (exit 1, stderr)

first run said: Verification failed. You may want to try enrolling again.
second run calls: fprintd-verify 
not ok - a fresh print that fails to verify says how to enroll again

Actual output at the merge-base 97a9fce (exit 0)

ok - a fresh print that fails to verify says how to enroll again

(At the merge-base the second run enrolls again, so the old advice was accurate there.)

With the suggested change

Replacing the elif $already_enrolled; then ... else ... fi tail with one else branch that always prints the fprintd-delete $USER advice:

-elif $already_enrolled; then
-  # Rerunning setup would skip enrollment again while that print exists.
+else
+  # Rerunning setup skips enrollment while any print exists, including the one
+  # this run may just have enrolled.
   echo -e "\e[31m\nVerification failed. To enroll again, remove the saved fingerprints with\e[0m"
   echo -e "\e[31mfprintd-delete $USER, then run this setup again.\e[0m"
-else
-  echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m"
 fi

this reproducer prints ok - a fresh print that fails to verify says how to enroll again (exit 0), and the PR's test/shell.d/fingerprint-setup-enrolled-test.sh still prints its four ok lines (exit 0).

Package test runs the host's fprintd-list

fingerprint-package-test.sh does not stub fprintd-list, which setup now calls before enrolling. Impact: it fails wherever the current user has a print enrolled.

Suggested change: add an fprintd-list stub that prints User $1 has no fingers enrolled for Test Sensor..

Reproducer (fails at 2b24db0)

Reproducer: fingerprint-package-test.sh now depends on the host's fprintd-list

Reviewed head: 2b24db055dbf71cb5e152d3f131f36481ebda988. Merge-base: 97a9fce54f5df007afe7b8637ddc09314f38ad00.

test/shell.d/fingerprint-package-test.sh runs the real setup script with stubs for sudo, pacman, fprintd-enroll and fprintd-verify, but not fprintd-list. The PR's setup now calls fprintd-list "$USER" before enrolling, so the test reaches whatever fprintd-list is on the developer's PATH. This script stands in for a machine where the current user already has a print enrolled, by putting an fprintd-list that prints fprintd's enrolled format behind the test's own stub directories. Run from the repository root:

#!/bin/bash
# Run from the repository root. Stands in for a machine where the current user
# already has a print enrolled: fprintd-list reports it in fprintd's format.
set -euo pipefail
host=$(mktemp -d)
trap 'rm -rf "$host"' EXIT
cat > "$host/fprintd-list" <<'STUB'
#!/bin/bash
printf 'Fingerprints for user %s on Test Sensor (press):\n - #0: right-index-finger\n' "$1"
STUB
chmod +x "$host/fprintd-list"
PATH="$host:$PATH" bash test/shell.d/fingerprint-package-test.sh

Actual output at 2b24db0 (exit 1, stderr)

not ok - setup stops on the simulated enrollment or installation failure

Setup took the new already-enrolled path, skipped the stubbed fprintd-enroll, got a failure from the stubbed fprintd-verify, printed the fprintd-delete advice and exited 0, which the test treats as a failure.

Actual output at the merge-base 97a9fce (exit 0)

ok - a fresh machine installs libfprint-git and reaches enrollment
ok - installed stock libfprint is replaced without a removal step
ok - a rerun with everything installed goes straight to enrollment
ok - a failed installation stops before enrollment
ok - missing hardware performs no package operations

With the suggested change

Adding an fprintd-list stub to test/shell.d/fingerprint-package-test.sh:

@@ -45,6 +45,10 @@
   *) printf 'pacman %s\n' "$*" >> "$CALL_LOG"; exit 99 ;;
 esac
 STUB
+cat > "$scratch/bin/fprintd-list" <<'STUB'
+#!/bin/bash
+echo "User $1 has no fingers enrolled for Test Sensor."
+STUB
 cat > "$scratch/bin/fprintd-enroll" <<'STUB'
 #!/bin/bash
 # Stop before verification/PAM; no host authentication files may be changed.

the same script prints the five ok lines above at 2b24db0 (exit 0).

More findings

The enroll-duplicate premise does not match fprintd's source (not reproduced)

Since fprintd 1.92.0 (commit f398d09, "device: Delete existing print in EnrollStart"), EnrollStart deletes the same user's existing print for the requested finger before its duplicate check (src/device.c:2203-2220 in 1.94.5). So a right-index print left by an earlier sudo fprintd-enroll "$USER" does not by itself cause enroll-duplicate: fprintd deletes it and enrolls the finger again. enroll-duplicate needs the scanned finger to match a different stored print, for example:

  • the same finger stored for $USER under another finger name: fprintd-list "$USER" lists it, so this PR fixes that case;
  • the same finger stored for another account on the same reader: fprintd-list "$USER" shows nothing, and setup still ends at "Enrollment failed".

The output quoted in #13433 came from fprintd-enroll right-index-finger, which fprintd reads as a username (-f selects the finger). Source reading only; not run against fprintd or hardware.

Suggested change: reword the code comment at bin/omarchy-setup-security-fingerprint:92-94 (and the PR description) to describe when fprintd reports enroll-duplicate, and if possible confirm with the output of the setup's own sudo fprintd-enroll "$USER" on the affected machine.

Details

Verified (sandboxed tests with stubbed fprintd and sudo):

  • With a print listed by fprintd-list, setup skips fprintd-enroll, runs fprintd-verify and writes PAM; with none listed, it still enrolls.
  • A failed enrollment still exits 1 before any PAM change.
  • The new test fails when copied onto the merge-base (not ok - an enrolled print is not enrolled again) and passes at the head (4 ok).
  • ^ *- #[0-9]+: matches only the entry lines of fprintd 1.94.5 utils/list.c, whose output is not translated. The has [0-9]+ fingerprints? enrolled pattern in Let fingerprint setup adopt an already-enrolled print #13467 never matches it.

Optional test improvement: the positive cases only check sudo tee /etc/pam.d/omarchy-lock-fingerprint, so deleting the setup_pam_config call on the verify-success branch still passes all four cases (sudo and polkit PAM never checked). Running setup from a copy with /etc/pam.d/ pointed at a scratch stack, as security-fingerprint-remove-test.sh does, allows asserting the sudo and polkit-1 edits too; that version caught the mutant.

Related open PRs: #13467 fixes the same issue and edits the same lines, so only one of the two can apply as is. #13612 also targets #13433 and adds a similar fprintd-list stub to the package test.


Review information

Test scope: Source (including fprintd 1.94.5) and sandboxed tests with stubbed fprintd and sudo, at 2b24db05; not tested on hardware.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects fingerprint setup and the sign-in options it configures.

The code appears sound, but the test cases must be combined with the existing file before merging to meet repository requirements.

Findings

  1. P2 Fingerprint tests duplicate existing setup ▶

Summary

Setup now checks for saved fingerprints on the default reader and verifies an existing print instead of enrolling it again.

  • Fingerprint setup verifies a saved print before enabling sudo, polkit, and the lock screen.

Reviews (12) · Last reviewed commit: "Stub the platform enable hook in the enr..." · Reviewed by Greptile

Comment thread bin/omarchy-setup-security-fingerprint Resolved
Comment thread bin/omarchy-setup-security-fingerprint Resolved
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro and reproduced with the real fprintd. The fix works, and I pushed two small commits on top.

Reproduction. On a worker I ran fprintd 1.94.5 and libfprint-git 1.94.100 (the versions in #13433) with libfprint's virtual image reader, which matches prints the way a VFS5011 does, and ran the setup script itself with only the hardware check stubbed. With a print saved under left-index-finger, quattro gets Enroll result: enroll-duplicate, prints "Enrollment failed" and writes no PAM. This branch finds the print, verifies it and configures sudo, polkit and the lock screen. A fresh machine still enrolls and configures PAM on both.

What actually triggers enroll-duplicate. The cause is narrower than the description says. fprintd deletes a print saved under the same finger name before enrolling, so with a right-index-finger print already saved, quattro just enrolls it again and finishes setup. fprintd only refuses when the scanned finger matches a print saved under a different finger name, or for a different user. This PR fixes the first case. The second (another account on the machine holds that finger, and $USER has nothing saved) still ends at "Enrollment failed" here, on quattro, and with #13467 and #13612 too. The output in #13433 came from fprintd-enroll right-index-finger, which fprintd reads as a username, so it is that second case.

Pushed:

  • 07a76db7 Every failed verification now prints the fprintd-delete advice. A print enrolled in the same run stays saved when verification fails, so a rerun skips enrollment, and "try enrolling again" sent the user round the same loop. The code comment and the test header now describe when fprintd reports enroll-duplicate, and the new test covers a fresh print that fails verification.
  • 32c21d3b fingerprint-package-test.sh stubs fprintd-list. Without the stub it read the host's fprintd and failed for anyone with a print enrolled; I checked that on the worker with a real saved print.

Tests. On the worker, all six fingerprint test files pass at 32c21d3b (the new one with 5 cases). In the full ./test/cli and ./test/shell run, the same seven tests fail on quattro and on this branch (a vscode theme test in ./test/cli; logo width and animation, linux-omarchy headers, browser launcher, network portal and a pre_remove hook in ./test/shell), and none of them touch fingerprint code.

Second opinion. Codex Medium reviewed the branch with my commits on top. It agreed on when fprintd reports enroll-duplicate and that the diff is proportionate. That agreement isn't a guaranteed independent check, since it could read my notes. It also raised a case I hadn't: fprintd-list reports prints on every reader but fprintd-verify uses the default one. On a machine with two readers and a print only on the non-default one, setup skips enrollment and then fails verification. I confirmed that in fprintd's source. It isn't a dead end, because fprintd-delete clears every reader and the failure message now points there, so I left it alone.

Competing fixes. #13467 never detects a saved print (fprintd doesn't print has N fingerprints enrolled), so it doesn't fix #13433. #13612 detects correctly but adds a gum confirm prompt and a second fallback path. Codex compared all three without my answer and also picked this one.

Waiting on the maintainer: choosing between this, #13467 and #13612, and deciding whether the two-reader case matters.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 4, 2026
stevederico and others added 5 commits October 5, 2026 09:44
fprintd-enroll refuses a finger that is already enrolled, so re-running
setup after an earlier run left a print behind always stopped at
"Enrollment failed" and never wrote the PAM stacks. The print existed but
could not be used for sudo, polkit or the lock screen, and no rerun could
fix it.

Check fprintd-list for enrolled prints first and go straight to verify and
PAM when one exists. Match its " - #N:" entry lines: its "no fingers
enrolled" message also contains the word finger.

Fixes omacom#13433
A print enrolled in this run stays saved when its verification fails, so a rerun skips enrollment just as it does for an older print, and "try enrolling again" sent the user round the same loop. The comments now say when fprintd actually reports enroll-duplicate: fprintd 1.94 deletes a print saved under the same finger name before enrolling, and refuses only a finger that matches a print saved under another name.
Setup now asks fprintd-list for saved prints before enrolling, so without a stub the test read the host's fprintd and failed for anyone with a print enrolled.
fprintd-list lists every reader, but fprintd-enroll and fprintd-verify
use fprintd's default one. A print saved only on another reader made
setup skip enrollment and then fail verification. Setup now asks fprintd
for its default reader (GetDefaultDevice over gdbus, which ships with
glib2) and only counts prints listed under that reader's
"Using device" header.

A failed fprintd-list no longer reads as no prints: setup stops before
enrollment and says to check that fprintd is running.

The enrolled-print test redirects /etc/pam.d into its scratch directory
and now checks the sudo and polkit steps as well as the lock screen. New
cases cover a print on a non-default reader, a print on the default of
two readers, and a failed list.
@stevederico
stevederico force-pushed the fix/fingerprint-setup-enrolled branch 2 times, most recently from 18fa2c9 to a8c76eb Compare October 5, 2026 17:08
Comment thread bin/omarchy-setup-security-fingerprint Resolved
stevederico and others added 2 commits October 7, 2026 10:28
A failed verification pointed at fprintd-delete $USER, which removes every
print the user saved on the reader, not just the one that failed. Since
fprintd-verify accepts any saved finger, the failing one is not known, so
the message now points at fprintd-list to see them and offers
fprintd-delete -f <finger> for one, or the bare command for all.
When omarchy-hw-fingerprint sees a sensor that libfprint cannot drive, fprintd has no devices and GetDefaultDevice fails. Setup treated that as "could not check for saved fingerprints" and told the user to make sure fprintd was running, which it was. No default reader holds no print, so setup now goes on to enrollment, which fails with fprintd's own "No devices available", as it did before the saved-print check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-finger command also contains fprintd-delete tester, so the old
check would still pass if the advice to remove every print went away.
Since verification can't say which finger failed, that line is the one
that reliably starts over, so the test now looks for it separately.
@stevederico
stevederico force-pushed the fix/fingerprint-setup-enrolled branch 2 times, most recently from a9dfed5 to ee5b65a Compare October 7, 2026 17:44
Any failure of the GetDefaultDevice call went on to enrollment, so a bus or activation failure that cleared before fprintd-enroll ran could hide a saved print and bring back enroll-duplicate. Only fprintd's own NoSuchDevice means there is no reader to hold a print; every other failure stops setup like a failed fprintd-list.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 7, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at de5bef17 after the rebase onto quattro and the new commits. The fix works, and I pushed two small commits on top.

Reproduction. Same setup as last time, on a fresh worker: fprintd 1.94.5 and libfprint-git 1.94.100, this time with libfprint's virtual storage reader, running the setup script with only the hardware check stubbed. With a print saved under left-index-finger, quattro gets enroll-duplicate, prints "Enrollment failed" and writes no PAM. This branch verifies the saved print and configures sudo, polkit and the lock screen. With the script reverted to quattro's, it fails again. A machine with no prints still enrolls and configures PAM. When the wrong finger is scanned, setup writes no PAM and prints the new advice. I checked that fprintd-delete $USER -f <finger> removes only that print.

Default reader. a1df827 answers last review's two-reader case. Matching on the Using device header is what fprintd-list actually prints, and Codex found no defect in it.

Pushed:

  • 392f531f and de5bef17. When omarchy-hw-fingerprint finds a sensor libfprint cannot drive (the Elan MOC case the script's comment names), fprintd has no devices. Setup then said "Make sure fprintd is running", which it was. Now fprintd's NoSuchDevice answer goes on to enrollment, which prints fprintd's own "No devices available" and "Enrollment failed", as on quattro. Any other failure to ask fprintd for its default reader still stops setup, the same as a failed fprintd-list, because continuing could miss a saved print and bring back enroll-duplicate. Two new test cases cover each side, and each one fails when its half of the change is reverted. On the worker with fprintd stopped, setup shows "No devices available". With fprintd masked, setup stops with "Could not check".

Tests. On the worker at this head, all four fingerprint test files pass (10 cases in fingerprint-setup-enrolled-test.sh). ./test/cli passes. ./test/shell has 5 failures, and the same 5 fail on quattro. None of them touch fingerprint code: logo width and animation, browser launcher focus, a pre_remove hook, and direct user removal.

Second opinion. Codex Medium reviewed this head over three rounds. It agreed that the missing-reader message was wrong, a problem I had already put in its brief, so that agreement isn't a guaranteed independent check. It found something I hadn't: my first version sent every failed reader lookup on to enrollment, and de5bef17 narrows that to NoSuchDevice. Its last round, on de5bef17, found nothing.

Unchanged. The case in #13433's output, where a finger saved for another account still ends at "Enrollment failed", is still not fixed. That is why this PR says Refs and not Fixes. A failed verification still exits 0, as it does on quattro.

Waiting on CI to finish at this head, then on the maintainer to choose between this, #13467 and #13612.

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 7, 2026
omarchybot and others added 2 commits October 21, 2026 16:05
quattro now guides enrollment and verification through enroll_progress and verify_progress, authenticates sudo before enrolling, and fails setup on a failed verify. The enrolled-print check keeps its place before enrollment: the scan-type prompts are worked out before the branch, so the verify step of an already-enrolled print gets the same prompt and result filter, while the sudo step and the enrollment instructions stay with enrollment. A failed verify keeps the fprintd-delete advice and now exits non-zero, as quattro's does.

The enrolled-print test stubs busctl so the reader lookups never reach the host's fprintd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
assert_pam_untouched only rejected the polkit tee, so a sudo sed before verification passed it, and the fresh-print verify failure ignored the exit status quattro now makes non-zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 21, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Brought up to date with quattro at 940783af. Since the last review, quattro rewrote this script's enrollment and verification: guided steps, sudo authenticated first, and a failed verify now fails setup. That left this branch conflicting, so I merged quattro into it.

Pushed:

  • dd59b416 merges quattro. The check for a saved print still runs before enrollment. The scan-type prompts are now worked out before the branch, so a saved print gets the same verify prompt and result messages as a new one. The sudo step and the enrollment instructions only run when it enrolls. A failed verify keeps the fprintd-delete advice and now exits non-zero, as quattro does. The new test stubs busctl so it never asks the host's fprintd.
  • 940783af tightens the test. The "PAM left alone" check now catches a write to the sudo file as well as polkit, and the fresh-print verify failure has to fail setup. Both checks fail against a script broken in those two ways.

Reproduction. On a fresh worker with real fprintd 1.94.5, libfprint-git and libfprint's virtual storage reader, I saved a print as left-index-finger. With quattro's script, enrollment gets "That finger is already enrolled", ends at "Enrollment failed" and writes no PAM. With this branch, setup verifies the saved print ("Matched") and configures sudo, polkit and the lock screen. quattro's script fails the same way again on a second run. With no saved print, this branch enrolls through quattro's guided steps and configures PAM. When the wrong finger is scanned, setup says "No match", exits 1, writes no PAM and prints the fprintd-delete advice.

Tests. On the worker, every fingerprint test file passes, and so does ./test/cli. fingerprint-setup-enrolled-test.sh fails with quattro's script. ./test/shell fails the same 9 files on quattro and on this branch, and none of them are files this PR touches. Two other files failed once on this branch, then passed when run again on both trees.

Second opinion. Codex Medium reviewed the merge and found no defect in the resolution. It raised the two test gaps fixed in 940783af, and its round on that commit found nothing. I also asked it, without giving my own answer, which of the three competing fixes should go forward. It chose this one: #13467 is older, but its has [0-9]+ fingerprints? enrolled check never matches what fprintd-list prints, so it still ends at enroll-duplicate. #13612 is newer, counts prints on any reader rather than the one fprintd-verify uses, and exits 0 after a failed verify. I had come to the same conclusion. It can read this session's working files, so its agreement isn't a guaranteed independent check.

Unchanged. A finger saved under another account still ends at "Enrollment failed". That is the case in #13433's output, so this PR still says Refs.

Waiting on the maintainer.

@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 21, 2026
Comment on lines +3 to +5
# Fingerprint setup must still reach PAM when a print is already enrolled, since
# fprintd-enroll refuses a finger saved under another finger name as enroll-duplicate.
# fprintd, sudo, omarchy-apply-lock and omarchy-lifecycle-dispatch are stubbed; they only record what setup asked for.

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.

P2 Fingerprint tests duplicate existing setup

This new file adds a second set of tests and stubs for omarchy-setup-security-fingerprint. The contributor guide requires extending the area's existing test file rather than adding another *-test.sh. Move these cases into fingerprint-package-test.sh and share its setup. This repository requirement must be satisfied before merging.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-checked at 52a922ad after the two quattro merges and the two test commits. The fix still works as it did at 940783af. One house-rule point is left for you.

The merges. quattro now authenticates sudo first, then turns on a platform-gated reader through omarchy-lifecycle-dispatch (#16360), and only then does this branch's saved-print check run. That is the right order, because the reader has to be on before fprintd is asked about it. Nothing quattro added is lost. 601c291f4 lets the failed-fprintd-list case allow only the up-front sudo -n true. 52a922ad6 stubs the dispatcher so --resolve finds no hook. That fixes Greptile's point about an Apple Silicon host failing the test, and neither change lets an assertion pass without testing anything.

Reproduction, on a fresh worker with fprintd 1.94.5, libfprint-git and libfprint's virtual storage reader:

  • Print saved as left-index-finger: quattro's script shows "That finger is already enrolled", ends at "Enrollment failed", exits 1 and writes no PAM, both times it was run. This branch verifies the print ("Matched") and configures sudo, polkit and the lock screen.
  • Wrong finger scanned: "No match", exit 1, no PAM, and the fprintd-delete advice.
  • No saved print: it enrolls right-index-finger, verifies it and configures PAM.

Tests, on the worker. fingerprint-package-test.sh, fingerprint-setup-enrolled-test.sh and ./test/cli pass. fingerprint-invitation-test.sh skipped because that worker already had fingerprint PAM from the reproduction, so it was not run. fingerprint-setup-enrolled-test.sh fails against quattro's script.

Second opinion. Codex Medium and muse-wonder (pi, thinking high) reviewed the merges, the two test commits and the competing #13467. Neither found a functional defect. Both chose this PR over #13467, which is older but still checks for has N fingerprints enrolled. fprintd-list never prints that, so #13467 still ends at enroll-duplicate. #13612 has since closed. They can read this session's working files, so their agreement is not a guaranteed independent check.

Left for you. Both reviewers agree with Greptile's second point: quattro's AGENTS.md says to extend the area's existing test file rather than add a new *-test.sh. fingerprint-package-test.sh already covers this command's authentication, platform hook, enrollment, verification and PAM steps, so the cases in fingerprint-setup-enrolled-test.sh belong there, sharing its stubs. It does not change what the script does. I have left it to you rather than restructure your test.

Unchanged. A finger saved under another account still ends at "Enrollment failed", so this stays Refs #13433.

Waiting on the author for the test move, then on the maintainer.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants