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>2016-11-20 18:16:02 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-11-20 18:16:02 +0300
commitd7ed46ae9ed898c2a45729aff89812de974b77f6 (patch)
tree40f54712d8a0a2cf421e45e320b7a9d632bbc414
parentcdff4999b999ad052b02d6d8b468ff3bf6916a1f (diff)
[KRNL-5788] Remove exception, style improvements
-rw-r--r--include/tests_kernel15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/tests_kernel b/include/tests_kernel
index b1ed421f..9938554f 100644
--- a/include/tests_kernel
+++ b/include/tests_kernel
@@ -375,25 +375,24 @@
LogText "Result: found /usr/bin/apt-cache"
LogText "Test: checking readlink location of /vmlinuz"
if [ -f /vmlinuz ]; then
- FINDKERNFILE=`readlink -f /vmlinuz`
+ FINDKERNFILE=$(readlink -f /vmlinuz)
LogText "Output: readlink reported file ${FINDKERNFILE}"
LogText "Test: checking package from dpkg -S"
- FINDKERNEL=`dpkg -S ${FINDKERNFILE} 2> /dev/null | ${AWKBINARY} -F : '{print $1}'`
+ FINDKERNEL=$(dpkg -S ${FINDKERNFILE} 2> /dev/null | ${AWKBINARY} -F : '{print $1}')
LogText "Output: dpkg -S reported package ${FINDKERNEL}"
elif [ -e /dev/grsec ]; then
- FINDKERNEL=linux-image-`uname -r`
+ FINDKERNEL=linux-image-$(uname -r)
LogText "/vmlinuz missing due to grsecurity; assuming ${FINDKERNEL}"
else
LogText "This system is missing /vmlinuz. Unable to check whether kernel is up-to-date."
- ReportException "${TEST_NO}:00|Missing /vmlinuz"
- ReportSuggestion ${TEST_NO} "Discover why /vmlinuz is missing. Consider manually re-linking."
+ ReportSuggestion ${TEST_NO} "Determine why /vmlinuz is missing on this Debian/Ubuntu system." "/vmlinuz"
fi
LogText "Test: Using apt-cache policy to determine if there is an update available"
- FINDINST=`apt-cache policy ${FINDKERNEL} | ${EGREPBINARY} 'Installed' | ${CUTBINARY} -d ':' -f2 | ${TRBINARY} -d ' '`
- FINDCAND=`apt-cache policy ${FINDKERNEL} | ${EGREPBINARY} 'Candidate' | ${CUTBINARY} -d ':' -f2 | ${TRBINARY} -d ' '`
+ FINDINST=$(apt-cache policy ${FINDKERNEL} | ${EGREPBINARY} 'Installed' | ${CUTBINARY} -d ':' -f2 | ${TRBINARY} -d ' ')
+ FINDCAND=$(apt-cache policy ${FINDKERNEL} | ${EGREPBINARY} 'Candidate' | ${CUTBINARY} -d ':' -f2 | ${TRBINARY} -d ' ')
LogText "Kernel installed: ${FINDINST}"
LogText "Kernel candidate: ${FINDCAND}"
- if [ "${FINDINST}" = "" ]; then
+ if [ -z "${FINDINST}" ]; then
Display --indent 2 --text "- Checking for available kernel update" --result "${STATUS_UNKNOWN}" --color YELLOW
LogText "Result: Exception occured, no output from apt-cache policy"
ReportException "${TEST_NO}:01"