Skip to content

Include clamshell gate in lock-screen fingerprint PAM - #12914

Closed
chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/fingerprint-lock-clamshell-gate
Closed

chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/fingerprint-lock-clamshell-gate

Conversation

@chessing234

Copy link
Copy Markdown
Contributor

Summary

  • setup_lock_fingerprint_pam now writes the shared $fprintd_gate (omarchy-hw-laptop-closed) before pam_fprintd.so in /etc/pam.d/omarchy-lock-fingerprint, matching sudo/polkit.
  • Re-running setup keeps rewriting that gate instead of wiping a manually restored one.
  • Shell test stubs sudo/tee (and GNU sed -i) against a scratch PAM tree and asserts the gate comes before pam_fprintd.

Closes #10096
Closes #10173

Test plan

  • bash test/shell.d/fingerprint-lock-pam-test.sh
  • bash test/shell.d/fingerprint-package-test.sh
  • bash test/shell.d/privileged-heredoc-test.sh
  • On a laptop with a reader: run omarchy-setup-security-fingerprint, confirm /etc/pam.d/omarchy-lock-fingerprint has the gate line above pam_fprintd.so, then re-run setup and confirm the gate is still present

Made with Cursor

setup_lock_fingerprint_pam was writing omarchy-lock-fingerprint without
omarchy-hw-laptop-closed, and a re-run wiped any manually added gate.
Share the same $fprintd_gate sudo/polkit already use.
@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

Two integration issues remain at 836cbf2e.

Verified: The setup wizard now writes the clamshell gate immediately before pam_fprintd.so, and rerunning its lock-PAM writer restores that gate.

Closed-lid suppression enters the fast retry path

The new lock stack has no password authentication module after pam_fprintd.so. In the inspected Linux-PAM 1.7.1/1.7.2 dispatch logic, skipping its only deciding auth module returns PAM_PERM_DENIED, not successful authentication. The lock screen's error handler and retry timer then follow this source-derived sequence:

closed lid → skip pam_fprintd → PAM_PERM_DENIED
           → retry timer (250 ms) → another PAM attempt

Impact: For an awake, locked laptop with its lid closed, reader access stops but fingerprint PAM sessions keep restarting without backoff. Password authentication remains a separate context, rather than a fallback reached by this stack. Actual process rates, power effects and crashes were not measured.

Suggested change: Pause fingerprint attempts while the lid is closed and re-arm when it opens, or distinguish this suppression path from retryable scan failures with bounded retries. Do not turn the gate into successful authentication. Adjust the shared “drops straight to the password prompt” comment to distinguish the lock's separate password context.

Lock reconfiguration can remove the gate again

omarchy-apply-lock still overwrites the same fingerprint PAM file without the gate when fingerprints are enrolled. Installation configuration and the Quattro upgrade helper call this writer; this is not a claim about every ordinary update.

A private-copy shell check with synthetic enrollment produced:

setup writer → gate present
apply-lock   → gate absent
setup rerun  → gate restored

Impact: Running that configuration path after fingerprint setup restores unguarded reader access while the lid is closed.

Suggested change: Keep both writers consistent with the chosen lid-aware policy, preferably through shared generation, and cover setup followed by lock reconfiguration.


Review information

Test scope: Source inspection and a synthetic, retargeted shell-writer comparison. PAM/retry conclusions above are source-derived. No real reader, lid, lock UI or end-to-end install/upgrade validation.

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

Automated AI review: Astra Medium initial inspection, independent Opus 5.5 High and GPT 6 Sol Xhigh technical reviews, then Astra Medium synthesis against source and targeted evidence.

@chessing234

Copy link
Copy Markdown
Contributor Author

folding into #12110 — lock PAM already gets the clamshell gate (laptop-open polarity) there.

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

Labels

None yet

Projects

None yet

2 participants