Skip to content

Commit

Permalink
Update tests of accounts_password_pam_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Dec 2, 2024
1 parent bb219fc commit d0c1d87
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ for file in ${configuration_files[@]}; do
"/etc/authselect/custom/testingProfile/$file"
done
authselect select --force custom/testingProfile
{{% elif 'ubuntu' in product %}}
rm -f /usr/share/pam-configs/*pwquality
DEBIAN_FRONTEND=noninteractive pam-auth-update
{{% else %}}
for file in ${configuration_files[@]}; do
sed -i --follow-symlinks "/pam_pwquality\.so/d" "/etc/pam.d/$file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

source common.sh

{{% if 'ubuntu' in product %}}
cat << EOF > /usr/share/pam-configs/pwquality
Name: Pwquality password strength checking
Default: yes
Priority: 1024
Conflicts: cracklib
Password-Type: Primary
Password:
requisite pam_pwquality.so retry=3
EOF

DEBIAN_FRONTEND=noninteractive pam-auth-update
{{% else %}}
for file in ${configuration_files[@]}; do
{{{ bash_ensure_pam_module_option('/etc/pam.d/$file',
'password',
Expand All @@ -13,3 +26,4 @@ for file in ${configuration_files[@]}; do
'3',
'^\s*account') }}}
done
{{% endif %}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

source common.sh

{{% if 'ubuntu' in product %}}
cat << EOF > /usr/share/pam-configs/pwquality
Name: Pwquality password strength checking
Default: yes
Priority: 1024
Conflicts: cracklib
Password-Type: Primary
Password:
requisite pam_pwquality.so retry=7
EOF

DEBIAN_FRONTEND=noninteractive pam-auth-update
{{% else %}}
for file in ${configuration_files[@]}; do
{{{ bash_ensure_pam_module_option('/etc/pam.d/$file',
'password',
Expand All @@ -13,3 +26,5 @@ for file in ${configuration_files[@]}; do
'7',
'^\s*account') }}}
done
{{% endif %}}

0 comments on commit d0c1d87

Please sign in to comment.