mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Fix rule file inclusion path
The inclusion was not taking `*' into consideration, leading the relative configuration inclusion to fail. That was very annoying.
This commit is contained in:
@@ -70,6 +70,11 @@ std::string find_resource(const std::string& resource,
|
||||
}
|
||||
delete iss;
|
||||
|
||||
// What about `*' ?
|
||||
if (utils::expandEnv(resource, 0).size() > 1) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
// Trying the same path of the configuration file.
|
||||
std::string f = get_path(config) + "/" + resource;
|
||||
iss = new std::ifstream(f, std::ios::in);
|
||||
@@ -80,6 +85,11 @@ std::string find_resource(const std::string& resource,
|
||||
}
|
||||
delete iss;
|
||||
|
||||
// What about `*' ?
|
||||
if (utils::expandEnv(f, 0).size() > 1) {
|
||||
return f;
|
||||
}
|
||||
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user