From 3a349bb0359836348524468391faa2dbfbf0c018 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 9 Dec 2021 16:59:04 -0600 Subject: [PATCH] datasets: initialize after dropping privileges Move initialization of datasets to a point after privileges have been dropped. Ticket 4239 (cherry picked from commit 92eb14c5adc985433dd44bdcac18fa6e67440043) --- src/suricata.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 80aae67c2d70..88ecc1ae437f 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -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