diff options
author | 2021-01-30 22:50:12 +0300 | |
---|---|---|
committer | 2021-01-31 21:36:01 +0000 | |
commit | 5a545eb14a1220af1ba8031f3669471e77edbc2f (patch) | |
tree | 14979af6881f7b0bae3a26eac4022adad1990185 | |
parent | Add systemd-homed support (diff) | |
download | pambase-5a545eb14a1220af1ba8031f3669471e77edbc2f.tar.gz pambase-5a545eb14a1220af1ba8031f3669471e77edbc2f.tar.bz2 pambase-5a545eb14a1220af1ba8031f3669471e77edbc2f.zip |
systemd-auth: add systemd-homed support
Signed-off-by: Mikle KOlyada <zlogene@gentoo.org>
Closes: https://github.com/gentoo/pambase/pull/5
Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-x | pambase.py | 1 | ||||
-rw-r--r-- | templates/system-auth.tpl | 18 | ||||
-rw-r--r-- | templates/system-session.tpl | 4 |
3 files changed, 21 insertions, 2 deletions
@@ -15,6 +15,7 @@ def main(): parser.add_argument('--pwquality', action="store_true", help='enable pam_pwquality.so module') parser.add_argument('--elogind', action="store_true", help='enable pam_elogind.so module') parser.add_argument('--systemd', action="store_true", help='enable pam_systemd.so module') + parser.add_argument('--homed', action="store_true", help='enable pam_systemd_home.so module') parser.add_argument('--selinux', action="store_true", help='enable pam_selinux.so module') parser.add_argument('--mktemp', action="store_true", help='enable pam_mktemp.so module') parser.add_argument('--pam-ssh', action="store_true", help='enable pam_ssh.so module') diff --git a/templates/system-auth.tpl b/templates/system-auth.tpl index 53557dc..174aacf 100644 --- a/templates/system-auth.tpl +++ b/templates/system-auth.tpl @@ -11,11 +11,16 @@ auth [success=3 default=ignore] pam_krb5.so {{ krb5_params }} {% endif %} auth requisite pam_faillock.so preauth -auth [success=1 default=ignore] pam_unix.so {{ nullok|default('', true) }} {{ debug|default('', true) }} try_first_pass +{% if homed %} +auth [success=2 default=ignore] pam_unix.so {{ nullok|default('', true) }} {{ debug|default('', true) }} try_first_pass +auth [success=1 default=ignore] pam_systemd_home.so +{% else %} +auth [success=1 default=ignore] pam_unix.so {{ nullok|default('', true) }} {{ debug|default('', true) }} try_first_pas +{% endif %} auth [default=die] pam_faillock.so authfail {% if caps %} --auth optional pam_cap.so +auth optional pam_cap.so {% endif %} {% if homed %} @@ -24,6 +29,11 @@ auth [default=die] pam_faillock.so authfail {% if krb5 %} account [success=2 default=ignore] pam_krb5.so {{ krb5_params }} {% endif %} + +{% if homed %} +account [success=1 default=ignore] pam_systemd_home.so +{% endif %} + account required pam_unix.so {{ debug|default('', true) }} account required pam_faillock.so @@ -43,6 +53,10 @@ password required pam_pwhistory.so use_authtok remember=5 retry=3 password [success=1 default=ignore] pam_krb5.so {{ krb5_params }} {% endif %} +{% if homed %} +password [success=1 default=ignore] pam_systemd_home.so +{% endif %} + {% if passwdqc or pwquality %} password required pam_unix.so try_first_pass {{ unix_authtok|default('', true) }} {{ nullok|default('', true) }} {{ unix_extended_encryption|default('', true) }} {{ debug|default('', true) }} {% else %} diff --git a/templates/system-session.tpl b/templates/system-session.tpl index 3dd1d70..48653d4 100644 --- a/templates/system-session.tpl +++ b/templates/system-session.tpl @@ -12,4 +12,8 @@ session optional pam_mktemp.so session [success=1 default=ignore] pam_krb5.so {{ krb5_params }} {% endif %} +{% if homed %} +session [success=1 default=ignore] pam_systemd_home.so +{% endif %} + session required pam_unix.so {{ debug|default('', true) }} |