Reverse logic of checking output in @inspectFile

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
This commit is contained in:
Andrei Belov 2018-03-21 14:54:24 +03:00 committed by Felipe Zimmerle
parent c61155424e
commit 138e301695
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -73,10 +73,11 @@ bool InspectFile::evaluate(Transaction *transaction, const std::string &str) {
pclose(in); pclose(in);
res.append(s.str()); res.append(s.str());
if (res.size() > 1 && res.at(0) == '1') { if (res.size() > 1 && res.at(0) != '1') {
return true; return true; /* match */
} }
/* no match */
return false; return false;
} }
} }