Merge pull request #174951 from dpausp/fix-pam-tty-audit

This commit is contained in:
Naïm Favier 2022-11-01 23:50:58 +01:00 committed by GitHub
commit 814628a45d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -615,12 +615,12 @@ let
optionalString cfg.setLoginUid '' optionalString cfg.setLoginUid ''
session ${if config.boot.isContainer then "optional" else "required"} pam_loginuid.so session ${if config.boot.isContainer then "optional" else "required"} pam_loginuid.so
'' + '' +
optionalString cfg.ttyAudit.enable '' optionalString cfg.ttyAudit.enable (concatStringsSep " \\\n " ([
session required ${pkgs.pam}/lib/security/pam_tty_audit.so "session required ${pkgs.pam}/lib/security/pam_tty_audit.so"
open_only=${toString cfg.ttyAudit.openOnly} ] ++ optional cfg.ttyAudit.openOnly "open_only"
${optionalString (cfg.ttyAudit.enablePattern != null) "enable=${cfg.ttyAudit.enablePattern}"} ++ optional (cfg.ttyAudit.enablePattern != null) "enable=${cfg.ttyAudit.enablePattern}"
${optionalString (cfg.ttyAudit.disablePattern != null) "disable=${cfg.ttyAudit.disablePattern}"} ++ optional (cfg.ttyAudit.disablePattern != null) "disable=${cfg.ttyAudit.disablePattern}"
'' + )) +
optionalString cfg.makeHomeDir '' optionalString cfg.makeHomeDir ''
session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=${config.security.pam.makeHomeDir.skelDirectory} umask=0077 session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=${config.security.pam.makeHomeDir.skelDirectory} umask=0077
'' + '' +