Open Obema12 opened 2 years ago
On what operating system and version are you running Lynis?
Archlinux.
man grep(1) on Ubuntu 20.04.5: "the variant programs egrep, fgrep and rgrep are the same as grep -E, grep -F, and grep -r, respectively. These variants are deprecated, but are provided for backward compatibility."
Looks like we have some conversion to do. The reason to use egrep
was that grep
on Solaris did not support the -E
flag. A shame that the command is spewing messages now and therefore breaking that backward compatibility.
@Obema12 Thanks for your feedback. Next time when you report an issue, please leave off the "Fix it at last." at the end of your issue. It sounds unfriendly, while it may or may not be intended.
Just to clarify; egrep
, fgrep
or rgrep
don't spew any messages regarding deprecation on Ubuntu.
Yup. Looks like someone decided to turn on this message in a recent version of the package that contains the related utilities. Similar messages show up, most of them are from this month. With Arch Linux using often the newest packages it is no surprise it pops up there first. So it definitely makes sense to convert now that the compatibility starts to break.
@mboelen tried to be polite. But dozens of problems found and sent show that politeness does not achieve anything.
I sent rougher questions and it got a much faster developer response. It got to the point that rudeness, published immediately after politeness, was decided immediately! Whereas the polite message remained open for months.
I don't know how it works.
So it was intended. In that case, let me be very clear: we have a Code of Conduct (listed here on GitHub, including under the comment form "Remember, contributions to this repository...").
The CoC states that we expect people to be welcoming and friendly within this community, and also my duties as a project owner. It would be nice to treat people how you want to be treated yourself.
If you can't (or won't like to) accept these rules within the CoC, please don't be part of our community.
There are countless executeables that behave differently according to how they are named. This whole deprecated thing is developers who can't find something useful to do. 30+ years of scripts with egrep and fgrep. If Linux folks keep this stuff up it will eventually be as nasty as Wyndoze. If It Ain't Broke, Don't "Fix" it. Pure pedantry.
I guess I can set up a shell alias. :|
@fw-ops-automation-imprivata were you success in writing that alias? I am looking for workaround too.
@webcaptcha I tried right now. I add the alias in the bashrc, zshrc, root bashrc and root zshrc. Nothing worked :/
the warning message was introduced in gnu grep 3.8
The reason to use egrep was that grep on Solaris did not support the -E flag.
Could we do a one-time test at the very beginning that checks whether grep -E
works, and if it does not then fallback to egrep
?
agreed @jokeyrhyme and then replace `${EGREPBINARY} with a working command, so it doesn't need such a big rewrite.
I added a EGREPBINARY
var to my pull request. Let me know over there if this is a good approach.
This bug is still an issue.
** # lynis --version
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
3.0.8
egrep
isn't POSIX any more, as it happens.
The Open Group Base Specifications Issue 7, 2018 edition IEEE Std 1003.1-2017 ... C.4.2 Utilities Removed in the Previous Version The following utilities were removed in the previous version of this standard: ...egrep fgrep..
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html
@mboelen This issue can probably be closed now after these commits: https://github.com/CISOfy/lynis/commit/e816df538fee086927bb12d97eec16532baeb4c0 https://github.com/CISOfy/lynis/commit/1dad487318f36398b3873c07ac157aa7e3d75351
The execution of
lynis audit system
is accompanied by a whole bunch of messages related to grepFix it at last.