Skip to content

Let a platform turn its fingerprint reader on with the owner's agreement - #16360

Merged
ryanrhughes merged 1 commit into
omacom:quattrofrom
scottjones:touchid/enable-fingerprint
Oct 24, 2026
Merged

ryanrhughes merged 1 commit into
omacom:quattrofrom
scottjones:touchid/enable-fingerprint

Conversation

@scottjones

@scottjones scottjones commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #16403, which deletes the reader's own prints on removal; merge that first. Until it does, this branch shows both commits, and only the second, c075239, is this PR.

A Mac keeps Touch ID off until its owner agrees. Turning it on creates a key store for Linux and advances the Secure Enclave's anti-replay state, which macOS shares, so the owner has to read what that means and say yes first. This adds the two hooks that let a platform ask, and calls them from fingerprint setup and removal.

  • omarchy-lifecycle-dispatch gains two optional root operations, enable-fingerprint and disable-fingerprint. A Mac resolves them in omarchy-mac's directory (/usr/lib/omarchy/mac); every other platform treats them as no-ops.
  • Setup resolves enable-fingerprint as the user once sudo is authenticated.
    • When it resolves, setup runs it with sudo before fprintd is asked about the reader. The platform's entrypoint shows its prompt on the terminal.
    • A refusal or a failure stops setup with nothing enrolled. The owner may have read past sudo's timeout, so sudo is checked again before enrolling.
    • A platform that can't be told sets up as one without the hook, with a warning. The reader its platform keeps off stays off, so fprintd doesn't find it, and any other reader enrols as before. This used to stop setup on every platform; it no longer changes anything off a Mac.
  • Removal runs disable-fingerprint once the prints and local files are gone and before the packages go. A failed resolution or hook doesn't stop the removal; it says the reader may stay on.

On a platform without the hooks, setup and removal behave as before and run no extra sudo for them. Saying no leaves fprintd and libfprint-git installed, since setup installs them before it asks; the prompt is about the Secure Enclave, not the packages.

The Mac side is omacom/omarchy-mac-pkgs#12: the prompt, the eligibility check and turning Touch ID on and off. It reports unsupported:runtime until this lands, so the two can merge in either order. Where the Mac can't use Touch ID (no sensor, an M1, a board without a profile), its hook exits 0 and setup goes on, so a USB reader still enrols. This builds on #14675 (detection) and #15512 (enrolment).

Evidence

The tests stub sudo, fprintd and the dispatcher, so nothing on the machine changes.

  • fingerprint-package-test.sh, security-fingerprint-remove-test.sh, lifecycle-dispatch-test.sh, fingerprint-invitation-test.sh and security-polkit-faillock-test.sh pass in ubuntu:24.04 as root and as a normal user.
  • 11 deliberate breaks each fail a test:
    • a fatal resolve failure;
    • no second sudo check;
    • running a hook that resolved to nothing;
    • carrying on after the hook fails;
    • dropping, misordering or making fatal disable-fingerprint;
    • the two operations missing from the dispatcher.
  • MacBook Neo (J700), with omarchy-mac-pkgs#12: a fresh install from installer 2.3.8, with these three commands installed by hand.
    • Setup showed the Mac's prompt. Yes turned Touch ID on, and enrol and verify passed.
    • After a cold reboot the lock screen took the finger.
    • That run predates the resolve-first, re-authentication and non-fatal-resolve changes, which the tests above cover.

Test plan

  • The five tests above pass
  • On a non-Mac with a fingerprint reader: setup and removal behave as before, with no extra sudo prompt
  • On a Mac with omarchy-mac-pkgs#12: setup shows the prompt; no leaves Touch ID off and enrols nothing; yes enrols; removal deletes the prints and turns Touch ID off from the next boot

Merge Danger

Door: two-way

Blast Radius: low. Off a Mac the hooks are no-ops, but every machine's fingerprint setup now resolves a dispatch operation first and warns if it can't.

🤖 Generated with Claude Code

@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.

Summary

Adds optional platform hooks to turn fingerprint readers on and off.

  • Fingerprint setup can turn on a platform’s reader after the owner agrees.
  • Fingerprint removal asks the platform to turn its reader off.

No actionable issues were found. This review checked the code; it did not run the tests.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Authenticate sudo] --> B[Resolve enable-fingerprint]
  B -->|Hook found| C[Run platform prompt and hook]
  C -->|Failure or refusal| D[Stop before enrollment]
  C -->|Success| E[Check sudo again]
  B -->|No hook| F[Enroll fingerprint]
  B -->|Resolution fails| G[Warn and continue]
  G --> F
  E --> F
Loading

Reviews (4) · Last reviewed commit: "Let a platform turn its fingerprint read..." · Reviewed by Greptile

@scottjones

Copy link
Copy Markdown
Contributor Author

Tested on a MacBook Neo (J700) at c075239 (on #16403's 0b1c7e8), with omacom/omarchy-mac-pkgs#12 at ab5a5b6. The three commands were installed by hand.

  • Setup, no: the platform's prompt appeared after sudo was authenticated. No stopped setup with "The fingerprint sensor was not turned on, so nothing was enrolled". Nothing was written on the Mac's side.
  • Setup, yes: Touch ID turned on, and enrolment succeeded.
  • Cold reboot: the lock screen took the finger, and so did sudo in a terminal.
  • Removal: in order, it ran sudo -v, fprintd-delete, the PAM edits, rm -rf /var/lib/fprint/<user>, omarchy-lifecycle-dispatch disable-fingerprint, then the package drop. The platform's agreement, options and key were gone afterwards. Password unlock on the lock screen worked afterwards.

The same run passed on a MacBook Pro 14" M2 Max (J414c) as a first-time Touch ID setup: no, then yes and enrol, then a cold boot with the lock screen and sudo, then removal in the same order.

🤖 Generated with Claude Code

@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 5d75700, to merge after #16403.

The hooks are optional root operations that resolve only on aarch64-apple. Setup resolves as the user and runs the hook with sudo only when it resolves. It checks sudo again after the prompt, and a refusal or failure stops setup with nothing enrolled. Removal runs disable-fingerprint before the packages go, and a failure there only warns. Off a Mac nothing changes, and an undetermined platform now warns instead of stopping setup.

Before merge: after #16403 is squash-merged, rebase onto quattro so this PR's diff is only c075239. As it stands, the branch conflicts after the squash. The cherry-pick applies cleanly.

For the maintainer to accept: a failed --resolve warns and continues, and that includes an entrypoint the dispatcher rejects as untrusted. This is no consent bypass: the hook is what loads the driver, so nothing turns Touch ID on in that path.

Follow-up (non-blocking): tell an untrusted-entrypoint rejection apart from an unknown platform, and keep the rejection a red stop.

ryanrhughes pushed a commit that referenced this pull request Oct 24, 2026
…#16403)

* Delete the reader's own copy of the prints when removing fingerprints

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 #16360, which builds the Touch ID hooks on it.

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

* Drop the width check that measured the test's own text

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>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-authored-by: Codex Medium <noreply@openai.com>
A Mac keeps Touch ID off until its owner agrees, so fingerprint setup and
removal gain two optional lifecycle operations, enable-fingerprint and
disable-fingerprint, which omarchy-mac implements on Apple Silicon:

- Setup resolves enable-fingerprint as the user once sudo is
  authenticated and, when it resolves, runs it with sudo before fprintd is
  asked about the reader. The hook asks the owner; a refusal or a failure
  stops setup with nothing enrolled. sudo is checked again afterwards,
  since the owner may read past its timeout.
- A platform that can't be told sets up as one without the hook, with a
  warning: the reader its platform keeps off stays off, so fprintd doesn't
  find it, and setup never stops anywhere else.
- Removal runs disable-fingerprint once the prints and local files are
  gone and before the packages go. A failure is reported, not fatal.

Builds on the removal change that deletes the reader's own prints first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scottjones
scottjones force-pushed the touchid/enable-fingerprint branch from 5d75700 to 7227858 Compare October 24, 2026 02:05
@ryanrhughes
ryanrhughes merged commit 75d2206 into omacom:quattro Oct 24, 2026
2 checks passed

@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.

all good

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants