]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: call mac_init from sd-executor
authorLuca Boccassi <bluca@debian.org>
Wed, 8 Nov 2023 15:24:17 +0000 (15:24 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 8 Nov 2023 17:44:36 +0000 (17:44 +0000)
Before the split the SELinux database was inherited via CoW. Since
the split we need to reopen it.

Follow-up for bb5232b6a3b8af

src/core/executor.c

index e19e8718162d54f62be4f0c38a567fa66cdf98a1..86fbaef347060de31d9114c633c725c8c79b8881 100644 (file)
@@ -15,6 +15,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "getopt-defs.h"
+#include "label-util.h"
 #include "parse-util.h"
 #include "pretty-print.h"
 #include "static-destruct.h"
@@ -198,6 +199,10 @@ int main(int argc, char *argv[]) {
         log_set_prohibit_ipc(true);
         log_setup();
 
+        r = mac_init();
+        if (r < 0)
+                return log_error_errno(r, "Failed to initialize MAC layer: %m");
+
         r = fdset_new_fill(/* filter_cloexec= */ 0, &fdset);
         if (r < 0)
                 return log_error_errno(r, "Failed to create fd set: %m");