detect/classtype: warn on duplicate classtype

Issue warning instead of erroring and invalidating the rule.

It's not a very serious issue, so don't error out.
pull/4288/head
Victor Julien 7 years ago
parent 282e1c2520
commit 5e5761a29c

@ -108,6 +108,12 @@ static int DetectClasstypeSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
char parsed_ct_name[1024] = "";
SCClassConfClasstype *ct = NULL;
if ((s->class > 0) || (s->class_msg != NULL)) {
SCLogWarning(SC_ERR_CONFLICTING_RULE_KEYWORDS, "duplicated 'classtype' "
"keyword detected. Using first occurence in the rule");
return 0;
}
if (DetectClasstypeParseRawString(rawstr, parsed_ct_name, sizeof(parsed_ct_name)) < 0) {
SCLogError(SC_ERR_PCRE_PARSE, "invalid value for classtype keyword: "
"\"%s\"", rawstr);
@ -121,12 +127,6 @@ static int DetectClasstypeSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
goto error;
}
if ((s->class > 0) || (s->class_msg != NULL))
{
SCLogError(SC_ERR_INVALID_RULE_ARGUMENT, "duplicated 'classtype' keyword detected");
goto error;
}
/* if we have retrieved the classtype, assign the message to be displayed
* for this Signature by fast.log, if a Packet matches this Signature */
s->class = ct->classtype_id;

Loading…
Cancel
Save