Adds partial support to UpdateActionById

This commit is contained in:
Felipe Zimmerle
2018-09-26 15:57:02 -03:00
parent 68398a51f3
commit 74841779f8
16 changed files with 922 additions and 712 deletions

View File

@@ -81,7 +81,7 @@ int Driver::addSecRule(Rule *rule) {
if (lastRule->m_chainedRule == NULL) {
rule->m_phase = lastRule->m_phase;
lastRule->m_chainedRule = rule;
if (rule->containsDisruptiveAction()) {
if (rule->containsStaticDisruptiveAction()) {
m_parserError << "Disruptive actions can only be specified by";
m_parserError << " chain starter rules.";
return false;
@@ -94,7 +94,7 @@ int Driver::addSecRule(Rule *rule) {
}
if (a->m_chained && a->m_chainedRule == NULL) {
a->m_chainedRule = rule;
if (a->containsDisruptiveAction()) {
if (a->containsStaticDisruptiveAction()) {
m_parserError << "Disruptive actions can only be ";
m_parserError << "specified by chain starter rules.";
return false;

File diff suppressed because it is too large Load Diff

View File

@@ -1513,12 +1513,16 @@ expression:
}
std::vector<actions::Action *> *a = new std::vector<actions::Action *>();
for (auto &i : *$2.get()) {
a->push_back(i.release());
if (driver.m_exceptions.loadUpdateActionById(ruleId, std::move($2), &error) == false) {
std::stringstream ss;
ss << "SecRuleUpdateActionById: failed to load:";
ss << $1;
ss << ". ";
ss << error;
driver.error(@0, ss.str());
YYERROR;
}
driver.error(@0, "SecRuleUpdateActionById is not yet supported");
YYERROR;
}
/* Debug log: start */