fix: greetd via password-auth-Substack (Keyring-Unlock repariert)

This commit is contained in:
humocs-man committed 2026-10-05 18:17:42 +02:00
1 parent cca9d87f40
commit 8286b3299f
2 files changed
+17 -25

No files matched your search

+16 -25
View File
@@ -75,33 +75,24 @@ session optional pam_gnome_keyring.so auto_start
EOF
fi
# Greeter bewusst OHNE Fingerprint (eigene, fingerprint-freie Auth-Service,
# vgl. Noctalia-Doku "Fingerprint blocks password login"): system-auth
# enthaelt pam_fprintd (siehe oben). Am Login wuerde der Finger nie das
# Passwort liefern -> Keyring bliebe zu -> zweite Abfrage nach dem Login.
# Login daher nur per Passwort (Keyring oeffnet mit); Finger gilt fuer
# sudo/Polkit/Sperrbildschirm. Nur die auth-Zeile wird ersetzt, account/
# password/session-Includes bleiben (kein Finger-Prompt dort).
# Greeter bewusst OHNE Fingerprint (vgl. Noctalia-Doku "Fingerprint blocks
# password login"): system-auth enthaelt pam_fprintd (siehe oben). Am Login
# wuerde der Finger nie das Passwort liefern -> Keyring bliebe zu -> zweite
# Abfrage nach dem Login. Login daher nur per Passwort (Keyring oeffnet
# mit); Finger gilt fuer sudo/Polkit/Sperrbildschirm.
# Umsetzung: auth-Substack auf password-auth umhaengen. Dessen Template
# kennt keinen Fingerprint-Hook (nur pam_unix), waehrend system-auth den
# Fingerprint traegt. Substack-Semantik bleibt: Erfolg kehrt zurueck,
# nachgelagerte Keyring-Zeile laeuft mit Authtok -> Unlock (belegt).
# account/password/session-Includes bleiben unangetastet.
if grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+system-auth' /etc/pam.d/greetd; then
python3 - <<'PYEOF'
import re
p = "/etc/pam.d/greetd"
text = open(p).read()
replacement = (
"# fluffy-pancake: fingerprint-freier Auth-Stack NUR fuer greetd.\n"
"# (system-auth mit pam_fprintd wuerde Finger-Login ohne Keyring-Unlock\n"
"# bedeuten. faillock bewusst weggelassen wie im Profil ohne with-faillock.)\n"
"auth required pam_env.so\n"
"auth required pam_faildelay.so delay=2000000\n"
"auth sufficient pam_unix.so nullok\n"
"auth required pam_deny.so\n"
)
new, n = re.subn(r'^auth[ \t]+(?:substack|include)[ \t]+system-auth[ \t]*\r?$', replacement.rstrip("\n"), text, count=1, flags=re.M)
assert n == 1, "auth system-auth-Zeile in /etc/pam.d/greetd nicht gefunden"
open(p, "w").write(new)
print("greetd-PAM: fingerprint-freier Auth-Stack gesetzt")
PYEOF
# HINWEIS: kein `t;q1`-Konstrukt o.ae. Abbruch-Tricks im sed: `q` gilt
# pro Zeile und wuerde mit -i die Datei verkuerzen. Guard oben + Asserts
# unten sichern den Erfolg ab.
sed -i -E 's/^auth([[:space:]]+(substack|include)[[:space:]]+)system-auth([[:space:]]*)$/auth\1password-auth\3/' /etc/pam.d/greetd
echo "greetd-PAM: auth-Substack auf password-auth umgehaengt (fingerprint-frei)"
fi
grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+password-auth' /etc/pam.d/greetd || { echo "FEHLER: password-auth-Substack fehlt in /etc/pam.d/greetd"; exit 1; }
grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+system-auth' /etc/pam.d/greetd && { echo "FEHLER: auth system-auth-Include noch in /etc/pam.d/greetd"; exit 1; }
grep -q 'pam_gnome_keyring\.so' /etc/pam.d/greetd || { echo "FEHLER: Keyring-PAM fehlt in /etc/pam.d/greetd"; exit 1; }