Merge pull request #6498 from Icinga/bugfix/match-regex-match-any-regression

Fix regression with MatchAny false conditions on match/regex/cidr_match
This commit is contained in:
Jean Flach 2018-07-27 17:28:13 +02:00 committed by GitHub
commit 2e3a1ff0c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -151,7 +151,8 @@ bool ScriptUtils::Regex(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String text = argTexts;
boost::smatch what;
@ -197,7 +198,8 @@ bool ScriptUtils::Match(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String text = argTexts;
return Utility::Match(pattern, argTexts);
@ -242,7 +244,8 @@ bool ScriptUtils::CidrMatch(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String ip = argIps;
return Utility::CidrMatch(pattern, ip);