Gate sudo fingerprint behind lid state too

Extend the clamshell gate to /etc/pam.d/sudo, not just polkit-1. When the
lid is shut the reader is unreachable, so a terminal sudo would block on
"Place your finger" until pam_fprintd timed out before letting you type the
password. The same pam_exec gate (success=1 skips fingerprint when the lid
is closed) now runs ahead of pam_fprintd in the sudo stack as well.

setup and removal share one gate definition across sudo and polkit; the
migration now gates both stacks on existing installs.

Resolves the clamshell case in #856 and supersedes #6003.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-23 15:29:22 -07:00
co-authored by Claude Opus 4.8
parent 8e549c27d0
commit cb9485f216
3 changed files with 36 additions and 29 deletions
+3 -3
View File
@@ -7,10 +7,10 @@ set -e
remove_pam_config() {
# Remove from sudo
if grep -q pam_fprintd.so /etc/pam.d/sudo; then
# Remove from sudo (both the fingerprint module and its clamshell gate)
if grep -Eq 'pam_fprintd\.so|omarchy-hw-laptop-closed' /etc/pam.d/sudo; then
echo "Removing fingerprint authentication from sudo..."
sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/sudo
sudo sed -i -e '/pam_fprintd\.so/d' -e '/omarchy-hw-laptop-closed/d' /etc/pam.d/sudo
fi
# Remove from polkit (both the fingerprint module and its clamshell gate)