mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Support comments in ipMatchFromFile file via '#' token
This commit is contained in:
parent
07514f9779
commit
af860e2eef
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
|||||||
v3.x.y - YYYY-MMM-DD (to be released)
|
v3.x.y - YYYY-MMM-DD (to be released)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
- Support comments in ipMatchFromFile file via '#' token
|
||||||
|
[Issue #2554 - @tomsommer, @martinhsv]
|
||||||
- Fix: FILES_TMP_CONTENT collection key should use part name
|
- Fix: FILES_TMP_CONTENT collection key should use part name
|
||||||
[Issue #2831 - @airween]
|
[Issue #2831 - @airween]
|
||||||
- Use AS_HELP_STRING instead of obsolete AC_HELP_STRING macro
|
- Use AS_HELP_STRING instead of obsolete AC_HELP_STRING macro
|
||||||
|
@ -88,6 +88,10 @@ IpTree::~IpTree() {
|
|||||||
bool IpTree::addFromBuffer(std::istream *ss, std::string *error) {
|
bool IpTree::addFromBuffer(std::istream *ss, std::string *error) {
|
||||||
char *error_msg = NULL;
|
char *error_msg = NULL;
|
||||||
for (std::string line; std::getline(*ss, line); ) {
|
for (std::string line; std::getline(*ss, line); ) {
|
||||||
|
size_t comment_start = line.find('#');
|
||||||
|
if (comment_start != std::string::npos) {
|
||||||
|
line = line.substr(0, comment_start);
|
||||||
|
}
|
||||||
int res = add_ip_from_param(line.c_str(), &m_tree, &error_msg);
|
int res = add_ip_from_param(line.c_str(), &m_tree, &error_msg);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
if (error_msg != NULL) {
|
if (error_msg != NULL) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
127.0.0.1
|
127.0.0.1
|
||||||
|
# Comment line
|
||||||
10.10.10.1
|
10.10.10.1
|
||||||
::1
|
::1
|
||||||
200.249.12.31
|
200.249.12.31
|
||||||
|
Loading…
x
Reference in New Issue
Block a user