You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Function/test: [KRNL-5730] produces an exception.
Error message from exception is incorrect: Message: No valid /bin/grep tool found to search kernel settings
A valid /bin/grep tool does exist on the system. When looking at the source searching "KRNL-5730" the following flow is done incorrectly:
@ line 269 LINUXCONFIGFILE_ZIPPED does eq to 1 (in my case) and sets GREPTOOL to ZGREPBINARY but when the ReportException is called @ line 282 it passes in GREPBINARY. It should pass in GREPTOOL.
## Test : KRNL-5730# Description : Checking default I/O kernel scheduler# Notes : This test could be extended with testing some of the specific devices like disks# cat /sys/block/sda/queue/scheduler
PREQS_MET="NO"if HasData "${LINUXCONFIGFILE}";thenif [ -f${LINUXCONFIGFILE} ];then PREQS_MET="YES";fifi
Register --test-no KRNL-5730 --os Linux --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking disk I/O kernel scheduler"if [ ${SKIPTEST}-eq 0 ];thenif [ ${LINUXCONFIGFILE_ZIPPED}-eq 1 ];then GREPTOOL="${ZGREPBINARY}";else GREPTOOL="${GREPBINARY}";fiif [ -n"${GREPTOOL}" ];then
LogText "Test: Checking the default I/O kernel scheduler"
LINUX_KERNEL_IOSCHED=$(${GREPTOOL}"CONFIG_DEFAULT_IOSCHED"${LINUXCONFIGFILE}|${AWKBINARY} -F= '{ print $2 }'|${SEDBINARY} s/\"//g)if [ -n"${LINUX_KERNEL_IOSCHED}" ];then
LogText "Result: found IO scheduler '${LINUX_KERNEL_IOSCHED}'"
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result "${STATUS_FOUND}" --color GREEN
Report "linux_kernel_io_scheduler[]=${LINUX_KERNEL_IOSCHED}"else
LogText "Result: no default I/O kernel scheduler found"
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result "${STATUS_NOT_FOUND}" --color WHITE
fielse
ReportException "${TEST_NO}""No valid ${GREPBINARY} tool found to search kernel settings"fifi#
Version
Distribution; Buildroot 2021.02.12; Linux BSP: 3.47
Lynis version Lynis 3.0.9
Expected behavior
No exception expected, error should be properly handled.
Output
If applicable, add output that you get from the tool or the related section of lynis.log
18:26:05 [+] Kernel
18:26:05 ------------------------------------
18:26:05 - Checking default run level [ 3 ]
18:26:05 - Checking kernel version and release [ DONE ]
18:26:06 - Checking kernel type [ DONE ]
18:26:06 - Checking loaded kernel modules [ DONE ]
18:26:06 - Checking Linux kernel configuration file [ FOUND ]
18:26:06
18:26:06 =================================================================
18:26:06
18:26:06 Exception found!
18:26:06
18:26:06 Function/test: [KRNL-5730]
18:26:06 Message: No valid /bin/grep tool found to search kernel settings
18:26:06
Additional context
The text was updated successfully, but these errors were encountered:
Do you have zgrep installed/available in your path? It doesn't make sense for the ReportException message text to use GREPTOOL, because it's blank (that's the only way that check would fall). Even GREPBINARY is technically wrong, since GREPTOOL might not be set to that.
Since you said LINUXCONFIGFILE_ZIPPED is 1, it tries to set GREPTOOL to ZGREPBINARY, which means ZGREPBINARY is blank, and it shows the exception.
Your ultimate issue is zgrep can't be found, which is required to search the compressed Linux config file.
Describe the bug
Function/test: [KRNL-5730] produces an exception.
Error message from exception is incorrect:
Message: No valid /bin/grep tool found to search kernel settings
A valid /bin/grep tool does exist on the system. When looking at the source searching "KRNL-5730" the following flow is done incorrectly:
Version
Expected behavior
No exception expected, error should be properly handled.
Output
If applicable, add output that you get from the tool or the related section of lynis.log
18:26:05 [+] Kernel
18:26:05 ------------------------------------
18:26:05 - Checking default run level [ 3 ]
18:26:05 - Checking kernel version and release [ DONE ]
18:26:06 - Checking kernel type [ DONE ]
18:26:06 - Checking loaded kernel modules [ DONE ]
18:26:06 - Checking Linux kernel configuration file [ FOUND ]
18:26:06
18:26:06 =================================================================
18:26:06
18:26:06 Exception found!
18:26:06
18:26:06 Function/test: [KRNL-5730]
18:26:06 Message: No valid /bin/grep tool found to search kernel settings
18:26:06
Additional context
The text was updated successfully, but these errors were encountered: