]> 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)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 18 Jan 2022 08:18:45 +0000 (13:48 +0530)
Move initialization of datasets to a point after privileges
have been dropped.

Ticket 4239

(cherry picked from commit 92eb14c5adc985433dd44bdcac18fa6e67440043)

src/suricata.c

index 80aae67c2d7052b6ac7723c6d83c83bc9b10131e..88ecc1ae437fbb223b2f6599622d1472c2469341 100644 (file)
@@ -2012,8 +2012,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();
     if (runmode == RUNMODE_UNIX_SOCKET)
         return;
 
@@ -2040,6 +2038,7 @@ void PreRunPostPrivsDropInit(const int runmode)
 {
     StatsSetupPostConfigPreOutput();
     RunModeInitializeOutputs();
+    DatasetsInit();
 
     if (runmode == RUNMODE_UNIX_SOCKET) {
         /* As the above did some necessary startup initialization, it