From 9ff8882cbdaf4ab2dc9f736fdd8ea56dcbe84fb1 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 15 Mar 2017 10:52:57 -0600 Subject: [PATCH] detect: don't consider an empty rule file an error --- src/detect.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/detect.c b/src/detect.c index 3ccb3b8e99..21bffc78ba 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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); } } } -- 2.47.2