From 515e0735033a5cb32f07754a3e0e3a802bd9156f Mon Sep 17 00:00:00 2001 From: Lasse Karstensen Date: Thu, 13 Jul 2017 12:11:12 +0200 Subject: [PATCH] Rename FromNowOneAllowType to FromNowOnAllowType. This misspelling is confusing (is it allow one more rule, or all of them?) and since v3 isn't released yet, use the major version bump opportunity to rectify it. --- src/actions/disruptive/allow.cc | 2 +- src/actions/disruptive/allow.h | 6 +++--- src/rules.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/actions/disruptive/allow.cc b/src/actions/disruptive/allow.cc index c534e689..99580084 100644 --- a/src/actions/disruptive/allow.cc +++ b/src/actions/disruptive/allow.cc @@ -37,7 +37,7 @@ bool Allow::init(std::string *error) { } else if (a == "request") { m_allowType = RequestAllowType; } else if (a == "") { - m_allowType = FromNowOneAllowType; + m_allowType = FromNowOnAllowType; } else { error->assign("Allow: if specified, the parameter " \ "most be: phase, request"); diff --git a/src/actions/disruptive/allow.h b/src/actions/disruptive/allow.h index 8c129091..220f94fa 100644 --- a/src/actions/disruptive/allow.h +++ b/src/actions/disruptive/allow.h @@ -47,7 +47,7 @@ enum AllowType : int { /** * */ - FromNowOneAllowType, + FromNowOnAllowType, }; @@ -71,8 +71,8 @@ class Allow : public Action { return "Request"; } else if (a == PhaseAllowType) { return "Phase"; - } else if (a == FromNowOneAllowType) { - return "FromNowOne"; + } else if (a == FromNowOnAllowType) { + return "FromNowOn"; } else { return "Unknown"; } diff --git a/src/rules.cc b/src/rules.cc index 3faf1740..911f10ef 100644 --- a/src/rules.cc +++ b/src/rules.cc @@ -167,7 +167,7 @@ int Rules::evaluate(int phase, Transaction *transaction) { debug(9, "This phase consists of " + std::to_string(rules.size()) + \ " rule(s)."); - if (transaction->m_allowType == actions::disruptive::FromNowOneAllowType + if (transaction->m_allowType == actions::disruptive::FromNowOnAllowType && phase != modsecurity::Phases::LoggingPhase) { debug(9, "Skipping all rules evaluation on this phase as request " \ "through the utilization of an `allow' action.");