From: Juliana Fajardini Date: Thu, 1 Jun 2023 23:33:18 +0000 (-0300) Subject: exception: use mix of logconfig/info/warning X-Git-Tag: suricata-6.0.14~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=298706d5bd04cd3088769fdc8f6c30d262ade13a;p=thirdparty%2Fsuricata.git exception: use mix of logconfig/info/warning 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) --- diff --git a/src/util-exception-policy.c b/src/util-exception-policy.c index 29955d5ea2..383c72d370 100644 --- a/src/util-exception-policy.c +++ b/src/util-exception-policy.c @@ -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; }