From b9f26bc59fc4019a757a35d23c9269abcbc8903d Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 27 Jul 2018 16:55:37 +0200 Subject: [PATCH] Fix regression with MatchAny false conditions on match/regex/cidr_match fixes #6496 refs #6498 --- lib/base/scriptutils.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/base/scriptutils.cpp b/lib/base/scriptutils.cpp index cbedd9f97..f8ab8ce00 100644 --- a/lib/base/scriptutils.cpp +++ b/lib/base/scriptutils.cpp @@ -147,7 +147,8 @@ bool ScriptUtils::Regex(const std::vector& args) return false; } - return true; + /* MatchAny: Nothing matched. MatchAll: Everything matched. */ + return mode == MatchAll; } else { String text = argTexts; boost::smatch what; @@ -189,7 +190,8 @@ bool ScriptUtils::Match(const std::vector& args) return false; } - return true; + /* MatchAny: Nothing matched. MatchAll: Everything matched. */ + return mode == MatchAll; } else { String text = argTexts; return Utility::Match(pattern, argTexts); @@ -230,7 +232,8 @@ bool ScriptUtils::CidrMatch(const std::vector& args) return false; } - return true; + /* MatchAny: Nothing matched. MatchAll: Everything matched. */ + return mode == MatchAll; } else { String ip = argIps; return Utility::CidrMatch(pattern, ip);