mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-01 03:57:47 +03:00
setvar: needs review
This commit is contained in:
19
src/rule.cc
19
src/rule.cc
@@ -208,7 +208,7 @@ bool Rule::evaluateActions(Transaction *trasn) {
|
||||
for (Action *a : this->actions_runtime_pos) {
|
||||
if (a->isDisruptive() == false) {
|
||||
#ifndef NO_LOGS
|
||||
trasn->debug(4, "Running (_non_ disruptive) action: " +
|
||||
trasn->debug(4, "Running [III] (_non_ disruptive) action: " +
|
||||
a->m_name + ".");
|
||||
#endif
|
||||
a->evaluate(this, trasn);
|
||||
@@ -438,7 +438,7 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
+ "\" (Variable: " + v->m_key + ")");
|
||||
#endif
|
||||
|
||||
ret = this->op->evaluateInternal(trasn, value);
|
||||
ret = this->op->evaluateInternal(trasn, this, value);
|
||||
|
||||
#ifndef NO_LOGS
|
||||
clock_t end = clock();
|
||||
@@ -487,6 +487,12 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
} else {
|
||||
containsDisruptive = true;
|
||||
}
|
||||
} else {
|
||||
if (a->m_name == "setvar") {
|
||||
trasn->debug(4, "Running [I] (_non_ disruptive) " \
|
||||
"action: " + a->m_name);
|
||||
a->evaluate(this, trasn, ruleMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,11 +580,14 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
#endif
|
||||
}
|
||||
} else if (!a->isDisruptive()) {
|
||||
// here
|
||||
if (a->m_name != "capture" && a->m_name != "setvar") {
|
||||
#ifndef NO_LOGS
|
||||
trasn->debug(4, "Running (_non_ disruptive) " \
|
||||
"action: " + a->m_name);
|
||||
trasn->debug(4, "Running [II] (_non_ disruptive) " \
|
||||
"action: " + a->m_name);
|
||||
#endif
|
||||
a->evaluate(this, trasn, ruleMessage);
|
||||
a->evaluate(this, trasn, ruleMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user