From 74a6bb379fecfc7c0013b0836dc5c19b86d05070 Mon Sep 17 00:00:00 2001 From: Samson-W Date: Tue, 14 Jan 2020 15:40:32 +0800 Subject: [PATCH] Fix some bug for 9.2.14 --- bin/hardening/9.2.14_pam_auth_without_nullpwd_unix.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/hardening/9.2.14_pam_auth_without_nullpwd_unix.sh b/bin/hardening/9.2.14_pam_auth_without_nullpwd_unix.sh index d2e7a45..1edc536 100755 --- a/bin/hardening/9.2.14_pam_auth_without_nullpwd_unix.sh +++ b/bin/hardening/9.2.14_pam_auth_without_nullpwd_unix.sh @@ -63,7 +63,7 @@ audit_redhat () { audit () { if [ $OS_RELEASE -eq 1 ]; then audit_debian - elif [ $OS_RELEASE -eq 1 ]; then + elif [ $OS_RELEASE -eq 2 ]; then audit_redhat else crit "Current OS is not support!" @@ -95,6 +95,7 @@ apply_redhat () { if [ $FNRET = 0 ]; then crit "$OPTIONNAME is configured in $FILE" info "Delete option $OPTIONNAME from $FILE" + backup_file $FILE sed -i "s/$OPTIONNAME//" $FILE else ok "$OPTIONNAME is not configured in $FILE" @@ -106,7 +107,7 @@ apply_redhat () { apply () { if [ $OS_RELEASE -eq 1 ]; then apply_debian - elif [ $OS_RELEASE -eq 1 ]; then + elif [ $OS_RELEASE -eq 2 ]; then apply_redhat else crit "Current OS is not support!"