From d97688804ee2c5fba46ff718fdc74c24eb2376cc Mon Sep 17 00:00:00 2001 From: Victor Hora Date: Tue, 11 Sep 2018 00:18:37 -0400 Subject: [PATCH] Fix parser to support GeoLookup with MaxMind --- CHANGES | 2 ++ src/parser/seclang-parser.yy | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 82c42391..f29e2b86 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ v3.0.3 - YYYY-MMM-DD (to be released) ------------------------------------- + - Fix parser to support GeoLookup with MaxMind + [Issue #1884, #1895 - @victorhora, @everping] - parser: Fix simple quote setvar in the end of the line [Issue #1831 - @zimmerle, @csanders-git] - Fix pc file diff --git a/src/parser/seclang-parser.yy b/src/parser/seclang-parser.yy index 47c406d9..1145f6d0 100644 --- a/src/parser/seclang-parser.yy +++ b/src/parser/seclang-parser.yy @@ -1080,11 +1080,11 @@ op_before_init: } | OPERATOR_GEOLOOKUP { -#ifdef WITH_GEOIP +#if defined(WITH_GEOIP) or defined(WITH_MAXMIND) OPERATOR_CONTAINER($$, new operators::GeoLookup()); #else std::stringstream ss; - ss << "This version of ModSecurity was not compiled with GeoIP support."; + ss << "This version of ModSecurity was not compiled with GeoIP or MaxMind support."; driver.error(@0, ss.str()); YYERROR; #endif // WITH_GEOIP @@ -1555,7 +1555,7 @@ expression: /* Debug log: end */ | CONFIG_DIR_GEO_DB { -#ifdef WITH_GEOIP +#if defined(WITH_GEOIP) or defined(WITH_MAXMIND) std::string err; std::string file = modsecurity::utils::find_resource($1, driver.ref.back(), &err); @@ -1575,7 +1575,7 @@ expression: } #else std::stringstream ss; - ss << "This version of ModSecurity was not compiled with GeoIP support."; + ss << "This version of ModSecurity was not compiled with GeoIP or MaxMind support."; driver.error(@0, ss.str()); YYERROR; #endif // WITH_GEOIP