mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-01 03:57:47 +03:00
Refactoring: new structure for logging alerts
Disruptive actions were moved to actions::disruptive namespace
This commit is contained in:
17
src/rule.cc
17
src/rule.cc
@@ -587,7 +587,7 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
if (globalRet == false) {
|
||||
trasn->debug(4, "Rule returned 0.");
|
||||
cleanMatchedVars(trasn);
|
||||
return false;
|
||||
goto end_clean;
|
||||
}
|
||||
|
||||
trasn->debug(4, "Rule returned 1.");
|
||||
@@ -599,7 +599,7 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
if (this->chainedRule == NULL) {
|
||||
trasn->debug(4, "Rule is marked as chained but there " \
|
||||
"isn't a subsequent rule.");
|
||||
return false;
|
||||
goto end_clean;
|
||||
}
|
||||
|
||||
trasn->debug(4, "Executing chained rule.");
|
||||
@@ -609,6 +609,13 @@ bool Rule::evaluate(Transaction *trasn) {
|
||||
goto end_exec;
|
||||
}
|
||||
|
||||
end_clean:
|
||||
while (finalVars.empty() == false) {
|
||||
auto *a = finalVars.back();
|
||||
finalVars.pop_back();
|
||||
delete a;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
end_exec:
|
||||
@@ -617,6 +624,12 @@ end_exec:
|
||||
trasn->serverLog(u);
|
||||
}
|
||||
|
||||
while (finalVars.empty() == false) {
|
||||
auto *a = finalVars.back();
|
||||
finalVars.pop_back();
|
||||
delete a;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user