]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
exception: use mix of logconfig/info/warning
authorJuliana Fajardini <jufajardini@oisf.net>
Thu, 1 Jun 2023 23:33:18 +0000 (20:33 -0300)
committerVictor Julien <vjulien@oisf.net>
Sat, 29 Jul 2023 06:00:12 +0000 (08:00 +0200)
Use a mix of SCLogConfig, Warning and Info.
This mix works as follows: when something unnexpected for the user
happens - for instance, the engine ignoring an invalid config value, we
use warning. For indicating the value for the master switch, which
happens only once, we use Info. For all the other cases, we use
SCLogConfig.

It is possible that SCLogConfig isn't showing at the moment, this is a
possible bug to investigate further.

Related to
Bug #5825

(cherry picked from commit 69311ab02f33c8396babfe810ac5a066c900d31e)

src/util-exception-policy.c

index 29955d5ea2f7a826e1a5ccb91639ce7fadc93f96..383c72d37031bed0890123eabad5b378e0bb74ee 100644 (file)
@@ -146,7 +146,8 @@ static enum ExceptionPolicy SetIPSOption(
         const char *option, const char *value_str, enum ExceptionPolicy p)
 {
     if (!EngineModeIsIPS()) {
-        SCLogConfig("%s: %s not a valid config in IDS mode. Ignoring it.)", option, value_str);
+        SCLogWarning(SC_ERR_INVALID_VALUE, "%s: %s not a valid config in IDS mode. Ignoring it.",
+                option, value_str);
         return EXCEPTION_POLICY_NOT_SET;
     }
     return p;
@@ -189,7 +190,8 @@ static enum ExceptionPolicy ExceptionPolicyMasterParse(const char *value)
     policy = ExceptionPolicyConfigValueParse("exception-policy", value);
     g_eps_have_exception_policy = true;
     policy = SetIPSOption("exception-policy", value, policy);
-    SCLogConfig("exception-policy set to: %s", ExceptionPolicyEnumToString(policy));
+
+    SCLogInfo("exception-policy set to: %s", ExceptionPolicyEnumToString(policy));
 
     return policy;
 }