mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Creates RuleUnconditional
Makes RuleScript child of RuleWithActions instead of Operator
This commit is contained in:
@@ -38,9 +38,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
: VariableDictElement(std::string("RULE"), dictElement) { }
|
||||
|
||||
static void id(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
RuleWithOperator *r = rule;
|
||||
RuleWithActions *r = rule;
|
||||
|
||||
while (r && r->m_ruleId == 0) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -63,9 +63,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void rev(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
RuleWithOperator *r = rule;
|
||||
RuleWithActions *r = rule;
|
||||
|
||||
while (r && r->m_rev.empty()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -89,9 +89,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void severity(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
RuleWithOperator *r = rule;
|
||||
RuleWithActions *r = rule;
|
||||
|
||||
while (r && !r->hasSeverity()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -113,9 +113,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void logData(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
RuleWithOperator *r = rule;
|
||||
RuleWithActions *r = rule;
|
||||
|
||||
while (r && !r->hasLogData()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -136,9 +136,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
}
|
||||
|
||||
static void msg(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
RuleWithOperator *r = rule;
|
||||
RuleWithActions *r = rule;
|
||||
|
||||
while (r && !r->hasMsg()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -159,7 +159,7 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
}
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
if (m_dictElement == "id") {
|
||||
id(t, rule, l);
|
||||
@@ -198,7 +198,7 @@ class Rule_DictElementRegexp : public VariableRegex {
|
||||
: VariableRegex("RULE", regex) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
if (Utils::regex_search("id", m_r) > 0) {
|
||||
Rule_DictElement::id(t, rule, l);
|
||||
@@ -230,7 +230,7 @@ class Rule_NoDictElement : public Variable {
|
||||
: Variable("RULE") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithOperator *rule,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
Rule_DictElement::id(t, rule, l);
|
||||
Rule_DictElement::rev(t, rule, l);
|
||||
|
||||
Reference in New Issue
Block a user