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

Maldet not reading ignore_inotify #330

Closed
MajorFault opened this issue Apr 15, 2019 · 1 comment
Closed

Maldet not reading ignore_inotify #330

MajorFault opened this issue Apr 15, 2019 · 1 comment

Comments

@MajorFault
Copy link

Version: Linux Malware Detect v1.6.4
OS: CentOS 7.6.1810

Upon startup, maldet does not read the contents of the ignore_inotify file, hence no --exclude parameter is appended to the inotifywait startup line.

The reason is found in internals/functions, line 1749:
if [ -f "$ignore_inotify" ] && [ ! -s "$ignore_inotify" ]; then

Those two checks are combined with an AND operator but they are mutually exclusive, so they're never true. The "-s" check is true if a file exists and is not empty, but here you negate that check with "! -s".

I guess you wanted to check if the file is NOT empty, hence the code on line 1749 should be changed to:
if [ -f "$ignore_inotify" ] && [ -s "$ignore_inotify" ]; then

I manually changed the code on that line and now our ignore_inotify file contents are properly processed.

@rfxn
Copy link
Owner

rfxn commented Apr 15, 2019

You sir are absolutely correct. Blame report has this on me as introducing some months back during 1.6.4 staging/testing.

This has been fixed and given I just had to re-release for issue #331, this is being pulled in as a fix as well.

Thank you for the detailed bug reports/feedback!

@rfxn rfxn closed this as completed Apr 15, 2019
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