mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
rule id is not logged in case rule has no msg
This commit is contained in:
committed by
Felipe Zimmerle
parent
7f647e85ad
commit
51f312736a
18
apache2/re.c
18
apache2/re.c
@@ -1889,11 +1889,12 @@ static apr_status_t msre_ruleset_process_phase_(msre_ruleset *ruleset, modsec_re
|
||||
}
|
||||
}
|
||||
else if (rc < 0) {
|
||||
if (rule->actionset != NULL && rule->actionset->msg != NULL) {
|
||||
msr_log(msr, 1, "Rule processing failed (id=%s, msg=%s).", rule->actionset->id, rule->actionset->msg);
|
||||
} else {
|
||||
msr_log(msr, 1, "Rule processing failed.");
|
||||
const char *id = "", *msg = "";
|
||||
if (rule->actionset) {
|
||||
if (rule->actionset->id) id = rule->actionset->id;
|
||||
if (rule->actionset->msg) msg = rule->actionset->msg;
|
||||
}
|
||||
msr_log(msr, 1, "Rule processing failed (id=%s, msg=%s).", id, msg);
|
||||
|
||||
if (msr->txcfg->reqintercept_oe == 1) {
|
||||
apr_table_clear(msr->matched_vars);
|
||||
@@ -1923,11 +1924,12 @@ static apr_status_t msre_ruleset_process_phase_(msre_ruleset *ruleset, modsec_re
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (rule->actionset != NULL && rule->actionset->msg != NULL) {
|
||||
msr_log(msr, 1, "Rule processing failed with unknown return code: %d (id=%s, msg=%s).", rc, rule->actionset->id, rule->actionset->msg);
|
||||
} else {
|
||||
msr_log(msr, 1, "Rule processing failed with unknown return code: %d", rc);
|
||||
const char *id = "", *msg = "";
|
||||
if (rule->actionset) {
|
||||
if (rule->actionset->id) id = rule->actionset->id;
|
||||
if (rule->actionset->msg) msg = rule->actionset->msg;
|
||||
}
|
||||
msr_log(msr, 1, "Rule processing failed with unknown return code: %d (id=%s, msg=%s).", rc, id, msg);
|
||||
apr_table_clear(msr->matched_vars);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user