mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Change ctl parameters to be case insensitive.
Initial implementation of ctl:removeRuleById. See #259.
This commit is contained in:
19
apache2/re.c
19
apache2/re.c
@@ -1384,6 +1384,25 @@ apr_status_t msre_rule_process(msre_rule *rule, modsec_rec *msr) {
|
||||
int invocations = 0;
|
||||
int multi_match = 0;
|
||||
|
||||
/* Check if this rule was excluded at runtime */
|
||||
if ((rule->actionset->id !=NULL) && (! apr_is_empty_array(msr->removed_rules))) {
|
||||
const char *range;
|
||||
|
||||
for(i = 0; i < msr->removed_rules->nelts; i++) {
|
||||
range = ((const char**)msr->removed_rules->elts)[i];
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
msr_log(msr, 9, "Checking rule id=\"%s\" against exclusion: %s", rule->actionset->id, range);
|
||||
}
|
||||
|
||||
if (rule_id_in_range(atoi(rule->actionset->id), range)) {
|
||||
msr_log(msr, 5, "Rule id=\"%s\" excluded.", rule->actionset->id);
|
||||
return RULE_NO_MATCH;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Choose the correct metadata/disruptive action actionset. */
|
||||
acting_actionset = rule->actionset;
|
||||
if (rule->chain_starter != NULL) {
|
||||
|
Reference in New Issue
Block a user