Skip to content

Fingerprint setup: keep working forks; silent lid-open PAM gate - #12110

Open
chessing234 wants to merge 11 commits into
omacom:quattrofrom
chessing234:fold/fingerprint-keep-fork-clamshell
Open

chessing234 wants to merge 11 commits into
omacom:quattrofrom
chessing234:fold/fingerprint-keep-fork-clamshell

Conversation

@chessing234

@chessing234 chessing234 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #11899

Test plan

  • fingerprint-package-test.sh
  • fingerprint-clamshell-silent-gate-test.sh
  • lock-fingerprint-clamshell-gate-test.sh

@calledtoconstruct

Copy link
Copy Markdown

The sudo/polkit silent polarity (omarchy-hw-laptop-open + [success=ignore default=1]) is the right #10254 fix. The lock half of this PR still puts that same skip on /etc/pam.d/omarchy-lock-fingerprint (setup, omarchy-apply-lock, and migrations/1789261001.sh).

Lock fingerprint is its own PamContext. Its only auth module is pam_fprintd. default=1 skipping that module is PAM success, and handleFingerprintFinished(Success) unlocks. Password is a parallel PAM conversation, not a fallback on this stack — so this is not “fail closed.” Your silent-gate migration in the same PR already says skipping lock pam_fprintd would unlock; the lock-gate half contradicts that.

Lid-closed skip on the lock screen belongs in the lock service, not in that PAM file. #10393 does that with lock.fingerprintLidClosed (skip / try) and keeps the lock stack ungated. Please drop the lock path from setup, apply-lock, and 1789261001.sh if this lands, or close the lock-gate half in favour of #10393.

@chessing234

Copy link
Copy Markdown
Contributor Author

dropped the lock pam lid gate — that skip was unlock success; lid policy stays in the lock service

Match the omacom#10254 fix so adding the clamshell gate to lock PAM does not
reintroduce pam_exec LOG_ERR spam on the common lid-open path.
pam_exec logged LOG_ERR whenever omarchy-hw-laptop-closed exited 1, which
is the common lid-open case on every sudo/polkit auth. Gate with
omarchy-hw-laptop-open and success=ignore so control flow stays the same
without flooding the journal (omacom#10254).
Lock is its own PamContext; skipping pam_fprintd there unlocks with the lid shut.
Skipping pam_fprintd on that stack is unlock success. Keep the silent
gate on sudo/polkit only; strip it from lock setup, apply-lock, and the
migration.
@chessing234
chessing234 force-pushed the fold/fingerprint-keep-fork-clamshell branch from e7c544b to f6abb11 Compare September 27, 2026 02:01
omarchy-pkg-missing now calls pacman -Q -- <pkg>. The stub treated -- as
the package name, so stock-replacement cases looked like fprintd/usbutils
were missing and over-installed.
@omarchybot

Copy link
Copy Markdown
Collaborator

#9873 has merged into quattro. Preserve its system-auth includes. The repair migration's strict allowlist accepts the old lid-closed gate, not this PR's lid-open gate; changing the gate before repair can make a vulnerable stack get skipped. Reconcile the migration path explicitly. Fork preservation and the silent gate remain separate work, so this PR stays open.

Scope checked by GPT-6 in Codex and Codex Medium against the reports and landed source. The second opinion agreed with this scope; independence is not guaranteed. No runtime tests were rerun for this reconciliation.

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 2/5

[High impact] The changes reach fingerprint authentication for sudo, polkit, and the lock screen.

The PR needs fixes before merging because working forks can still be replaced and lid-gated fingerprint authentication still breaks in supported setups.

Findings

  1. P1 Working fork can be replaced ▶
  2. P1 PAM helper may be missing ▶
  3. P1 Closed lids report open ▶
  4. P2 Tests check strings, not behavior ▶
  5. P2 Restart failure is hidden ▶

Summary

This PR changes fingerprint package selection and flips the sudo/polkit lid check so the usual lid-open path exits successfully.

  • Fingerprint setup keeps an installed community driver in place.
  • Sudo and polkit skip fingerprint quietly when the lid is shut.
  • Lock-screen fingerprints no longer skip authentication when the lid is closed.

Reviews (4) · Last reviewed commit: "Merge current fingerprint package and li..." · Reviewed by Greptile

libfprint_pkgs=()
while IFS= read -r pkg; do
[[ -n $pkg ]] && libfprint_pkgs+=("$pkg")
done < <(pacman -Qq libfprint libfprint-2 libfprint-git 2>/dev/null | sort -u)

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.

P1 Working fork can be replaced If a working libfprint fork is installed under its own package name and provides libfprint, pacman -Qq does not find it by the provided name. Setup then treats the driver as missing and requests libfprint-git; --ask 4 can remove the working fork. The fork test misses this because its -Qq stub resolves providers.

# Use omarchy-hw-laptop-open (exit 0 when open) so the common path does not
# make pam_exec LOG_ERR on every sudo/polkit auth (#10254). success=ignore
# continues to pam_fprintd; default=1 skips it when the lid is closed.
local fprintd_gate="auth [success=ignore default=1] pam_exec.so quiet /usr/bin/omarchy-hw-laptop-open"

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.

P1 PAM helper may be missing If setup runs from a dev-linked checkout while the installed package predates this helper, dev-link does not put omarchy-hw-laptop-open at /usr/bin. Setup still replaces the sudo and polkit gates with that absolute path. pam_exec then fails and default=1 skips fingerprint authentication even when the lid is open. The migration can make the same replacement.

sudo pacman -S --needed --noconfirm --ask 4 "${need_packages[@]}"
# D-Bus activation keeps a running fprintd mapped to the library that was
# just replaced; without a restart, enroll can "succeed" against the old .so.
sudo systemctl try-restart fprintd.service 2>/dev/null || true

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 Restart failure is hidden If a package transaction replaces libfprint while fprintd is active and try-restart fails, this line hides the error and continues to enrollment against the stale in-memory library. Surfacing that failure would avoid an apparently valid enrollment using the old driver. The new test stub always succeeds, so it does not cover this path.

@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again since the head moved to eb6f8e4. Its classification is unsettled, so I have taken the enhancement label off and have not run or verified it this time.

Two models classified it separately from the diff and the linked issue. Opus 5.5 in Claude Code read it as a bug: on quattro, setup evicts a working libfprint fork that provides libfprint (#11899, already labelled bug), enrollment can then pass against a stale fprintd, and the lid gate makes pam_exec log an error on every sudo/polkit auth with the lid open (#10254). Codex Medium read it as an enhancement: it changes package-selection policy and the PAM gate on purpose rather than restoring something that used to work. Neither reading is wrong on its face, so the maintainer decides which it is before anyone works it further.

This now waits on the maintainer.

Comment on lines +17 to +18
# No lid switch (desktop): treat as open so fingerprint stays available.
exit 0

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.

P1 Closed lids report open

omarchy-hw-laptop-open treats every laptop without an ACPI lid file as open. The existing omarchy-hw-laptop-closed also checks input lid switches through logind, including on supported Apple Silicon MacBooks.

After setup or migration switches PAM to this helper, those laptops stop skipping fingerprint authentication when closed. Sudo and polkit can wait for an unreachable reader instead of going straight to the password prompt. Preserve the existing helper’s non-ACPI check when reversing its result.

Knowledge Base Used: Hardware, devices, and power

@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again since the head moved to f6cd159 (the merge of quattro). The classification is still unsettled, so it carries no class label and nothing was run on a worker this time.

Two models classified it separately from the diff and the linked issue. Opus 5.5 in Claude Code read it as a bug: on quattro, setup evicts a working libfprint fork (#11899), and the lid gate makes pam_exec log an error on every sudo/polkit auth with the lid open (#10254). Codex Medium read it as an enhancement: it changes package-selection policy and the PAM gate on purpose. The maintainer decides which it is before it is worked further.

One defect found by reading the merged head, so it is not lost while this waits. Since #14431, bin/omarchy-hw-laptop-closed on quattro falls back to logind's LidClosed when there is no ACPI lid but an input device reports a lid switch (Apple Silicon MacBooks). The new bin/omarchy-hw-laptop-open only reads /proc/acpi/button/lid and exits 0 otherwise, so once setup or migrations/1789400300.sh switches sudo and polkit to it, those laptops with the lid shut try the unreachable reader again instead of going straight to the password prompt. Having the open helper return the inverse of the closed one (! /usr/bin/omarchy-hw-laptop-closed) keeps a single lid check. Greptile raised the same point.

Greptile's "Working fork can be replaced" does not hold: pacman -Qq libfprint resolves to an installed package that provides libfprint (checked against pacman 7.1, e.g. pacman -Qq sh prints bash), so a fork is found and left alone.

This waits on the maintainer for the classification.

Comment on lines +14 to +21
grep -q '/proc/acpi/button/lid' "$helper" ||
fail "omarchy-hw-laptop-open reads the ACPI lid state"

grep -q 'exit 1' "$helper" ||
fail "omarchy-hw-laptop-open exits 1 when the lid is closed"

grep -q 'exit 0' "$helper" ||
fail "omarchy-hw-laptop-open exits 0 when the lid is open"

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 Tests check strings, not behavior

These checks search for exit statements without running the lid helper, so they can pass when lid detection is broken. AGENTS.md says “Don't restate the implementation” and “No test for a migration,” but this file also checks migration source. The same pattern appears in lock-fingerprint-clamshell-gate-test.sh.

Run the helper against open and closed lid states, check the files setup writes, and remove the migration-source checks. These repository requirements 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

Copy link
Copy Markdown
Collaborator

Reviewed the new head 738333909561edce588b5ccc2637ae39fd5aa25e, its diff, the review comments and #11899 against quattro. Classification remains unsettled: GPT-6 High in Codex reads the fork-preservation and stale-daemon changes as bug fixes; the configured classifier, deepseek-v4p1-flash via pi (effort not recorded), returned enhancement when asked separately through omabot classify.

This waits on the maintainer to resolve the classification. No worker tests ran, no changes were pushed, and no class or verification labels were added.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy setup security fingerprint silently evicts a working libfprint fork, then "succeeds" against the stale daemon

3 participants