]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix-socket: fix alert metadata logging
authorAngelo Mirabella <amirabella@lastline.com>
Wed, 11 Mar 2020 15:11:19 +0000 (15:11 +0000)
committerShivani Bhardwaj <shivanib134@gmail.com>
Thu, 3 Dec 2020 20:14:23 +0000 (01:44 +0530)
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.

(cherry picked from commit ea15282f47c6ff781533e3a063f9c903dd6f1afb)

src/suricata.c

index d8cd1b40973de99e1cd8c8b46a6b89d7c5cdcd5c..5b76b0559f1bbb8cefc61a5ec9af92c85c7c7ca5 100644 (file)
@@ -2324,11 +2324,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();
 }