mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-20 19:16:40 +03:00
Removes RuleMessage from action execute signature
This commit is contained in:
@@ -28,8 +28,7 @@ namespace actions {
|
||||
namespace disruptive {
|
||||
|
||||
|
||||
bool Deny::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) {
|
||||
bool Deny::execute(RuleWithActions *rule, Transaction *transaction) {
|
||||
ms_dbg_a(transaction, 8, "Running action deny");
|
||||
|
||||
if (transaction->m_it.status == 200) {
|
||||
@@ -38,9 +37,9 @@ bool Deny::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
|
||||
transaction->m_it.disruptive = true;
|
||||
intervention::freeLog(&transaction->m_it);
|
||||
rm.setRule(rule);
|
||||
transaction->messageGetLast()->setRule(rule);
|
||||
transaction->m_it.log = strdup(
|
||||
rm.log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
transaction->messageGetLast()->log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ class Deny : public Action {
|
||||
public:
|
||||
explicit Deny(const std::string &action) : Action(action) { }
|
||||
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) override;
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction) override;
|
||||
bool isDisruptive() override { return true; }
|
||||
};
|
||||
|
||||
|
||||
@@ -32,8 +32,7 @@ namespace actions {
|
||||
namespace disruptive {
|
||||
|
||||
|
||||
bool Drop::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) {
|
||||
bool Drop::execute(RuleWithActions *rule, Transaction *transaction) {
|
||||
ms_dbg_a(transaction, 8, "Running action drop " \
|
||||
"[executing deny instead of drop.]");
|
||||
|
||||
@@ -43,9 +42,9 @@ bool Drop::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
|
||||
transaction->m_it.disruptive = true;
|
||||
intervention::freeLog(&transaction->m_it);
|
||||
rm.setRule(rule);
|
||||
transaction->messageGetLast()->setRule(rule);
|
||||
transaction->m_it.log = strdup(
|
||||
rm.log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
transaction->messageGetLast()->log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ class Drop : public Action {
|
||||
public:
|
||||
explicit Drop(const std::string &action) : Action(action) { }
|
||||
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) override;
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction) override;
|
||||
bool isDisruptive() override { return true; }
|
||||
};
|
||||
|
||||
|
||||
@@ -29,8 +29,7 @@ namespace actions {
|
||||
namespace disruptive {
|
||||
|
||||
|
||||
bool Pass::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) {
|
||||
bool Pass::execute(RuleWithActions *rule, Transaction *transaction) {
|
||||
intervention::free(&transaction->m_it);
|
||||
intervention::reset(&transaction->m_it);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class Pass : public Action {
|
||||
public:
|
||||
explicit Pass(const std::string &action) : Action(action) { }
|
||||
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) override;
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction) override;
|
||||
bool isDisruptive() override { return true; }
|
||||
};
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ bool Redirect::init(std::string *error) {
|
||||
}
|
||||
|
||||
|
||||
bool Redirect::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) {
|
||||
bool Redirect::execute(RuleWithActions *rule, Transaction *transaction) {
|
||||
std::string m_urlExpanded(m_string->evaluate(transaction));
|
||||
/* if it was changed before, lets keep it. */
|
||||
if (transaction->m_it.status == 200
|
||||
@@ -47,9 +46,9 @@ bool Redirect::execute(RuleWithActions *rule, Transaction *transaction,
|
||||
transaction->m_it.url = strdup(m_urlExpanded.c_str());
|
||||
transaction->m_it.disruptive = true;
|
||||
intervention::freeLog(&transaction->m_it);
|
||||
rm.setRule(rule);
|
||||
transaction->messageGetLast()->setRule(rule);
|
||||
transaction->m_it.log = strdup(
|
||||
rm.log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
transaction->messageGetLast()->log(RuleMessage::LogMessageInfo::ClientLogMessageInfo).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,8 +46,7 @@ class Redirect : public Action {
|
||||
m_status(0),
|
||||
m_string(std::move(z)) { }
|
||||
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction,
|
||||
RuleMessage &rm) override;
|
||||
bool execute(RuleWithActions *rule, Transaction *transaction) override;
|
||||
bool init(std::string *error) override;
|
||||
bool isDisruptive() override { return true; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user