mirror of https://github.com/CISOfy/lynis.git
Add check for other clock files for earlier systemd versions
This commit is contained in:
parent
dabac5bf89
commit
84fd612c91
|
@ -574,8 +574,17 @@
|
|||
|
||||
|
||||
Register --test-no TIME-3185 --preqs-met "${PREQS_MET}" --weight L --network NO --category "security" --description "Check systemd-timesyncd synchronized time"
|
||||
SYNCHRONIZED_FILE="/var/lib/systemd/timesync/clock"
|
||||
SYNCHRONIZED_FILE="/run/systemd/timesync/synchronized"
|
||||
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
# On earlier systemd versions (237), '/run/systemd/timesync/synchronized' does not exist, so use '/var/lib/systemd/timesync/clock'
|
||||
if [ ! -e "${SYNCHRONIZED_FILE}" ]; then
|
||||
SYNCHRONIZED_FILE="/var/lib/systemd/timesync/clock"
|
||||
fi
|
||||
# DynamicUser=yes moves the clock file to '/var/lib/private/systemd/timesync/clock'
|
||||
if [ ! -e "${SYNCHRONIZED_FILE}" ]; then
|
||||
SYNCHRONIZED_FILE="/var/lib/private/systemd/timesync/clock"
|
||||
fi
|
||||
if [ -e "${SYNCHRONIZED_FILE}" ]; then
|
||||
FIND=$(( $(date +%s) - $(${STATBINARY} -L --format %Y "${SYNCHRONIZED_FILE}") ))
|
||||
# Check if last sync was more than 2048 seconds (= the default of systemd) ago
|
||||
|
|
Loading…
Reference in New Issue