Moves system related functions from utils' to utils/system'

This commit is contained in:
Felipe Zimmerle
2016-11-03 09:42:21 -03:00
parent 73c4d69174
commit f1e742c159
14 changed files with 193 additions and 102 deletions

View File

@@ -57,6 +57,7 @@ class Driver;
#include "utils.h"
#include "utils/geo_lookup.h"
#include "utils/msc_string.h"
#include "utils/msc_system.h"
#include "variables/xml.h"
#include "variables/duration.h"
#include "variables/env.h"
@@ -661,7 +662,8 @@ expression:
| CONFIG_DIR_GEO_DB
{
#ifdef WITH_GEOIP
std::string file = modsecurity::find_resource($1, driver.ref.back());
std::string file = modsecurity::utils::find_resource($1,
driver.ref.back());
if (GeoLookup::getInstance().setDataBase(file) == false) {
std::stringstream ss;
ss << "Failed to load the GeoDB from: ";

View File

@@ -398,8 +398,8 @@ VAR_FREE_TEXT_SPACE_COMMA [^, \t\"]+
{CONFIG_INCLUDE}[ ]{CONFIG_VALUE_PATH} {
const char *file = strchr(yytext, ' ') + 1;
for (auto& s: modsecurity::expandEnv(file, 0)) {
std::string f = modsecurity::find_resource(s, driver.ref.back());
for (auto& s: modsecurity::utils::expandEnv(file, 0)) {
std::string f = modsecurity::utils::find_resource(s, driver.ref.back());
yyin = fopen(f.c_str(), "r" );
if (!yyin) {
BEGIN(INITIAL);
@@ -416,8 +416,8 @@ VAR_FREE_TEXT_SPACE_COMMA [^, \t\"]+
const char *file = strchr(yytext, ' ') + 1;
char *f = strdup(file + 1);
f[strlen(f)-1] = '\0';
for (auto& s: modsecurity::expandEnv(f, 0)) {
std::string f = modsecurity::find_resource(s, driver.ref.back());
for (auto& s: modsecurity::utils::expandEnv(f, 0)) {
std::string f = modsecurity::utils::find_resource(s, driver.ref.back());
yyin = fopen(f.c_str(), "r" );
if (!yyin) {
BEGIN(INITIAL);