From ea15282f47c6ff781533e3a063f9c903dd6f1afb Mon Sep 17 00:00:00 2001 From: Angelo Mirabella Date: Wed, 11 Mar 2020 15:11:19 +0000 Subject: [PATCH] unix-socket: fix alert metadata logging This changeset fixes a bug that was preventing suricata to dump alert metadata info when running in unix-socket mode. When running in unix-socket mode, suricata was skipping the initialization of the output modules and, as a consequence, the metadata output module was never invoked. --- src/suricata.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 108c4307db..3d6faf15c8 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2032,11 +2032,12 @@ void PreRunInit(const int runmode) * but after we dropped privs */ void PreRunPostPrivsDropInit(const int runmode) { + StatsSetupPostConfigPreOutput(); + RunModeInitializeOutputs(); + if (runmode == RUNMODE_UNIX_SOCKET) return; - StatsSetupPostConfigPreOutput(); - RunModeInitializeOutputs(); StatsSetupPostConfigPostOutput(); }