Skip to content

Reverse logic of checking output in @inspectFile #1715

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

Closed

Conversation

defanator
Copy link
Contributor

This change makes @inspectFile in ModSecurity 3.x to operate in exact the same way as it operates in ModSecurity 2.x, so existing helper scripts like runav.pl [1] will work without any changes.

See the difference in the corresponding logic of existing code:

ModSecurity 2.x: https://github.com/SpiderLabs/ModSecurity/blob/v2/master/apache2/re_operators.c#L4069-L4074

libmodsecurity (ModSecurity 3.x): https://github.com/SpiderLabs/ModSecurity/blob/v3/master/src/operators/inspect_file.cc#L76-L78

(I would say that it could be better rather to check exit code than output, but for the sake of compatibility of existing setups the proposed solution will also work.)

[1] https://github.com/SpiderLabs/owasp-modsecurity-crs/blob/v3.0/master/util/av-scanning/runav.pl

This change makes @inspectFile in ModSecurity 3.x to operate in exact
the same way as it operates in ModSecurity 2.x, so existing helper scripts
like runav.pl [1] will work without any changes.

[1] https://github.com/SpiderLabs/owasp-modsecurity-crs/blob/v3.0/master/util/av-scanning/runav.pl
@zimmerle zimmerle self-assigned this Mar 22, 2018
@zimmerle zimmerle added the 3.x Related to ModSecurity version 3.x label Mar 22, 2018
@zimmerle zimmerle added this to the v3.0.1 milestone Mar 22, 2018
zimmerle pushed a commit that referenced this pull request Mar 23, 2018
@zimmerle
Copy link
Contributor

Merged! thanks. 9505ca7

@zimmerle zimmerle closed this Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants