}
optname = optstr;
- if (requires) {
- if (strcmp(optname, "requires")) {
- goto finish;
- }
+ /* Check for options that are only to be processed during the
+ * first "requires" pass. */
+ bool requires_only = strcmp(optname, "requires") == 0 || strcmp(optname, "sid") == 0;
+ if ((requires && !requires_only) || (!requires && requires_only)) {
+ goto finish;
}
/* Call option parsing */
AppLayerHtpNeedFileInspection();
}
}
- if (s->id == 0) {
- SCLogError("Signature missing required value \"sid\".");
- SCReturnInt(0);
- }
+
SCReturnInt(1);
}
goto error;
}
+ /* Check for a SID before continuuing. */
+ if (sig->id == 0) {
+ SCLogError("Signature missing required value \"sid\".");
+ goto error;
+ }
+
/* Now completely parse the rule. */
ret = SigParse(de_ctx, sig, sigstr, dir, &parser, false);
BUG_ON(ret == -4);