Skip to content

Keep polkit's PAM stack when enabling fingerprint auth - #11844

Open
pelifix wants to merge 1 commit into
omacom:quattrofrom
pelifix:fix-polkit-pam-faillock
Open

pelifix wants to merge 1 commit into
omacom:quattrofrom
pelifix:fix-polkit-pam-faillock

Conversation

@pelifix

@pelifix pelifix commented Sep 14, 2026

Copy link
Copy Markdown

Arch ships polkit's PAM stack at /usr/lib/pam.d/polkit-1, so /etc/pam.d/polkit-1 does not exist on a stock machine:

$ pacman -Ql polkit | grep pam
polkit /usr/lib/pam.d/polkit-1

The [[ -f /etc/pam.d/polkit-1 ]] test therefore fails and the heredoc fallback runs — not as the rare case it reads like, but as the normal path for anyone setting up a reader. PAM prefers /etc/pam.d, so that file shadows the vendor stack rather than extending it.

The vendor stack is four include system-auth lines. Replacing it with bare pam_unix drops, on a current Arch install:

  • pam_faillock preauth/authfail/authsucc (deny=10 unlock_time=120) — no lockout on repeated failed polkit prompts
  • pam_env (auth), pam_time (account), pam_limits (session)
  • pam_systemd_home on all four stacks

Fix: seed /etc/pam.d/polkit-1 from the vendor file when missing, then let the existing insertion path add the fingerprint lines — the same shape already used for sudo, whose file the sudo package still ships in /etc. The heredoc stays for systems with no vendor file, now including system-auth rather than inventing a stack.

/etc/pam.d/sudo is unaffected; only polkit moved to /usr/lib/pam.d.

Resulting stack on a Latitude 9440:

#%PAM-1.0
auth      [success=1 default=ignore] pam_exec.so quiet /usr/bin/omarchy-hw-laptop-closed
auth      sufficient pam_fprintd.so
auth      include   system-auth
account   include   system-auth
password  include   system-auth
session   include   system-auth

./test/cli passes (112 ok).

🤖 Generated with Claude Code

Arch ships polkit's PAM stack at /usr/lib/pam.d/polkit-1, so
/etc/pam.d/polkit-1 does not exist on a stock machine. The -f test on it
therefore fails and the heredoc fallback runs -- not as the rare case it
reads like, but as the normal path for every user who sets up a reader.

PAM prefers /etc/pam.d over /usr/lib/pam.d, so that file shadows the
vendor stack rather than extending it. The vendor stack is four
`include system-auth` lines; the replacement was bare pam_unix, which
drops pam_faillock preauth/authfail/authsucc (deny=10 unlock_time=120),
leaving polkit password prompts with no lockout on repeated failures. It
also drops pam_env, pam_time, pam_limits and pam_systemd_home.

Seed /etc/pam.d/polkit-1 from the vendor file when it is missing, then
let the existing insertion path add the fingerprint lines to it -- the
same shape already used for sudo, whose file the sudo package still
ships in /etc. The heredoc stays for systems with no vendor file at all,
now including system-auth instead of inventing a stack.

/etc/pam.d/sudo is unaffected; only polkit moved to /usr/lib/pam.d.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pelifix
pelifix force-pushed the fix-polkit-pam-faillock branch from b5e072f to 4188492 Compare September 14, 2026 20:46
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.

1 participant