Skip to content

Delete the reader's own copy of the prints when removing fingerprints - #16403

Merged
ryanrhughes merged 2 commits into
omacom:quattrofrom
scottjones:fingerprint/delete-prints-first
Oct 24, 2026
Merged

ryanrhughes merged 2 commits into
omacom:quattrofrom
scottjones:fingerprint/delete-prints-first

Conversation

@scottjones

Copy link
Copy Markdown
Contributor

Removing fingerprints left the prints on any reader that stores them on the chip. A match-on-chip reader (a Mac's Touch ID, and some Synaptics and Goodix USB readers) keeps each enrolled print in the device as well as in /var/lib/fprint. fprintd only finds the device's copies through those local records, so once removal has deleted the records, nothing can delete the copies on the reader.

  • Removal now deletes the user's prints with fprintd-delete while fprintd still runs, before the local files go.
    • It asks for sudo first, in view, because the delete's own output is captured. Removal always needed root (the rm -rf and the package drop). A refusal now stops it before anything changes, where before it could stop partway through the PAM edits.
    • A reader that isn't there ("No devices available") is said plainly.
    • Any other failure is reported, and removal goes on.
    • Without fprintd, the delete is skipped.
  • Enrolment instructions now fit in 80 columns. The press and touch-or-swipe lines were up to 125 characters, and the setup terminal wrapped them mid-word ("a few touch" / "es" on a MacBook Neo).

This is split out of #16360 at a maintainer's request: these parts change every platform, and #16360 now carries only the Touch ID hooks on top of them.

Evidence

  • test/shell.d/security-fingerprint-remove-test.sh and fingerprint-package-test.sh pass in ubuntu:24.04 as root and as a normal user, and so do fingerprint-invitation-test.sh and security-polkit-faillock-test.sh, which also run these scripts.

  • Each new case fails against a deliberate break:

    • no up-front sudo;
    • a refused sudo carrying on;
    • no fprintd guard;
    • a fatal delete;
    • the "No devices" branch;
    • deleting as $USER;
    • no delete, or the delete after rm -rf;
    • the old long lines.
  • fprintd's utils/delete.c was checked:

    • a user with no prints exits 0;
    • no reader prints "No devices available" and exits 1;
    • a claim or delete failure exits 1.

    sudo sends PAM prompts to /dev/tty, so a second prompt inside the captured delete still reaches the user.

Test plan

  • bash test/shell.d/security-fingerprint-remove-test.sh and fingerprint-package-test.sh pass
  • With a USB reader on x86: removal asks for sudo once, removes the prints and the packages, and says nothing extra
  • With fprintd unable to find the reader: removal says so and finishes

Merge Danger

Door: two-way

Blast Radius: low. Every platform's fingerprint removal now asks for sudo before it starts and runs fprintd-delete first. The enrolment text changes only in its line breaks.

🤖 Generated with Claude Code

A match-on-chip reader keeps the enrolled prints in the device as well as
in /var/lib/fprint, and fprintd finds the device's copies only through its
local records. So removal now deletes them with fprintd-delete while fprintd
still runs, before the local files go. It authenticates sudo in view first,
since the delete's output is captured; a refusal changes nothing. A delete
that finds no reader is said plainly, and one that fails is reported without
stopping the removal.

The enrolment instructions also move to short lines, since the setup
terminal wraps a long one mid-word.

Split out of omacom#16360, which builds the Touch ID hooks on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Deletes fingerprints from the reader before removing local records and packages.

  • Fingerprint removal tries to clear prints from the reader first.
  • Press and unnamed-reader prompts fit across shorter lines.

Since the last review, only a redundant test assertion was removed. No new actionable issues or rule violations were found. No previous review threads were supplied.

Reviews (2) · Last reviewed commit: "Drop the width check that measured the t..." · Reviewed by Greptile

@omarchybot omarchybot added the bug Something isn't working label Oct 23, 2026
The loop read the expected instruction the test passes in, not what setup printed, so it could only fail if someone edited the test's string; the exact-output match above already holds setup to that text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at f157fec. The removal logic holds up; what's left is seeing it delete the prints on a reader that stores them.

What ran, on a disposable Omarchy worker with no fingerprint reader:

  • security-fingerprint-remove-test.sh, fingerprint-package-test.sh, fingerprint-invitation-test.sh, security-polkit-faillock-test.sh and ./test/cli pass at the head.
  • With the two bin/ scripts put back to quattro (967bbdd), the new removal and setup cases fail, so they test the change.
  • With fprintd 1.94.5 installed, sudo fprintd-delete $USER prints "No devices available" and exits 1, as the description says. The real omarchy-remove-security-fingerprint then printed the "No fingerprint reader is available now" warning, removed the PAM line, the local records and the packages, and exited 0.

Pushed: f157fec drops the 80-column loop in check_instruction in fingerprint-package-test.sh. It measured the expected text the test passes in, not what setup printed, so it could only fail if someone edited the test's own string. The exact-output match above it already holds setup to the new wording. #16360 sits on this branch, so it will want this commit merged in.

Second opinion: Codex Medium and muse-spark-1.3-contributor (via pi, thinking high) each reviewed it twice. Both flagged the loop above, and on the second round both found nothing open. Their other notes were cosmetic or need a sudo setup Omarchy doesn't ship: a bare colon if fprintd-delete fails with no output, and a prompt hidden inside the captured delete only when timestamp_timeout=0. They agreed with the rest of this review, but they could read it as they worked, so their agreement isn't fully independent.

What it's waiting on — @scottjones, a run on a match-on-chip reader: no worker has one, so the on-chip delete is the one part nobody has seen work. On your Mac's Touch ID, or any reader that stores prints on the chip:

  1. Enrol a finger with Omarchy's fingerprint setup.
  2. From a checkout of this branch at f157fec3ce31e2313f2d902f519a80028a9d8e09, run PATH=$PWD/bin:$PATH bin/omarchy-remove-security-fingerprint.
  3. Run setup again and enrol the same finger. Tell us whether the reader still held the old print: a duplicate refusal, or storage that didn't free up. Compare with removal on quattro if you can.

A reply here with the result and the SHA you tested is what this needs before it goes to the maintainer.

@scottjones

Copy link
Copy Markdown
Contributor Author

Thanks. I ran it on two Macs with Touch ID, which keeps prints in the Secure Enclave. The removal script was this branch's: at f157fec the bin/ scripts are byte-identical to 0b1c7e8, which is what ran. Both runs had #16360's hooks on top, with omacom/omarchy-mac-pkgs#12.

  • MacBook Pro 14" M2 Max (J414c). I enrolled a finger through Omarchy's setup, then removed it with Omarchy's fingerprint removal. sudo logged the commands in this order:

    1. fprintd-delete scott, while fprintd still ran;
    2. the PAM edits;
    3. rm -rf -- /var/lib/fprint/scott;
    4. disable-fingerprint;
    5. the package drop.

    I then ran setup again and enrolled the same finger. It was accepted, with no duplicate refusal, and it verified.

  • MacBook Neo (J700). Same order. Enrolling again after the delete was accepted there too, and password unlock worked afterwards.

One caveat: I don't know whether Touch ID's libfprint driver checks for duplicates at enrolment. If it doesn't, a successful re-enrol doesn't prove the old print left the enclave, only that nothing refused. I didn't run the quattro comparison. Removing without the delete would leave a print in the enclave with no local record, and nothing could delete it afterwards.

Not yet tried on x86 with a USB reader.

🤖 Generated with Claude Code

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for running it on both Macs. Nothing has landed since f157fec, so the code review above still stands; this is only about what your result shows.

What it shows: on two Touch ID readers, removal ran fprintd-delete while fprintd was still up and before the local records went, and setup could enrol the same finger again afterwards. So the new order works on real match-on-chip hardware and leaves the reader usable.

What it doesn't yet: as you say, a re-enrol that nobody refused doesn't tell us the old print left the enclave. And sudo's log shows the delete was called, not that it succeeded: removal hides fprintd-delete's output when it works and prints its green "removed" message either way.

The one thing that decides it: did either run print a yellow warning — "The reader's own copy of … may not have been deleted: …" or "No fingerprint reader is available now …"? No yellow line means fprintd reported the delete done on the reader. If there was one, paste it here. If you no longer have the output, running sudo fprintd-delete $USER; echo "exit $?" after enrolling a finger shows the same thing.

Codex Medium read your reply against the script separately and came to the same conclusion; it could see this review as it worked, so that agreement isn't fully independent. This waits on your answer to that question before it goes to the maintainer.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving at f157fec. The split is right: this PR now holds only the parts that change every platform.

  • Removal authenticates sudo in view, then runs fprintd-delete while fprintd still runs and before /var/lib/fprint/<user> goes. A refused sudo changes nothing, and a failed or reader-less delete is reported without stopping removal.
  • The 80-column enrolment lines change only the line breaks.

For the maintainer: removal on every platform now asks for sudo up front and deletes the reader's own copy of the prints. That is a behaviour change, so it needs your explicit OK.

Merge note: #16360 is stacked on this branch. Once this is squash-merged, #16360 needs a rebase onto quattro, or it conflicts in docs/file-layout.md and test/shell.d/security-fingerprint-remove-test.sh. Cherry-picking its own commit c075239 onto the squashed result applies cleanly.

@ryanrhughes
ryanrhughes merged commit 0d8edf3 into omacom:quattro Oct 24, 2026
2 checks passed
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
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.

5 participants