Checkin fix to rule removal code to avoid placeholders.

This commit is contained in:
brectanus 2007-12-02 15:35:09 +00:00
parent 9e9bb318b3
commit 2bf4556cd0

View File

@ -1028,31 +1028,34 @@ static int msre_ruleset_phase_rule_remove_with_exception(msre_ruleset *ruleset,
if (mode == 0) { /* Looking for next rule. */ if (mode == 0) { /* Looking for next rule. */
int remove_rule = 0; int remove_rule = 0;
switch(re->type) { /* Only remove non-placeholder rules */
case RULE_EXCEPTION_REMOVE_ID : if (rule->placeholder == RULE_PH_NONE) {
if ((rule->actionset != NULL)&&(rule->actionset->id != NULL)) { switch(re->type) {
int ruleid = atoi(rule->actionset->id); case RULE_EXCEPTION_REMOVE_ID :
if ((rule->actionset != NULL)&&(rule->actionset->id != NULL)) {
int ruleid = atoi(rule->actionset->id);
if (rule_id_in_range(ruleid, re->param)) { if (rule_id_in_range(ruleid, re->param)) {
remove_rule = 1; remove_rule = 1;
}
} }
}
break; break;
case RULE_EXCEPTION_REMOVE_MSG : case RULE_EXCEPTION_REMOVE_MSG :
if ((rule->actionset != NULL)&&(rule->actionset->msg != NULL)) { if ((rule->actionset != NULL)&&(rule->actionset->msg != NULL)) {
char *my_error_msg = NULL; char *my_error_msg = NULL;
int rc = msc_regexec(re->param_data, int rc = msc_regexec(re->param_data,
rule->actionset->msg, strlen(rule->actionset->msg), rule->actionset->msg, strlen(rule->actionset->msg),
&my_error_msg); &my_error_msg);
if (rc >= 0) { if (rc >= 0) {
remove_rule = 1; remove_rule = 1;
}
} }
}
break; break;
}
} }
if (remove_rule) { if (remove_rule) {