mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Removed useless code
This commit is contained in:
@@ -1251,19 +1251,19 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
return -1;
|
||||
}
|
||||
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
if (re == NULL) {
|
||||
msr_log(msr, 1, "Ctl: Memory allocation error");
|
||||
return -1;
|
||||
}
|
||||
re->type = RULE_EXCEPTION_REMOVE_ID;
|
||||
re->param = (const char *)apr_pstrdup(msr->mp, p1);
|
||||
if (re->param == NULL) {
|
||||
msr_log(msr, 1, "Ctl: Memory allocation error");
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
if (re == NULL) {
|
||||
msr_log(msr, 1, "Ctl: Memory allocation error");
|
||||
return -1;
|
||||
}
|
||||
re->type = RULE_EXCEPTION_REMOVE_ID;
|
||||
re->param = (const char *)apr_pstrdup(msr->mp, p1);
|
||||
if (re->param == NULL) {
|
||||
msr_log(msr, 1, "Ctl: Memory allocation error");
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
} else
|
||||
if (strcasecmp(name, "ruleRemoveTargetByTag") == 0) {
|
||||
rule_exception *re = NULL;
|
||||
@@ -1271,7 +1271,6 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
char *savedptr = NULL;
|
||||
|
||||
p1 = apr_strtok(value,";",&savedptr);
|
||||
|
||||
p2 = apr_strtok(NULL,";",&savedptr);
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
@@ -1282,16 +1281,16 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
return -1;
|
||||
}
|
||||
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
re->type = RULE_EXCEPTION_REMOVE_TAG;
|
||||
re->param = (const char *)apr_pstrdup(msr->mp, p1);
|
||||
re->param_data = msc_pregcomp(msr->mp, p1, 0, NULL, NULL);
|
||||
if (re->param_data == NULL) {
|
||||
msr_log(msr, 1, "ModSecurity: Invalid regular expression \"%s\"", p1);
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
re->type = RULE_EXCEPTION_REMOVE_TAG;
|
||||
re->param = (const char *)apr_pstrdup(msr->mp, p1);
|
||||
re->param_data = msc_pregcomp(msr->mp, p1, 0, NULL, NULL);
|
||||
if (re->param_data == NULL) {
|
||||
msr_log(msr, 1, "ModSecurity: Invalid regular expression \"%s\"", p1);
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
} else
|
||||
if (strcasecmp(name, "ruleRemoveTargetByMsg") == 0) {
|
||||
rule_exception *re = NULL;
|
||||
@@ -1299,7 +1298,6 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
char *savedptr = NULL;
|
||||
|
||||
p1 = apr_strtok(value,";",&savedptr);
|
||||
|
||||
p2 = apr_strtok(NULL,";",&savedptr);
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
@@ -1310,23 +1308,20 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
return -1;
|
||||
}
|
||||
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
re->type = RULE_EXCEPTION_REMOVE_MSG;
|
||||
re->param = apr_pstrdup(msr->mp, p1);
|
||||
re->param_data = msc_pregcomp(msr->mp, p1, 0, NULL, NULL);
|
||||
if (re->param_data == NULL) {
|
||||
msr_log(msr, 1, "ModSecurity: Invalid regular expression \"%s\"", p1);
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
/* Should never happen, but log if it does. */
|
||||
msr_log(msr, 1, "Internal Error: Unknown ctl action \"%s\".", name);
|
||||
return -1;
|
||||
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
|
||||
re->type = RULE_EXCEPTION_REMOVE_MSG;
|
||||
re->param = apr_pstrdup(msr->mp, p1);
|
||||
re->param_data = msc_pregcomp(msr->mp, p1, 0, NULL, NULL);
|
||||
if (re->param_data == NULL) {
|
||||
msr_log(msr, 1, "ModSecurity: Invalid regular expression \"%s\"", p1);
|
||||
return -1;
|
||||
}
|
||||
apr_table_addn(msr->removed_targets, apr_pstrdup(msr->mp, p2), (void *)re);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Should never happen, but log if it does. */
|
||||
msr_log(msr, 1, "Internal Error: Unknown ctl action \"%s\".", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1764,7 +1759,7 @@ static apr_status_t msre_action_setvar_parse(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
var_value = s + 1;
|
||||
*s = '\0';
|
||||
|
||||
while ((*var_value != '\0')&&(isspace(*var_value))) var_value++;
|
||||
while (isspace(*var_value)) var_value++;
|
||||
}
|
||||
|
||||
return msre_action_setvar_execute(msr,mptmp,rule,var_name,var_value);
|
||||
|
Reference in New Issue
Block a user