actions: Compute the rule association during rules load

This commit is contained in:
Felipe Zimmerle
2020-05-18 15:08:17 -03:00
parent 6ea4340a15
commit 1b705aeb54
83 changed files with 842 additions and 415 deletions

View File

@@ -24,6 +24,7 @@
#include "modsecurity/intervention.h"
#include "modsecurity/rule.h"
#ifndef HEADERS_MODSECURITY_ACTIONS_ACTION_H_
#define HEADERS_MODSECURITY_ACTIONS_ACTION_H_
@@ -32,7 +33,7 @@
namespace modsecurity {
class Transaction;
class RuleWithActions;
class RunTimeString;
namespace actions {

View File

@@ -29,6 +29,7 @@
#include "modsecurity/modsecurity.h"
#include "modsecurity/variable_value.h"
#ifdef __cplusplus
namespace modsecurity {

View File

@@ -70,8 +70,19 @@ class VariableValue {
}
}
VariableValue(const VariableValue &v) = delete;
VariableValue(const VariableValue &o) :
m_collection(o.m_collection),
m_key(o.m_key),
m_keyWithCollection(o.m_keyWithCollection),
m_value(o.m_value)
{
for (auto &i : o.m_orign) {
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
origin->m_offset = i->m_offset;
origin->m_length = i->m_length;
m_orign.push_back(std::move(origin));
}
}
const std::string& getKey() const {
return m_key;