Adds support to the allow action

This commit is contained in:
Felipe Zimmerle
2016-06-30 20:42:30 -03:00
parent e77e4c4c14
commit f72bd587ec
11 changed files with 287 additions and 25 deletions

View File

@@ -34,6 +34,7 @@ class Driver;
#include "actions/skip_after.h"
#include "actions/msg.h"
#include "actions/phase.h"
#include "actions/allow.h"
#include "actions/log_data.h"
#include "actions/maturity.h"
#include "actions/redirect.h"
@@ -87,6 +88,7 @@ using modsecurity::actions::Rev;
using modsecurity::actions::Ver;
using modsecurity::actions::Msg;
using modsecurity::actions::Phase;
using modsecurity::actions::Allow;
using modsecurity::actions::transformations::None;
using modsecurity::actions::LogData;
using modsecurity::actions::Maturity;
@@ -932,6 +934,15 @@ act:
YYERROR;
}
}
| ACTION_ALLOW
{
std::string error;
$$ = new Allow($1);
if ($$->init(&error) == false) {
driver.error(@0, error);
YYERROR;
}
}
| ACTION_PHASE
{
std::string error;
@@ -986,24 +997,6 @@ act:
*/
$$ = Action::instantiate($1);
}
| ACTION_ALLOW
{
/*
TODO: allow is not implemented yet.
std::string error;
Allow *allow = new Allow($1);
if (allow->init(&error) == false) {
driver.parserError << error;
YYERROR;
}
$$ = allow;
*/
$$ = Action::instantiate($1);
}
| ACTION_REDIRECT
{
std::string error;