Adds checks for the NO_LOGS definition and improved the vars resolution time

This commit is contained in:
Felipe Zimmerle
2015-09-17 17:41:38 -03:00
parent 3e067e7409
commit ed86c24df6
46 changed files with 294 additions and 62 deletions

View File

@@ -136,7 +136,7 @@ class ModSecurityStringVariables :
l.push_back(pair);
}
if (l.size() == 0) {
if (l.size() == 0 && key.find(":") == std::string::npos) {
for (auto& x : *this) {
if ((x.first.substr(0, key.size() + 1).compare(key + ":") != 0)
&& (x.first != key)) {
@@ -144,10 +144,8 @@ class ModSecurityStringVariables :
}
std::list<std::pair<std::string, std::string>> t;
t = this->resolveVariable(x.first);
for (std::pair<std::string, std::string> z : t) {
pair = std::make_pair(std::string(z.first),
std::string(z.second));
l.push_back(pair);
if (t.empty() == false) {
l.insert(l.end(), t.begin(), t.end());
}
}
}
@@ -239,8 +237,9 @@ class Assay {
ModSecurityStringVariables m_variables_strings;
std::unordered_map<std::string, ModSecurityStringVariables *> collections;
#ifndef NO_LOGS
void debug(int, std::string);
#endif
void serverLog(const std::string& msg);
std::vector<actions::Action *> actions;