From 0c602541a35a5a01f3a22e82002bde0e66b514d6 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 14 Jul 2019 06:32:44 -0400 Subject: [PATCH] nixos/lightdm: fix pam rules Rules are a translation of what's done in the GDM module and adjustments based of looking at Arch Linux's configuration and upstream's. A side effect of this change is that gnome-keyring and kwallet modules should work as expected when in- cluded. Fixes #64259 #62045 --- .../services/x11/display-managers/lightdm.nix | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 9aed255f878a..2d421e4d6cd9 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -232,36 +232,41 @@ in # Enable the accounts daemon to find lightdm's dbus interface environment.systemPackages = [ lightdm ]; - security.pam.services.lightdm = { - allowNullPassword = true; - startSession = true; - }; - security.pam.services.lightdm-greeter = { - allowNullPassword = true; - startSession = true; - text = '' - auth required pam_env.so envfile=${config.system.build.pamEnvironment} - auth required pam_permit.so + security.pam.services.lightdm.text = '' + auth substack login + account include login + password substack login + session include login + ''; - account required pam_permit.so + security.pam.services.lightdm-greeter.text = '' + auth required pam_succeed_if.so audit quiet_success user = lightdm + auth optional pam_permit.so - password required pam_deny.so + account required pam_succeed_if.so audit quiet_success user = lightdm + account sufficient pam_unix.so + + password required pam_deny.so + + session required pam_succeed_if.so audit quiet_success user = lightdm + session required pam_env.so envfile=${config.system.build.pamEnvironment} + session optional ${pkgs.systemd}/lib/security/pam_systemd.so + session optional pam_keyinit.so force revoke + session optional pam_permit.so + ''; - session required pam_env.so envfile=${config.system.build.pamEnvironment} - session required pam_unix.so - session optional ${pkgs.systemd}/lib/security/pam_systemd.so - ''; - }; security.pam.services.lightdm-autologin.text = '' - auth requisite pam_nologin.so - auth required pam_succeed_if.so uid >= 1000 quiet - auth required pam_permit.so + auth requisite pam_nologin.so - account include lightdm + auth required pam_succeed_if.so uid >= 1000 quiet + auth required pam_permit.so - password include lightdm + account sufficient pam_unix.so - session include lightdm + password requisite pam_unix.so nullok sha512 + + session optional pam_keyinit.so revoke + session include login ''; users.users.lightdm = {