From f955ba7e7b6e9e3327fca08118e47713bfed0d6f Mon Sep 17 00:00:00 2001 From: Breno Silva Date: Mon, 3 Jun 2013 19:49:45 -0700 Subject: [PATCH] Added: severity action now supports strings --- apache2/re_actions.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/apache2/re_actions.c b/apache2/re_actions.c index e71b35d7..6a5fbac6 100644 --- a/apache2/re_actions.c +++ b/apache2/re_actions.c @@ -489,9 +489,27 @@ static apr_status_t msre_action_ver_init(msre_engine *engine, /* severity */ static apr_status_t msre_action_severity_init(msre_engine *engine, - msre_actionset *actionset, msre_action *action) + msre_actionset *actionset, msre_action *action) { - actionset->severity = atoi(action->param); + if (strcasecmp(action->param, "emergency") == 0) { + actionset->severity = 0; + } else if (strcasecmp(action->param, "alert") == 0) { + actionset->severity = 1; + } else if (strcasecmp(action->param, "critical") == 0) { + actionset->severity = 2; + } else if (strcasecmp(action->param, "error") == 0) { + actionset->severity = 3; + } else if (strcasecmp(action->param, "warning") == 0) { + actionset->severity = 4; + } else if (strcasecmp(action->param, "notice") == 0) { + actionset->severity = 5; + } else if (strcasecmp(action->param, "info") == 0) { + actionset->severity = 6; + } else if (strcasecmp(action->param, "debug") == 0) { + actionset->severity = 7; + } else { + actionset->severity = atoi(action->param); + } return 1; }