]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: don't consider an empty rule file an error 2655/head
authorJason Ish <ish@unx.ca>
Wed, 15 Mar 2017 16:52:57 +0000 (10:52 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Apr 2017 14:34:40 +0000 (16:34 +0200)
src/detect.c

index 3ccb3b8e995a98e5028fa810f319338125333f39..21bffc78ba6f90c24e7011c9e22256597b6a60cf 100644 (file)
@@ -475,10 +475,14 @@ int SigLoadSignatures(DetectEngineCtx *de_ctx, char *sig_file, int sig_file_excl
                     ret = ProcessSigFiles(de_ctx, sfile, &sig_stat, &good_sigs, &bad_sigs);
                     SCFree(sfile);
 
-                    if (ret != 0 || good_sigs == 0) {
-                        if (de_ctx->failure_fatal == 1) {
-                            exit(EXIT_FAILURE);
-                        }
+                    if (de_ctx->failure_fatal && ret != 0) {
+                        /* Some rules failed to load, just exit as
+                         * errors would have already been logged. */
+                        exit(EXIT_FAILURE);
+                    }
+
+                    if (good_sigs == 0) {
+                        SCLogConfig("No rules loaded from %s.", file->val);
                     }
                 }
             }