]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Initialize SELinux in user instances
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 19 Jun 2020 16:24:10 +0000 (18:24 +0200)
committerChristian Göttsche <cgzones@googlemail.com>
Tue, 23 Jun 2020 17:10:03 +0000 (19:10 +0200)
Call mac_selinux_init() to setup the label cache, so objects can be
created with default SELinux context.

Fixes: #8004
src/core/main.c

index 6e606d412af07b8e13aa223b0c400f5ec8abdd85..4e1e443a2874a9502db9fed064000b0c9cb8158f 100644 (file)
@@ -2603,6 +2603,11 @@ int main(int argc, char *argv[]) {
                 /* clear the kernel timestamp,
                  * because we are not PID 1 */
                 kernel_timestamp = DUAL_TIMESTAMP_NULL;
+
+                if (mac_selinux_init() < 0) {
+                        error_message = "Failed to initialize SELinux support";
+                        goto finish;
+                }
         }
 
         if (arg_system) {