Conversation
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
force-pushed
the
fix-polkit-pam-faillock
branch
from
September 14, 2026 20:46
b5e072f to
4188492
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Arch ships polkit's PAM stack at
/usr/lib/pam.d/polkit-1, so/etc/pam.d/polkit-1does not exist on a stock machine: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-authlines. Replacing it with barepam_unixdrops, on a current Arch install:pam_faillockpreauth/authfail/authsucc (deny=10 unlock_time=120) — no lockout on repeated failed polkit promptspam_env(auth),pam_time(account),pam_limits(session)pam_systemd_homeon all four stacksFix: seed
/etc/pam.d/polkit-1from the vendor file when missing, then let the existing insertion path add the fingerprint lines — the same shape already used for sudo, whose file thesudopackage still ships in/etc. The heredoc stays for systems with no vendor file, now includingsystem-authrather than inventing a stack./etc/pam.d/sudois unaffected; only polkit moved to/usr/lib/pam.d.Resulting stack on a Latitude 9440:
./test/clipasses (112 ok).🤖 Generated with Claude Code