Skip to content

Commit 0ee45b9

Browse files
committed
Merge branch 'master' of https://github.com/CISOfy/lynis
2 parents dde2299 + 59a3c4b commit 0ee45b9

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

include/functions

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,14 +2562,18 @@
25622562

25632563
GetTimestamp() {
25642564
ts=0
2565-
case "${OS}" in
2566-
"Linux")
2565+
# Detect if the implementation of date supports nanoseconds,
2566+
if [ "${OS}" = "Linux" ]; then
2567+
current_nanoseconds=$(date "+%N")
2568+
# Verify if the result of the command is a number
2569+
if [ -n "$current_nanoseconds" ] && [ "$current_nanoseconds" -eq "$current_nanoseconds" ] 2>/dev/null; then
25672570
ts=$(date "+%s%N")
2568-
;;
2569-
*)
2571+
else
25702572
ts=$(date "+%s")
2571-
;;
2572-
esac
2573+
fi
2574+
else
2575+
ts=$(date "+%s")
2576+
fi
25732577
echo $ts
25742578
}
25752579

include/tests_filesystems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@
744744
if [ ${SKIPTEST} -eq 0 ]; then
745745
LogText "Test: Checking locate database"
746746
FOUND=0
747-
LOCATE_DBS="${ROOTDIR}var/lib/mlocate/mlocate.db ${ROOTDIR}var/lib/locate/locatedb ${ROOTDIR}var/lib/locatedb ${ROOTDIR}var/lib/slocate/slocate.db ${ROOTDIR}var/cache/locate/locatedb ${ROOTDIR}var/db/locate.database"
747+
LOCATE_DBS="${ROOTDIR}var/cache/locate/locatedb ${ROOTDIR}var/db/locate.database ${ROOTDIR}var/lib/locate/locatedb ${ROOTDIR}var/lib/locatedb ${ROOTDIR}var/lib/mlocate/mlocate.db ${ROOTDIR}var/lib/plocate/plocate.db ${ROOTDIR}var/lib/slocate/slocate.db"
748748
for FILE in ${LOCATE_DBS}; do
749749
if [ -f ${FILE} ]; then
750750
LogText "Result: locate database found (${FILE})"

include/tests_ssh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
SSHOPS="AllowTcpForwarding:NO,LOCAL,YES:=\
136136
ClientAliveCountMax:2,4,16:<\
137137
ClientAliveInterval:300,600,900:<\
138-
Compression:NO,,YES:=\
139138
FingerprintHash:SHA256,MD5,:=\
140139
GatewayPorts:NO,,YES:=\
141140
IgnoreRhosts:YES,,NO:=\
@@ -158,12 +157,12 @@
158157
# OpenSSH had some options removed over time. Based on the version we add some additional options to check
159158
if [ ${OPENSSHD_VERSION_MAJOR} -lt 7 ]; then
160159
LogText "Result: added additional options for OpenSSH 6.x and lower"
161-
SSHOPS="${SSHOPS} UsePrivilegeSeparation:SANDBOX,YES,NO:= Protocol:2,,1:="
160+
SSHOPS="${SSHOPS} Compression:(DELAYED|NO),,YES:= UsePrivilegeSeparation:SANDBOX,YES,NO:= Protocol:2,,1:="
162161
elif [ ${OPENSSHD_VERSION_MAJOR} -eq 7 ]; then
163162
# Protocol 1 support removed (OpenSSH 7.4 and later)
164163
if [ ${OPENSSHD_VERSION_MINOR} -lt 4 ]; then
165164
LogText "Result: added additional options for OpenSSH < 7.4"
166-
SSHOPS="${SSHOPS} Protocol:2,,1:="
165+
SSHOPS="${SSHOPS} Compression:(DELAYED|NO),,YES:= Protocol:2,,1:="
167166
fi
168167
# UsePrivilegedSeparation removed (OpenSSH 7.5 and later)
169168
if [ ${OPENSSHD_VERSION_MINOR} -lt 5 ]; then

0 commit comments

Comments
 (0)