mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
@@ -38,11 +38,12 @@ bool PmFromFile::init(const std::string &config, std::string *error) {
|
||||
}
|
||||
iss = new std::stringstream(client.content);
|
||||
} else {
|
||||
std::string resource = utils::find_resource(m_param, config);
|
||||
std::string err;
|
||||
std::string resource = utils::find_resource(m_param, config, &err);
|
||||
iss = new std::ifstream(resource, std::ios::in);
|
||||
|
||||
if (((std::ifstream *)iss)->is_open() == false) {
|
||||
error->assign("Failed to open file: " + m_param);
|
||||
error->assign("Failed to open file: " + m_param + ". " + err);
|
||||
delete iss;
|
||||
return false;
|
||||
}
|
||||
|
@@ -26,9 +26,10 @@ namespace operators {
|
||||
|
||||
|
||||
bool ValidateDTD::init(const std::string &file, std::string *error) {
|
||||
m_resource = utils::find_resource(m_param, file);
|
||||
std::string err;
|
||||
m_resource = utils::find_resource(m_param, file, &err);
|
||||
if (m_resource == "") {
|
||||
error->assign("XML: File not found: " + m_param + ".");
|
||||
error->assign("XML: File not found: " + m_param + ". " + err);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -26,9 +26,10 @@ namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
bool ValidateSchema::init(const std::string &file, std::string *error) {
|
||||
m_resource = utils::find_resource(m_param, file);
|
||||
std::string err;
|
||||
m_resource = utils::find_resource(m_param, file, &err);
|
||||
if (m_resource == "") {
|
||||
error->assign("XML: File not found: " + m_param + ".");
|
||||
error->assign("XML: File not found: " + m_param + ". " + err);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user