From 9d4dc5f1c4496b27e49005f5e9a383b28b45619b Mon Sep 17 00:00:00 2001 From: samson Date: Sun, 9 Dec 2018 15:58:06 +0800 Subject: [PATCH] Fix bugs for 10.1.7 and 10.1.8 --- bin/hardening/10.1.7_remove_nopasswd_sudoers.sh | 2 +- bin/hardening/10.1.8_remove_noauthenticate_sudoers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hardening/10.1.7_remove_nopasswd_sudoers.sh b/bin/hardening/10.1.7_remove_nopasswd_sudoers.sh index a241b55..0132c06 100755 --- a/bin/hardening/10.1.7_remove_nopasswd_sudoers.sh +++ b/bin/hardening/10.1.7_remove_nopasswd_sudoers.sh @@ -33,7 +33,7 @@ audit () FNRET=1 else ok "$NOPASSWD is not set on $FILE, it's ok" - if [ $(grep -c $NOPASSWD $INCLUDFILE) -gt 0 ]; then + if [ $(grep $NOPASSWD $INCLUDFILE | wc -l) -gt 0 ]; then crit "$NOPASSWD is set on $INCLUDFILE, it's error conf" FNRET=1 else diff --git a/bin/hardening/10.1.8_remove_noauthenticate_sudoers.sh b/bin/hardening/10.1.8_remove_noauthenticate_sudoers.sh index 871bae9..cb79f11 100755 --- a/bin/hardening/10.1.8_remove_noauthenticate_sudoers.sh +++ b/bin/hardening/10.1.8_remove_noauthenticate_sudoers.sh @@ -33,7 +33,7 @@ audit () FNRET=1 else ok "$NOAUTH is not set on $FILE, it's ok" - if [ $(grep -c $NOAUTH $INCLUDFILE) -gt 0 ]; then + if [ $(grep $NOAUTH $INCLUDFILE | wc -l) -gt 0 ]; then crit "$NOAUTH is set on $INCLUDFILE, it's error conf" FNRET=1 else