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>2014-12-09 01:57:47 +0300
committermboelen <michael@cisofy.com>2014-12-09 01:57:47 +0300
commit4a5fe6d2016247522527a63e70b6d2fc1b21b864 (patch)
tree3d5185af5440879aed9394773ed01ff9fc8c3916
parent0f8781a82707fff47fbb97a5ffaf13b62139e0fa (diff)
Check ntpdate for other systems than only FreeBSD, NTP no longer required for virtual machines
-rw-r--r--include/tests_time19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/tests_time b/include/tests_time
index f83d6b71..d7be5beb 100644
--- a/include/tests_time
+++ b/include/tests_time
@@ -149,9 +149,9 @@
logtext "Result: file /etc/network/if-up.d/ntpdate does not exist"
fi
- if [ "${OS}" = "FreeBSD" ]; then
- logtext "Test: Checking if ntpdate is enabled at startup in FreeBSD"
- if [ -f /etc/rc.conf ]; then
+ # Configuration file for *BSD
+ if [ -f /etc/rc.conf ]; then
+ logtext "Test: Checking if ntpdate is enabled at startup in *BSD"
FIND=`grep 'ntpdate_enable="YES"' /etc/rc.conf`
if [ ! "${FIND}" = "" ]; then
logtext "Result: ntpdate is enabled in rc.conf"
@@ -162,14 +162,17 @@
else
logtext "Result: ntpdate is not enabled in rc.conf"
fi
- fi
fi
if [ ${FOUND} -eq 0 ]; then
- Display --indent 2 --text "- Checking for a running NTP daemon or client" --result WARNING --color RED
- logtext "Result: Could not find a NTP daemon or client"
- ReportSuggestion ${TEST_NO} "Use NTP daemon or NTP client to prevent time issues."
- AddHP 0 2
+ if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
+ logtext "Result: Skipping display warning, as virtual machines usually don't need time synchronization in the VM itself"
+ else
+ Display --indent 2 --text "- Checking for a running NTP daemon or client" --result WARNING --color RED
+ logtext "Result: Could not find a NTP daemon or client"
+ ReportSuggestion ${TEST_NO} "Use NTP daemon or NTP client to prevent time issues."
+ AddHP 0 2
+ fi
else
Display --indent 2 --text "- Checking for a running NTP daemon or client" --result OK --color GREEN
logtext "Result: Found a time syncing daemon/client."