Changes the actions to affect the ruleMessage instead of transaction

This commit is contained in:
Felipe Zimmerle
2016-11-28 09:59:50 -03:00
parent 8fa0523fe0
commit 2930d40d57
10 changed files with 30 additions and 19 deletions

View File

@@ -22,6 +22,7 @@
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"
/*
* Description: Assigns a custom message to the rule or chain in which it
@@ -45,14 +46,12 @@ namespace modsecurity {
namespace actions {
bool Msg::evaluate(Rule *rule, Transaction *transaction) {
#ifndef NO_LOGS
std::string msg = MacroExpansion::expand(m_parser_payload, transaction);
bool Msg::evaluate(Rule *rule, Transaction *transaction, RuleMessage *rm) {
std::string msg = data(transaction);
transaction->debug(9, "Saving msg: " + msg);
#endif
rule->m_log_message = data(transaction);
rm->m_message = msg;
transaction->m_collections.storeOrUpdateFirst("RULE:msg", msg);
return true;
}