Adds verbose message when a resource is not found.

Fix #1309
This commit is contained in:
Felipe Zimmerle
2017-05-02 13:38:41 -03:00
parent 77a658c7cd
commit c97db2f361
10 changed files with 906 additions and 831 deletions

View File

@@ -1204,8 +1204,16 @@ expression:
| CONFIG_DIR_GEO_DB
{
#ifdef WITH_GEOIP
std::string err;
std::string file = modsecurity::utils::find_resource($1,
driver.ref.back());
driver.ref.back(), &err);
if (file.empty()) {
std::stringstream ss;
ss << "Failed to load locate the GeoDB file from: " << $1 << " ";
ss << err;
driver.error(@0, ss.str());
YYERROR;
}
if (GeoLookup::getInstance().setDataBase(file) == false) {
std::stringstream ss;
ss << "Failed to load the GeoDB from: ";