diff --git a/Containerfile b/Containerfile index a671df5..102de1d 100644 --- a/Containerfile +++ b/Containerfile @@ -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_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 -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; \ wrapper="$(command -v noctalia-greeter-session || true)"; \ echo "Gefundener Wrapper: ${wrapper}"; \ diff --git a/build/21-greetd.sh b/build/21-greetd.sh index 69df237..cb54d7e 100755 --- a/build/21-greetd.sh +++ b/build/21-greetd.sh @@ -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; }