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

+1
View File
@@ -172,6 +172,7 @@ RUN set -u; \
test -f /usr/lib64/security/pam_gnome_keyring.so || { echo "FEHLER: pam_gnome_keyring.so fehlt (Paket gnome-keyring-pam?)"; exit 1; }; \ test -f /usr/lib64/security/pam_gnome_keyring.so || { echo "FEHLER: pam_gnome_keyring.so fehlt (Paket gnome-keyring-pam?)"; exit 1; }; \
test -f /usr/lib64/security/pam_fprintd.so || { echo "FEHLER: pam_fprintd.so fehlt (Paket fprintd-pam?)"; exit 1; }; \ test -f /usr/lib64/security/pam_fprintd.so || { echo "FEHLER: pam_fprintd.so fehlt (Paket fprintd-pam?)"; exit 1; }; \
grep -q 'pam_fprintd\.so' /etc/pam.d/system-auth || { echo "FEHLER: pam_fprintd fehlt in system-auth (authselect with-fingerprint?)"; exit 1; }; \ grep -q 'pam_fprintd\.so' /etc/pam.d/system-auth || { echo "FEHLER: pam_fprintd fehlt in system-auth (authselect with-fingerprint?)"; exit 1; }; \
grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+password-auth' /etc/pam.d/greetd || { echo "FEHLER: greetd nutzt nicht password-auth (fingerprint-frei erwartet)"; exit 1; }; \
grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+system-auth' /etc/pam.d/greetd && { echo "FEHLER: greetd nutzt system-auth mit Fingerprint (Keyring wuerde nie entsperren)"; exit 1; } || true; \ grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+system-auth' /etc/pam.d/greetd && { echo "FEHLER: greetd nutzt system-auth mit Fingerprint (Keyring wuerde nie entsperren)"; exit 1; } || true; \
wrapper="$(command -v noctalia-greeter-session || true)"; \ wrapper="$(command -v noctalia-greeter-session || true)"; \
echo "Gefundener Wrapper: ${wrapper}"; \ echo "Gefundener Wrapper: ${wrapper}"; \
+16 -25
View File
@@ -75,33 +75,24 @@ session optional pam_gnome_keyring.so auto_start
EOF EOF
fi fi
# Greeter bewusst OHNE Fingerprint (eigene, fingerprint-freie Auth-Service, # Greeter bewusst OHNE Fingerprint (vgl. Noctalia-Doku "Fingerprint blocks
# vgl. Noctalia-Doku "Fingerprint blocks password login"): system-auth # password login"): system-auth enthaelt pam_fprintd (siehe oben). Am Login
# enthaelt pam_fprintd (siehe oben). Am Login wuerde der Finger nie das # wuerde der Finger nie das Passwort liefern -> Keyring bliebe zu -> zweite
# Passwort liefern -> Keyring bliebe zu -> zweite Abfrage nach dem Login. # Abfrage nach dem Login. Login daher nur per Passwort (Keyring oeffnet
# Login daher nur per Passwort (Keyring oeffnet mit); Finger gilt fuer # mit); Finger gilt fuer sudo/Polkit/Sperrbildschirm.
# sudo/Polkit/Sperrbildschirm. Nur die auth-Zeile wird ersetzt, account/ # Umsetzung: auth-Substack auf password-auth umhaengen. Dessen Template
# password/session-Includes bleiben (kein Finger-Prompt dort). # 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 if grep -Eq '^auth[[:space:]]+(substack|include)[[:space:]]+system-auth' /etc/pam.d/greetd; then
python3 - <<'PYEOF' # HINWEIS: kein `t;q1`-Konstrukt o.ae. Abbruch-Tricks im sed: `q` gilt
import re # pro Zeile und wuerde mit -i die Datei verkuerzen. Guard oben + Asserts
p = "/etc/pam.d/greetd" # unten sichern den Erfolg ab.
text = open(p).read() sed -i -E 's/^auth([[:space:]]+(substack|include)[[:space:]]+)system-auth([[:space:]]*)$/auth\1password-auth\3/' /etc/pam.d/greetd
replacement = ( echo "greetd-PAM: auth-Substack auf password-auth umgehaengt (fingerprint-frei)"
"# 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
fi 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 -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; } grep -q 'pam_gnome_keyring\.so' /etc/pam.d/greetd || { echo "FEHLER: Keyring-PAM fehlt in /etc/pam.d/greetd"; exit 1; }