Renames defaultActions to m_defaultActions in RulesProperties

This commit is contained in:
Felipe Zimmerle 2017-01-05 15:01:57 -03:00 committed by Felipe Zimmerle
parent 7927ddda91
commit 60402d8b80
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
5 changed files with 9 additions and 9 deletions

View File

@ -313,8 +313,8 @@ class RulesProperties {
for (int i = 0; i <= modsecurity::Phases::NUMBER_OF_PHASES; i++) { for (int i = 0; i <= modsecurity::Phases::NUMBER_OF_PHASES; i++) {
std::vector<actions::Action *> *actions_from = \ std::vector<actions::Action *> *actions_from = \
from->defaultActions+i; from->m_defaultActions+i;
std::vector<actions::Action *> *actions_to = to->defaultActions+i; std::vector<actions::Action *> *actions_to = to->m_defaultActions+i;
for (int j = 0; j < actions_from->size(); j++) { for (int j = 0; j < actions_from->size(); j++) {
actions::Action *action = actions_from->at(j); actions::Action *action = actions_from->at(j);
action->refCountIncrease(); action->refCountIncrease();
@ -419,7 +419,7 @@ class RulesProperties {
ConfigString m_httpblKey; ConfigString m_httpblKey;
ConfigString m_uploadDirectory; ConfigString m_uploadDirectory;
ConfigString m_uploadTmpDirectory; ConfigString m_uploadTmpDirectory;
std::vector<actions::Action *> defaultActions[8]; std::vector<actions::Action *> m_defaultActions[8];
std::vector<modsecurity::Rule *> m_rules[8]; std::vector<modsecurity::Rule *> m_rules[8];
}; };

View File

@ -32,7 +32,7 @@ namespace disruptive {
bool Block::evaluate(Rule *rule, Transaction *transaction, RuleMessage *rm) { bool Block::evaluate(Rule *rule, Transaction *transaction, RuleMessage *rm) {
transaction->debug(8, "Marking request as disruptive."); transaction->debug(8, "Marking request as disruptive.");
for (Action *a : transaction->m_rules->defaultActions[rule->phase]) { for (Action *a : transaction->m_rules->m_defaultActions[rule->phase]) {
if (a->isDisruptive() == false) { if (a->isDisruptive() == false) {
continue; continue;
} }

View File

@ -915,7 +915,7 @@ expression:
definedPhase = modsecurity::Phases::RequestHeadersPhase; definedPhase = modsecurity::Phases::RequestHeadersPhase;
} }
if (!driver.defaultActions[definedPhase].empty()) { if (!driver.m_defaultActions[definedPhase].empty()) {
std::stringstream ss; std::stringstream ss;
ss << "SecDefaultActions can only be placed once per phase and configuration context. Phase "; ss << "SecDefaultActions can only be placed once per phase and configuration context. Phase ";
ss << secRuleDefinedPhase; ss << secRuleDefinedPhase;
@ -925,7 +925,7 @@ expression:
} }
for (actions::Action *a : checkedActions) { for (actions::Action *a : checkedActions) {
driver.defaultActions[definedPhase].push_back(a); driver.m_defaultActions[definedPhase].push_back(a);
} }
delete actions; delete actions;

View File

@ -309,7 +309,7 @@ std::vector<std::string *> Rule::executeSecDefaultActionTransofrmations(
// Notice that first we make sure that won't be a t:none // Notice that first we make sure that won't be a t:none
// on the target rule. // on the target rule.
if (none == 0) { if (none == 0) {
for (Action *a : trasn->m_rules->defaultActions[this->phase]) { for (Action *a : trasn->m_rules->m_defaultActions[this->phase]) {
if (a->action_kind \ if (a->action_kind \
== actions::Action::RunTimeBeforeMatchAttemptKind) { == actions::Action::RunTimeBeforeMatchAttemptKind) {
newValue = new std::string(a->evaluate(*value, trasn)); newValue = new std::string(a->evaluate(*value, trasn));
@ -472,7 +472,7 @@ std::vector<const collection::Variable *> Rule::getFinalVars(
void Rule::executeActionsAfterFullMatch(Transaction *trasn, void Rule::executeActionsAfterFullMatch(Transaction *trasn,
bool containsDisruptive, RuleMessage *ruleMessage) { bool containsDisruptive, RuleMessage *ruleMessage) {
for (Action *a : trasn->m_rules->defaultActions[this->phase]) { for (Action *a : trasn->m_rules->m_defaultActions[this->phase]) {
if (a->action_kind != actions::Action::RunTimeOnlyIfMatchKind) { if (a->action_kind != actions::Action::RunTimeOnlyIfMatchKind) {
continue; continue;
} }

View File

@ -93,7 +93,7 @@ Rules::~Rules() {
} }
} }
for (i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { for (i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) {
std::vector<actions::Action *> *tmp = &defaultActions[i]; std::vector<actions::Action *> *tmp = &m_defaultActions[i];
while (tmp->empty() == false) { while (tmp->empty() == false) {
actions::Action *a = tmp->back(); actions::Action *a = tmp->back();
a->refCountDecreaseAndCheck(); a->refCountDecreaseAndCheck();