From: Jacob Masen-Smith Date: Fri, 11 May 2018 19:27:31 +0000 (-0700) Subject: detect/analyzer: disable automatic json output X-Git-Tag: suricata-4.1.0-rc2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1b45a54c56fe237580500445e05f811e951516b;p=thirdparty%2Fsuricata.git detect/analyzer: disable automatic json output EngineAnalysisRules2 was in a strange location where it did not respect the --engine-analysis flag. It has been moved to the same call location as EngineAnalysisRules. --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 47b1d24dc4..a0b632480f 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -1855,9 +1855,6 @@ static int SigMatchPrepare(DetectEngineCtx *de_ctx) SigMatch *sm = s->init_data->smlists[type]; s->sm_arrays[type] = SigMatchList2DataArray(sm); } -#ifdef HAVE_LIBJANSSON - EngineAnalysisRules2(de_ctx, s); -#endif /* free lists. Ctx' are xferred to sm_arrays so won't get freed */ uint32_t i; for (i = 0; i < s->init_data->smlists_array_size; i++) { diff --git a/src/detect-engine-loader.c b/src/detect-engine-loader.c index 7b9a4a2fa6..235a997350 100644 --- a/src/detect-engine-loader.c +++ b/src/detect-engine-loader.c @@ -175,6 +175,9 @@ static int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, } if (rule_engine_analysis_set) { EngineAnalysisRules(de_ctx, sig, line); +#ifdef HAVE_LIBJANSSON + EngineAnalysisRules2(de_ctx, sig); +#endif } } SCLogDebug("signature %"PRIu32" loaded", sig->id);