prelude-lml/master: Fix 'silent' rules warning when using --dump-unmatched

[email protected] Mon, 11 Jan 2010 17:51:03 +0100 (CET)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit b8c6f11774fbc54f1dfbae8afc24845805770464
Author: Yoann Vandoorselaere <[email protected]>
Date:   Mon Jan 4 12:28:50 2010 +0100

    Fix 'silent' rules warning when using --dump-unmatched
    
    When using the --dump-unmatched option, 'silent' rules used to trigger
    a warning.


========================================

 plugins/pcre/rule-regex.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

========================================

diff --git a/plugins/pcre/rule-regex.c b/plugins/pcre/rule-regex.c
index 786dd18..b1fe329 100644
--- a/plugins/pcre/rule-regex.c
+++ b/plugins/pcre/rule-regex.c
@@ -371,15 +371,18 @@ static int match_rule_list(pcre_plugin_t *plugin,
 
         create_context_if_needed(plugin, rule, state, log_entry);
 
-        if ( ! (rule->flags & PCRE_RULE_FLAGS_SILENT) && state->idmef ) {
-                prelude_log_debug(4, "lml alert emit id=%d (last=%d) %s\n",
-                                  rule->id, rule->flags & PCRE_RULE_FLAGS_LAST,
-                                  lml_log_entry_get_message(log_entry));
+        if ( state->idmef ) {
+                *match_flags |= PCRE_MATCH_FLAGS_ALERT;
 
-                lml_alert_emit(NULL, NULL, state->idmef);
-                destroy_idmef_state(state);
+                if ( ! (rule->flags & PCRE_RULE_FLAGS_SILENT) ) {
+                        prelude_log_debug(4, "lml alert emit id=%d (last=%d) %s\n",
+                                          rule->id, rule->flags & PCRE_RULE_FLAGS_LAST,
+                                          lml_log_entry_get_message(log_entry));
+
+                        lml_alert_emit(NULL, NULL, state->idmef);
+                        destroy_idmef_state(state);
+                }
 
-                *match_flags |= PCRE_MATCH_FLAGS_ALERT;
         }
 
         if ( rule->flags & PCRE_RULE_FLAGS_LAST )
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog