From e1a87794bce6460113935d35a1053bc5a74808db Mon Sep 17 00:00:00 2001 From: Alexander Lobodzinski Date: Thu, 3 Sep 2015 17:20:34 +0200 Subject: [PATCH] Do not let a hostname that is contained in "localhost" like "cal" trigger a false positive --- include/tests_nameservices | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tests_nameservices b/include/tests_nameservices index 0a7b8d56..8413e99e 100644 --- a/include/tests_nameservices +++ b/include/tests_nameservices @@ -587,7 +587,7 @@ Register --test-no NAME-4406 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check server hostname mapping" if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: Check server hostname not locally mapped in /etc/hosts" - sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | egrep '(localhost|^::1\s)' | grep ${HOSTNAME}` + sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | egrep '(localhost|^::1\s)' | grep -w ${HOSTNAME}` if [ ! "${sFIND}" = "" ]; then logtext "Result: Found this server hostname mapped to a local address" Display --indent 4 --text "- Checking /etc/hosts (localhost)" --result SUGGESTION --color YELLOW