Skip to content

Seed polkit fingerprint config from vendor default, route fallback through system-auth - #8756

Closed
alhasapi wants to merge 1 commit into
omacom:quattrofrom
alhasapi:fingerprint-polkit-system-auth
Closed

alhasapi wants to merge 1 commit into
omacom:quattrofrom
alhasapi:fingerprint-polkit-system-auth

Conversation

@alhasapi

Copy link
Copy Markdown

Problem

omarchy-setup-security-fingerprint builds a from-scratch PAM stack on bare
pam_unix.so when /etc/pam.d/polkit-1 doesn't already exist, bypassing
system-auth entirely -- losing faillock and anything else the system's own
auth policy pulls in through system-auth.

Fix

  • Seed /etc/pam.d/polkit-1 from the vendor default at
    /usr/lib/pam.d/polkit-1 when it's available, so the fingerprint gate gets
    added to the same stack the rest of the system already uses.
  • When there's no vendor file to seed from, route the fallback stack through
    system-auth includes instead of pam_unix.so directly.

This is independent of what fingerprint backend is installed -- it benefits
stock libfprint/fprintd installs the same as any other.

Testing

Ran the existing test/shell.d/polkit-test.sh suite; unaffected (it tests
fingerprint-prompt/PAM-config detection logic, not this script). No new
automated coverage needed for a change this size.

…rough system-auth

omarchy-setup-security-fingerprint currently builds a from-scratch PAM stack
on bare pam_unix.so when /etc/pam.d/polkit-1 doesn't exist yet, bypassing
system-auth entirely -- losing faillock and any other policy system-auth
pulls in. Seed from /usr/lib/pam.d/polkit-1 (the vendor default) when
present, and route the from-scratch fallback through system-auth includes
instead of pam_unix.so directly, so the resulting stack matches what the
rest of the system already expects.
Copilot AI balanced review requested due to automatic review settings August 28, 2026 14:08

Copilot AI 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.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. The bug is real: on a stock Arch install /etc/pam.d/polkit-1 does not exist, because polkit ships its stack at /usr/lib/pam.d/polkit-1 (four include system-auth lines). So omarchy-setup-security-fingerprint on quattro writes its own file, which shadows that stack and lists pam_unix.so directly. Polkit prompts lose pam_faillock (deny=10 in system-auth) along with everything else system-auth pulls in. I checked this against quattro and the vendor PAM files. Your change fixes it for a fresh fingerprint setup.

#9873 fixes the same bug, and I think it is the one to take forward:

  • It also fixes bin/omarchy-setup-security-fido2, which has the same fallback (lines 30–39 on quattro). This PR leaves FIDO2 writing the bare pam_unix stack. If someone sets up FIDO2 first, a later fingerprint setup finds that file and adds its lines to it, so the polkit stack still has no faillock.
  • It ships a migration that repairs machines where the old setup already ran. This PR only changes what a new setup writes, so every existing fingerprint user keeps the stack without faillock.
  • It adds tests for the stack the setup writes and for the migration. This PR adds none.

The one thing here that #9873 lacks is copying the vendor file instead of writing the stack by hand. Today the result is the same, because the vendor file is exactly the four include system-auth lines. It would only matter if polkit's packaged stack changed. That could be raised on #9873 if it seems worth keeping.

What was checked: I read both diffs against current quattro. Neither was run on a worker, because a fix that will not be carried forward is not worth a worker. Classification as bug was agreed with a second model earlier. The second opinion on the comparison itself (Codex Medium) did not run: omabot's daily review budget was spent, though the reviewer answered a ping. So this comparison is one model's reading.

The maintainer decides between the two PRs. Nothing is needed from you in the meantime.

@omarchybot

Copy link
Copy Markdown
Collaborator

Closing this alternative after #9873 merged into quattro. Both fingerprint and FIDO2 polkit setup now use system-auth, and the migration repairs the legacy direct-pam_unix stacks. Closing this alternative vendor-stack implementation of the same missing-system-auth fix.

Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup.

Omabot on behalf of DHH

@omarchybot omarchybot closed this Oct 4, 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.

3 participants