Skip to content

Commit 22702c6

Browse files
Add sle15 related changes to bash pam_faillock macros
1 parent 4d322e8 commit 22702c6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shared/macros/10-bash.jinja

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,16 @@ authselect enable-feature {{{ feature }}}
802802

803803
#}}
804804
{{%- macro bash_enable_pam_faillock_directly_in_pam_files() -%}}
805-
{{% if 'debian' in product %}}
805+
{{% if 'debian' in product or 'sle15' in product %}}
806806
pam_file="/etc/pam.d/common-auth"
807807
if ! grep -qE '^\s*auth\s+required\s+pam_faillock\.so\s+preauth.*$' "$pam_file" ; then
808+
{{% if 'sle15' in product %}}
809+
# insert before pam_unix.so
810+
sed -i --follow-symlinks '/^auth.*required.*pam_unix\.so.*/i auth required pam_faillock.so preauth' "$pam_file"
811+
{{% else %}}
808812
# insert at the top
809813
sed -i --follow-symlinks '/^# here are the per-package modules/i auth required pam_faillock.so preauth' "$pam_file"
814+
{{% endif %}}
810815
fi
811816
if ! grep -qE '^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail.*$' "$pam_file" ; then
812817

@@ -1136,7 +1141,7 @@ fi
11361141

11371142
#}}
11381143
{{%- macro bash_pam_faillock_parameter_value(option, value='', authfail=True) -%}}
1139-
{{% if 'ubuntu' in product or 'debian' in product %}}
1144+
{{% if 'ubuntu' in product or 'debian' in product or 'sle15' in product %}}
11401145
AUTH_FILES=("/etc/pam.d/common-auth")
11411146
SKIP_FAILLOCK_CHECK=true
11421147
{{% else %}}

0 commit comments

Comments
 (0)