From: Jason Ish Date: Wed, 15 Mar 2017 16:52:57 +0000 (-0600) Subject: detect: don't consider an empty rule file an error X-Git-Tag: suricata-4.0.0-beta1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff8882cbdaf4ab2dc9f736fdd8ea56dcbe84fb1;p=thirdparty%2Fsuricata.git detect: don't consider an empty rule file an error --- 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); } } }