Skip to content

Commit

Permalink
Clean up duplicated tests
Browse files Browse the repository at this point in the history
Fix the test for Ubuntu
  • Loading branch information
alanmcanonical committed Nov 29, 2024
1 parent 0845044 commit d0afc12
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 355 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
{{% if 'debian' in product %}}
<value>^\s*auth\s+required\s+pam_faillock\.so.*preauth.*[\s\S]*^\s*auth.*pam_unix\.so[\s\S]*^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail[\s\S]*^\s*auth\s+sufficient\s+pam_faillock\.so\s+authsucc</value>
{{% elif 'ubuntu' in product %}}
<value>^\s*auth\s+(requisite|require)\s+pam_faillock\.so.*preauth.*[\s\S]*^\s*auth.*pam_unix\.so[\s\S]*^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail</value>
<value>^\s*auth\s+(requisite|required)\s+pam_faillock\.so.*preauth.*[\s\S]*^\s*auth.*pam_unix\.so[\s\S]*^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail</value>
{{% elif 'openeuler' in product or 'kylinserver' in product %}}
<value>^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+preauth[\s\S]*^[\s]*auth[\s]+(sufficient|\[(?=.*\bsuccess=done\b)?(?=.*?\bnew_authtok_reqd=done\b)?(?=.*?\bdefault=ignore\b)?.*\])[\s]+pam_unix\.so[\s\S]*^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=die\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+authfail</value>
{{% else %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#!/bin/bash
# platform = multi_platform_ubuntu

source ubuntu_common.sh

rm -f /usr/share/cac_faillock*
pam-auth-update

sed -i 's/\(^.*pam_faillock\.so.*\)/# \1/' /etc/pam.d/common-auth
sed -i 's/\(^.*pam_faillock\.so.*\)/# \1/' /etc/pam.d/common-account
rm -f /usr/share/pam-configs/cac_faillock*

DEBIAN_FRONTEND=noninteractive pam-auth-update

echo "#deny=1" > /etc/security/faillock.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
# platform = multi_platform_ubuntu

source ubuntu_common.sh

{{{ bash_enable_pam_faillock_directly_in_pam_files() }}}
echo "deny=1" > /etc/security/faillock.conf
Loading

0 comments on commit d0afc12

Please sign in to comment.