Skip to content

Commit

Permalink
exceptions: use mix of logconfig/info/warning
Browse files Browse the repository at this point in the history
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 OISF#5825
  • Loading branch information
jufajardini authored and victorjulien committed Jun 13, 2023
1 parent 7f8536b commit 69311ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util-exception-policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ 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("%s: %s not a valid config in IDS mode. Ignoring it.", option, value_str);
return EXCEPTION_POLICY_NOT_SET;
}
return p;
Expand Down Expand Up @@ -191,7 +191,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;
}
Expand Down

0 comments on commit 69311ab

Please sign in to comment.