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

small bug in /usr/share/lynis/include/tests_kernel line 695 #1529

Open
garberw opened this issue Jul 26, 2024 · 1 comment
Open

small bug in /usr/share/lynis/include/tests_kernel line 695 #1529

garberw opened this issue Jul 26, 2024 · 1 comment

Comments

@garberw
Copy link

garberw commented Jul 26, 2024

Describe the bug
/usr/share/lynis/include/tests_kernel line 695 is generating the error

line 695
                        FOUND_VMLINUZ=$(${LSBINARY} -v ${ROOTDIR}boot/vm[l0-9]* 2> /dev/null | ${GREPBINARY} -v '\-rescue\-' | ${TAILBINARY} -1)
grep: warning: stray \ before -

for the same reason

root@electron# mybug=$(ls -v /boot/vm[l0-9]* | grep -v '\-rescue\-' | tail -1)
grep: warning: stray \ before -
root@electron# echo $mybug
/boot/vmlinuz-6.9.10-200.fc40.x86_64

Version

  • Distribution
  • fedora 40
  • Lynis version
    3.1.1

Expected behavior
it works but perhaps something is wrong with this command

@garberw
Copy link
Author

garberw commented Jul 29, 2024

root@electron# FOUND_VMLINUZ=$(ls -v /boot/vm[l0-9]* 2> /dev/null | grep -v '\-rescue-' | tail -1)
root@electron# echo $FOUND_VMLINUZ 
/boot/vmlinuz-6.9.11-200.fc40.x86_64

the solution is that you need grep -v '\-rescue-' and not grep -v '\-rescue\-'
the second one has a backslash on the second '-' which is wrong.

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

1 participant