mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support to BodyLimitAction and support for parser errors
This commit is contained in:
10
src/rules.cc
10
src/rules.cc
@@ -124,6 +124,7 @@ int Rules::load(const char *plain_rules) {
|
||||
Driver *driver = new Driver();
|
||||
if (driver->parse("/tmp/modsec_ugly_hack.txt")) {
|
||||
ret = false;
|
||||
parserError = driver->parserError.str();
|
||||
}
|
||||
this->merge(driver);
|
||||
delete driver;
|
||||
@@ -132,6 +133,11 @@ int Rules::load(const char *plain_rules) {
|
||||
}
|
||||
|
||||
|
||||
std::string Rules::getParserError() {
|
||||
return this->parserError;
|
||||
}
|
||||
|
||||
|
||||
int Rules::evaluate(int phase, Assay *assay) {
|
||||
if (phase > ModSecurity::Phases::NUMBER_OF_PHASES) {
|
||||
return 0;
|
||||
@@ -169,6 +175,8 @@ int Rules::merge(Driver *from) {
|
||||
this->components = from->components;
|
||||
this->requestBodyLimit = from->requestBodyLimit;
|
||||
this->responseBodyLimit = from->responseBodyLimit;
|
||||
this->requestBodyLimitAction = from->requestBodyLimitAction;
|
||||
this->responseBodyLimitAction = from->responseBodyLimitAction;
|
||||
|
||||
if (m_custom_debug_log) {
|
||||
this->debug_log = m_custom_debug_log->new_instance();
|
||||
@@ -205,6 +213,8 @@ int Rules::merge(Rules *from) {
|
||||
this->components = from->components;
|
||||
this->requestBodyLimit = from->requestBodyLimit;
|
||||
this->responseBodyLimit = from->responseBodyLimit;
|
||||
this->requestBodyLimitAction = from->requestBodyLimitAction;
|
||||
this->responseBodyLimitAction = from->responseBodyLimitAction;
|
||||
|
||||
this->debug_log = from->debug_log;
|
||||
|
||||
|
Reference in New Issue
Block a user