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:
authorMichael Boelen <michael.boelen@cisofy.com>2020-06-21 14:14:08 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2020-06-21 14:14:08 +0300
commit6d9b530bf493e83c423c7c4058b4bbb44a85db46 (patch)
tree851531f6fb69224fde421470a68cc8d8bdfebc52 /include/tests_kernel
parentaebd5ed9b340376dc9a3e19b0108217850d87d31 (diff)
[KRNL-5830] improved detection for non-symlinked kernel on disk
Diffstat (limited to 'include/tests_kernel')
-rw-r--r--include/tests_kernel5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/tests_kernel b/include/tests_kernel
index 72e5082b..d445bb65 100644
--- a/include/tests_kernel
+++ b/include/tests_kernel
@@ -674,7 +674,10 @@
LogText "Result: found a symlink, retrieving destination"
FOUND_VMLINUZ=$(readlink "${FOUND_VMLINUZ}")
LogText "Result: destination file is ${FOUND_VMLINUZ}"
- VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's/^vmlinuz-//')
+ VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//')
+ LogText "Result: version derived from file name is '${VERSION_ON_DISK}'"
+ elif [ -f "${FOUND_VMLINUZ}" ]; then
+ VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//')
LogText "Result: version derived from file name is '${VERSION_ON_DISK}'"
fi