Skip to content

Commit 138e301

Browse files
defanatorFelipe Zimmerle
authored andcommitted
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
1 parent c611554 commit 138e301

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/operators/inspect_file.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ bool InspectFile::evaluate(Transaction *transaction, const std::string &str) {
7373
pclose(in);
7474

7575
res.append(s.str());
76-
if (res.size() > 1 && res.at(0) == '1') {
77-
return true;
76+
if (res.size() > 1 && res.at(0) != '1') {
77+
return true; /* match */
7878
}
7979

80+
/* no match */
8081
return false;
8182
}
8283
}

0 commit comments

Comments
 (0)