Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2016-03-12 21:08:23 +0300
committermboelen <michael@cisofy.com>2016-03-12 21:08:23 +0300
commitbd833057e1d8af55ea3ff2e4658d7a867b69d685 (patch)
treecb9c861fb891f494c7bcfa5e2b4639a536888cb6 /include/tests_nameservices
parent7f34f9dece91d075ee42695c3ec32a2b91cd9f1f (diff)
NAME-4406: adjusted filter for localhost detection + logging
Diffstat (limited to 'include/tests_nameservices')
-rw-r--r--include/tests_nameservices3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/tests_nameservices b/include/tests_nameservices
index 4115f678..6865da73 100644
--- a/include/tests_nameservices
+++ b/include/tests_nameservices
@@ -640,9 +640,10 @@
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=`egrep -v '^(#|$)' /etc/hosts | egrep '(localhost|^::1\s)' | grep -w ${HOSTNAME}`
+ sFIND=`egrep -v '^(#|$)' /etc/hosts | egrep '^(localhost|::1)\s' | grep -w ${HOSTNAME}`
if [ ! "${sFIND}" = "" ]; then
LogText "Result: Found this server hostname mapped to a local address"
+ LogText "Output: ${sFIND}"
Display --indent 4 --text "- Checking /etc/hosts (localhost)" --result SUGGESTION --color YELLOW
LogText "Information: Linking the hostname to the localhost entry may break some resolving. Split resolving so that localhost resolves back to 127.0.0.1 (and ::1) and the hostname of the machine to the real IP address on the network interface."
ReportSuggestion ${TEST_NO} "Split resolving between localhost and the hostname of the system"