mirror of https://github.com/CISOfy/lynis.git
Added additional logging for KRNL-5830
This commit is contained in:
parent
39f24a57b9
commit
abbcd2f97e
|
@ -516,14 +516,18 @@
|
|||
LogText "Result: using ${MYKERNEL} as my kernel version (stripped)"
|
||||
FIND=`ls /boot/vmlinuz* 2> /dev/null`
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
LogText "Result: found ${FIND}"
|
||||
# Display kernels, extract version numbers and sort them numeric per column (up to 6 numbers)
|
||||
# Remove generic. and huge. for Slackware machines
|
||||
KERNELS=`ls /boot/vmlinuz* | sed 's/vmlinuz-//' | sed 's/generic.//' | sed 's/huge.//' | sed 's/\.[a-z].*.//g' | sed 's/-[a-z].*.//g' | sed 's./boot/..' | sed 's/-/./g' | sort -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -t \.`
|
||||
LogText "Output: ${KERNELS}"
|
||||
elif [ ! `ls /boot/kernel* 2> /dev/null` = "" ]; then
|
||||
LogText "Output: Found a kernel file in /boot"
|
||||
# Display kernels, extract version numbers and sort them numeric per column (up to 6 numbers)
|
||||
# Examples:
|
||||
# /boot/kernel-genkernel-x86_64-3.14.14-gentoo
|
||||
KERNELS=`ls /boot/kernel* | awk -F- '{ if ($2=="genkernel") { print $4 }}' | grep "^[0-9]" | sort -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -t \.`
|
||||
LogText "Output: ${KERNELS}"
|
||||
else
|
||||
ReportException "${TEST_NO}:2" "Can not find any vmlinuz or kernel files in /boot, which is unexpected"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue