Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FILE-6344] Invalid check on the kernel version #1367

Open
pyllyukko opened this issue Jan 8, 2023 · 2 comments
Open

[FILE-6344] Invalid check on the kernel version #1367

pyllyukko opened this issue Jan 8, 2023 · 2 comments

Comments

@pyllyukko
Copy link
Contributor

Describe the bug
There's a bug in the check for prerequirements where the kernel version is checked:

        LINUX_KERNEL_MAJOR=$(echo $OS_KERNELVERSION | ${AWKBINARY} -F. '{print $1}')
        LINUX_KERNEL_MINOR=$(echo $OS_KERNELVERSION | ${AWKBINARY} -F. '{print $2}')
        if [ -n "${LINUX_KERNEL_MAJOR}" -a -n "${LINUX_KERNEL_MINOR}" ]; then
            if [ ${LINUX_KERNEL_MAJOR} -ge 3 -a ${LINUX_KERNEL_MINOR} -ge 3 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi

It should check that the kernel is newer than 3.3, but the test is written as such, that all minor versions below 3 will fail this test, even though the major version would be > 3. E.g. 4.[012], 5.[012] etc.

Version

  • Lynis version 3.0.8

Expected behavior
E.g. Linux kernel version 6.0.0 would fulfil the prerequirements.

Output
Prerequirements are not met if kernel's minor version is below 3.

@xnoguer
Copy link
Contributor

xnoguer commented Apr 26, 2023

#1388

@xnoguer
Copy link
Contributor

xnoguer commented Apr 26, 2023

@pyllyukko Could you please try this pull request?
#1388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants