Bug 2185790 - rkhunter's use of grep is obsolescent or it makes grep unhappy
Summary: rkhunter's use of grep is obsolescent or it makes grep unhappy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rkhunter
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2188801 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-11 08:09 UTC by Mathieu
Modified: 2023-05-04 22:56 UTC (History)
10 users (show)

Fixed In Version: rkhunter-1.4.6-21.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-01 02:32:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Mathieu 2023-04-11 08:09:18 UTC
Hello,

Description of problem:
A typical cron job execution will generate the following messages (sort|uniq -c):
   1312 egrep: warning: egrep is obsolescent; using grep -E
      3 grep: warning: stray \ before !
     50 grep: warning: stray \ before +
      2 grep: warning: stray \ before -

Version-Release number of selected component (if applicable):
rkhunter-1.4.6-19.fc38.noarch

How reproducible:
Always

Comment 1 Kevin Fenzi 2023-04-11 18:01:48 UTC
Yeah, thanks for the bug. I already have been working on fixing this...

Comment 2 Fedora Update System 2023-04-21 01:12:58 UTC
FEDORA-2023-242497ad88 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-242497ad88

Comment 3 Markus Teuber 2023-04-21 11:31:45 UTC
Hi,

i think i found still some errors here.

I did first (sorry, but i can't find a way to change to english, language=en didn't work here atm):

# rkhunter --propupd
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 177 files, found 133

Then:

# /etc/cron.daily/rkhunter 
expr: Syntaxfehler: unerwartetes Argument „0“
cut: Diese Option benötigt ein Argument -- »f«
„cut --help“ liefert weitere Informationen.
expr: Syntaxfehler: unerwartetes Argument „0“
cut: Diese Option benötigt ein Argument -- »f«
„cut --help“ liefert weitere Informationen.
grep: Warnung: überzähliges \ vor !
grep: Warnung: überzähliges \ vor !
grep: Warnung: überzähliges \ vor !

and then i got the following output per mail:

--------------------- Start Rootkit Hunter Update ---------------------
[ Rootkit Hunter version 1.4.6 ]

Checking rkhunter data files...
  Checking file mirrors.dat                                  [ No update ]
  Checking file programs_bad.dat                             [ No update ]
  Checking file backdoorports.dat                            [ No update ]
  Checking file suspscan.dat                                 [ No update ]
  Checking file i18n/cn                                      [ No update ]
  Checking file i18n/de                                      [ No update ]
  Checking file i18n/en                                      [ No update ]
  Checking file i18n/tr                                      [ No update ]
  Checking file i18n/tr.utf8                                 [ No update ]
  Checking file i18n/zh                                      [ No update ]
  Checking file i18n/zh.utf8                                 [ No update ]
  Checking file i18n/ja                                      [ No update ]

---------------------- Start Rootkit Hunter Scan ----------------------
Warning: The file properties have changed:
         File: /usr/bin/grep
         Current inode: 2514866    Stored inode: File
Warning: The file properties have changed:
         File: /usr/bin/grep
         Current inode: 2514866    Stored inode: File

----------------------- End Rootkit Hunter Scan -----------------------

This warning about grep comes every time i try. Even after "--propupd" first.

Comment 4 Kevin Fenzi 2023-04-21 15:23:56 UTC
Yeah. ;( Just saw the same thing here... 

I'll poke it some more.

Comment 5 Fedora Update System 2023-04-22 01:41:11 UTC
FEDORA-2023-242497ad88 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-242497ad88`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-242497ad88

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Kevin Fenzi 2023-04-22 22:25:36 UTC
*** Bug 2188801 has been marked as a duplicate of this bug. ***

Comment 7 Nerijus Baliūnas 2023-04-23 11:44:29 UTC
With rkhunter-1.4.6-20.fc38.noarch I still get warnings about grep, although I ran:

# rkhunter --propupd grep
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 179 files, found 3 of 147

And some other syntax problems too:

expr: syntax error: unexpected argument „0“
cut: option requires an argument -- 'f'
Try 'cut --help' for more information.
expr: syntax error: unexpected argument „0“
cut: option requires an argument -- 'f'
Try 'cut --help' for more information.
grep: warning: stray \ before !
grep: warning: stray \ before !
grep: warning: stray \ before !

Comment 8 Brian Morrison 2023-04-28 21:44:50 UTC
I'm seeing these warnings from rkhunter daily

---------------------- Start Rootkit Hunter Scan ----------------------
Warning: The file properties have changed:
         File: /usr/bin/grep
         Current inode: 1469101    Stored inode: File
Warning: The file properties have changed:
         File: /usr/bin/grep
         Current inode: 1469101    Stored inode: File
Warning: Suspicious file types found in /dev:
         /dev/shm/lttng-ust-wait-8-42: data
         /dev/shm/lttng-ust-wait-8: data

----------------------- End Rootkit Hunter Scan -----------------------

Should they be generated or is it a problem with whichever packages own these files?

Comment 9 Kevin Fenzi 2023-04-28 23:32:41 UTC
Yeah, I am painfully aware the patch is incomplete. I am getting emails too. ;) 

I just haven't had any time to continue to work on it... hopefully this weekend between yardwork I can. 

if anyone would like to work on a PR before then, help gladly accepted. ;)

Comment 10 Brian Morrison 2023-04-29 12:34:58 UTC
No worries Kevin, and lots of strokes for the hounds.

Comment 11 Fedora Update System 2023-04-29 17:35:25 UTC
FEDORA-2023-8bdfa4e41f has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-8bdfa4e41f

Comment 12 Kevin Fenzi 2023-04-29 17:36:31 UTC
ok. Please test this new one. I took a different approach and it's much simplier and hopefully covers it all.

Comment 13 Colin J Thomson 2023-04-29 20:21:44 UTC
Seems OK for me, updated and ran with --propupd, I then ran rkhunter from the shell, via a cron job and had none of the grep warnings.

Comment 14 Fedora Update System 2023-04-30 02:41:05 UTC
FEDORA-2023-8bdfa4e41f has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-8bdfa4e41f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-8bdfa4e41f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Brian Morrison 2023-04-30 14:53:00 UTC
I am still seeing this from the cron.daily anacron run:

/etc/cron.daily/rkhunter:

expr: syntax error: unexpected argument ‘0’ cut: option requires an argument -- 'f' Try 'cut --help' for more information.

Not certain it's the same issue but it looks like part of the message from the -20 package.

Comment 16 Fedora Update System 2023-05-01 02:32:36 UTC
FEDORA-2023-8bdfa4e41f has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Brian Morrison 2023-05-01 11:19:19 UTC
(In reply to Brian Morrison from comment #15)
> I am still seeing this from the cron.daily anacron run:
> 
> /etc/cron.daily/rkhunter:
> 
> expr: syntax error: unexpected argument ‘0’ cut: option requires an argument
> -- 'f' Try 'cut --help' for more information.
> 
> Not certain it's the same issue but it looks like part of the message from
> the -20 package.

And this morning I don't see this, looks like it is sorted out. Thanks Kevin.

Comment 18 Radek Valasek 2023-05-02 04:22:51 UTC
I can confirm issue is resolved.

Thank  you.


Note You need to log in before you can comment on or make changes to this bug.