-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11282 from mpurg/fix_no_empty_passwords
Fix and modify UBTU-20-010463 (no_empty_passwords)
- Loading branch information
Showing
6 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...ccounts/accounts-restrictions/password_storage/no_empty_passwords/tests/no_nullok.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
#!/bin/bash | ||
# platform = Oracle Linux 7,Red Hat Enterprise Linux 7,Red Hat Virtualization 4,multi_platform_fedora | ||
# platform = Oracle Linux 7,Red Hat Enterprise Linux 7,Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ubuntu | ||
|
||
{{% if 'ubuntu' in product %}} | ||
sed -i --follow-symlinks '/nullok/d' /etc/pam.d/common-auth | ||
sed -i --follow-symlinks '/nullok/d' /etc/pam.d/common-password | ||
{{% else %}} | ||
sed -i --follow-symlinks '/nullok/d' /etc/pam.d/system-auth | ||
sed -i --follow-symlinks '/nullok/d' /etc/pam.d/password-auth | ||
{{% endif %}} |
11 changes: 10 additions & 1 deletion
11
...ts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_present.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
#!/bin/bash | ||
# platform = Oracle Linux 7,Red Hat Enterprise Linux 7,Red Hat Virtualization 4,multi_platform_fedora | ||
# platform = Oracle Linux 7,Red Hat Enterprise Linux 7,Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ubuntu | ||
|
||
{{% if 'ubuntu' in product %}} | ||
for FILE in "/etc/pam.d/common-auth" "/etc/pam.d/common-password"; do | ||
if ! grep -q "^[^#].*pam_unix\.so.*nullok" ${FILE}; then | ||
sed -i 's/\([\s]pam_unix\.so\)/\1 nullok/g' ${FILE} | ||
fi | ||
done | ||
{{% else %}} | ||
SYSTEM_AUTH_FILE="/etc/pam.d/system-auth" | ||
|
||
if ! $(grep -q "^[^#].*pam_unix\.so.*nullok" $SYSTEM_AUTH_FILE); then | ||
sed -i --follow-symlinks 's/\([\s].*pam_unix\.so.*\)\s\(try_first_pass.*\)/\1nullok \2/' $SYSTEM_AUTH_FILE | ||
fi | ||
{{% endif %}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters