mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Fix resource load on ip match from file
This commit is contained in:
parent
6f718f9d40
commit
e3b6b4ccff
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
|||||||
v3.0.x - YYYY-MMM-DD (To be released)
|
v3.0.x - YYYY-MMM-DD (To be released)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
- Fixed resource load on ip match from file
|
||||||
|
[#1674 - @zimmerle, @StefaanSeys]
|
||||||
- Fixed examples compilation while using disable-shared
|
- Fixed examples compilation while using disable-shared
|
||||||
[#1670 - @zimmerle, @ivanbaldo]
|
[#1670 - @zimmerle, @ivanbaldo]
|
||||||
- Fixed compilation issue while xml is disabled
|
- Fixed compilation issue while xml is disabled
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "src/operators/ip_match_from_file.h"
|
#include "src/operators/ip_match_from_file.h"
|
||||||
|
#include "src/utils/system.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -33,7 +34,11 @@ bool IpMatchFromFile::init(const std::string &file,
|
|||||||
if (m_param.compare(0, 8, "https://") == 0) {
|
if (m_param.compare(0, 8, "https://") == 0) {
|
||||||
res = m_tree.addFromUrl(m_param, &e);
|
res = m_tree.addFromUrl(m_param, &e);
|
||||||
} else {
|
} else {
|
||||||
res = m_tree.addFromFile(m_param, &e);
|
std::string resf = utils::find_resource(m_param, file, error);\
|
||||||
|
if (resf == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = m_tree.addFromFile(resf, &e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == false) {
|
if (res == false) {
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"expected":{
|
"expected":{
|
||||||
"parser_error":"File: operator-ipMatchFromFile.json. Line: 2. Column: 19. Failed to open file: file-not-found.txt"
|
"parser_error":"Rules error. File: operator-ipMatchFromFile.json. Line: 2. Column: 19. Looking at: 'file-not-found.txt', 'file-not-found.txt', 'operator-ipMatchFromFile.json/file-not-found.txt', 'operator-ipMatchFromFile.json/file-not-found.txt'."
|
||||||
},
|
},
|
||||||
"rules":[
|
"rules":[
|
||||||
"SecRuleEngine On",
|
"SecRuleEngine On",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user