]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #189 in SNORT/snort3 from Oops_should_have_used_ParseWarning_not_L...
authorRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 11 Dec 2015 16:54:33 +0000 (11:54 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 11 Dec 2015 16:54:33 +0000 (11:54 -0500)
Squashed commit of the following:

commit 1ddf9c26f265f96083835f459786ec8b4b5385a1
Author: Victor Roemer <viroemer@cisco.com>
Date:   Fri Dec 11 11:52:29 2015 -0500

    WARN_CONF instead of WARN_PLUGINS

commit 6389a2d30695082d0a80d6e7170addd0c2443a31
Author: Victor Roemer <viroemer@cisco.com>
Date:   Fri Dec 11 11:39:52 2015 -0500

    WARN_CONF instead of WARN_PLUGINS

commit dac35f30fab8c4578c32a31165600160a2f87709
Author: Victor Roemer <viroemer@cisco.com>
Date:   Thu Dec 10 16:41:34 2015 -0500

    Call ParseWarning() instead of LogMessage().

src/log/messages.cc
src/network_inspectors/reputation/reputation_module.cc
src/service_inspectors/imap/imap_module.cc
src/service_inspectors/pop/pop_module.cc
src/service_inspectors/smtp/smtp_module.cc

index 0b56ae4e75357b88852e7af6fcad9b38ee6f65cb..7c2b43d0a9b2f9f40ad593384c3fecf40b2d506f 100644 (file)
@@ -88,7 +88,8 @@ void ParseMessage(const char* format, ...)
     unsigned file_line;
     get_parse_location(file_name, file_line);
 
-    if (file_name != NULL)
+   // FIXIT-L Plz how can same format filename/linenum as ParseWarning
+   if (file_name != NULL)
         LogMessage("%s(%d) %s\n", file_name, file_line, buf);
     else
         LogMessage("%s\n", buf);
@@ -112,6 +113,7 @@ void ParseWarning(WarningGroup wg, const char* format, ...)
     unsigned file_line;
     get_parse_location(file_name, file_line);
 
+    // FIXIT-L Why `file_line` here and `file_name` in ParseMessage?
     if ( file_line )
         LogMessage("WARNING: %s:%d %s\n", file_name, file_line, buf);
     else
@@ -158,6 +160,7 @@ NORETURN void ParseAbort(const char* format, ...)
     unsigned file_line;
     get_parse_location(file_name, file_line);
 
+    // FIXIT-L Refer to ParseMessage above.
     if (file_name != NULL)
         FatalError("%s(%d) %s\n", file_name, file_line, buf);
     else
index 73625ea4fc58eeaa2a7a6dd526037649038400b7..5c9ff991d1303fbfc62b7eacb6f958c37a24d5cd 100644 (file)
@@ -147,7 +147,7 @@ bool ReputationModule::end(const char*, int, SnortConfig*)
     EstimateNumEntries(conf);
     if (conf->numEntries <= 0)
     {
-        LogMessage("WARNING: Can't find any whitelist/blacklist entries. "
+        ParseWarning(WARN_CONF, "Can't find any whitelist/blacklist entries. "
             "Reputation Preprocessor disabled.\n");
         return true;
     }
@@ -156,9 +156,9 @@ bool ReputationModule::end(const char*, int, SnortConfig*)
 
     if ( (conf->priority == WHITELISTED_TRUST) && (conf->whiteAction == UNBLACK) )
     {
-        LogMessage("WARNING: Keyword \"whitelist\" for \"priority\" is not applied "
-            "when white action is unblack.\n");
-        conf->priority = WHITELISTED_UNBLACK;
+        ParseWarning(WARN_CONF, "Keyword \"whitelist\" for \"priority\" is "
+            "not applied when white action is unblack.\n");
+            conf->priority = WHITELISTED_UNBLACK;
     }
 
     LoadListFile(conf->blacklist_path, conf->local_black_ptr, conf);
index 6f2f41f591801ec5ff45717b7ce02d60c645c75a..330e4beb94ab53b21d18893347f408484c973014 100644 (file)
@@ -99,7 +99,7 @@ bool ImapModule::set(const char*, Value& v, SnortConfig*)
             {
                 decode_depth = decode_depth - 4;  // FIXIT-L what does this do?
             }
-            LogMessage("WARNING: IMAP: 'b64_decode_depth' is not a multiple of 4. "
+            ParseWarning(WARN_CONF, "IMAP: 'b64_decode_depth' is not a multiple of 4. "
                 "Rounding up to the next multiple of 4. The new 'b64_decode_depth' is %d.\n",
                 decode_depth);
         }
index cea594cc3eea5d7f2e7b0605fa5495dce50009ba..ada0ed5a4f38dc8401e53af4e6d3455034ac1600 100644 (file)
@@ -99,8 +99,10 @@ bool PopModule::set(const char*, Value& v, SnortConfig*)
             {
                 decode_depth = decode_depth - 4;
             }
-            LogMessage("WARNING: POP: 'b64_decode_depth' is not a multiple of 4. "
-                "Rounding up to the next multiple of 4. The new 'b64_decode_depth' is %d.\n",
+            ParseWarning(WARN_CONF, 
+                "POP: 'b64_decode_depth' is not a multiple of 4. "
+                "Rounding up to the next multiple of 4. "
+                "The new 'b64_decode_depth' is %d.\n",
                 decode_depth);
         }
         config->decode_conf.set_b64_depth(decode_depth);
index fb2bdcd0bf6133be55dedae4de7b04c768306f39..8b9af2f8a9c40eab0352e86c42ec606c1eceec89 100644 (file)
@@ -238,7 +238,7 @@ bool SmtpModule::set(const char*, Value& v, SnortConfig*)
             {
                 decode_depth = decode_depth - 4;
             }
-            LogMessage("WARNING: SMTP: 'b64_decode_depth' is not a multiple of 4. "
+            ParseWarning(WARN_CONF, "SMTP: 'b64_decode_depth' is not a multiple of 4. "
                 "Rounding up to the next multiple of 4. The new 'b64_decode_depth' is %d.\n",
                 decode_depth);
         }