]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
datasets: initialize after dropping privileges
authorJason Ish <jason.ish@oisf.net>
Thu, 9 Dec 2021 22:59:04 +0000 (16:59 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 13 Dec 2021 17:48:37 +0000 (18:48 +0100)
Move initialization of datasets to a point after privileges
have been dropped.

Ticket 4239

src/suricata.c

index 3bd1e8133ae1ecd88affc41d28cac549c417d416..dc26a13c402426885e28bae936591a57d023190e 100644 (file)
@@ -2000,8 +2000,6 @@ static int InitSignalHandler(SCInstance *suri)
  * Will be run once per pcap in unix-socket mode */
 void PreRunInit(const int runmode)
 {
-    /* Initialize Datasets to be able to use them with unix socket */
-    DatasetsInit();
     HttpRangeContainersInit();
     if (runmode == RUNMODE_UNIX_SOCKET)
         return;
@@ -2029,6 +2027,7 @@ void PreRunPostPrivsDropInit(const int runmode)
 {
     StatsSetupPostConfigPreOutput();
     RunModeInitializeOutputs();
+    DatasetsInit();
 
     if (runmode == RUNMODE_UNIX_SOCKET) {
         /* As the above did some necessary startup initialization, it