]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/mount-setup.c
core: s/reexection/reexecution/ typo fix
[thirdparty/systemd.git] / src / core / mount-setup.c
index bd3a0352d690065f46484c397c327c7aa2007843..1782d4072062f48d97f7d34b023f13e2beaa564d 100644 (file)
 
 #include <sys/mount.h>
 #include <errno.h>
-#include <sys/stat.h>
 #include <stdlib.h>
-#include <string.h>
-#include <libgen.h>
-#include <assert.h>
 #include <unistd.h>
 #include <ftw.h>
 
 #include "mount-setup.h"
 #include "dev-setup.h"
+#include "bus-util.h"
 #include "log.h"
 #include "macro.h"
 #include "util.h"
@@ -43,7 +40,6 @@
 #include "virt.h"
 #include "efivars.h"
 #include "smack-util.h"
-#include "def.h"
 #include "cgroup-util.h"
 
 typedef enum MountMode {
@@ -109,10 +105,8 @@ static const MountPoint mount_table[] = {
         { "efivarfs",    "/sys/firmware/efi/efivars", "efivarfs",   NULL,                      MS_NOSUID|MS_NOEXEC|MS_NODEV,
           is_efi_boot,   MNT_NONE                   },
 #endif
-#ifdef ENABLE_KDBUS
         { "kdbusfs",    "/sys/fs/kdbus",             "kdbusfs",    NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
-          NULL,       MNT_IN_CONTAINER },
-#endif
+          is_kdbus_wanted,       MNT_IN_CONTAINER },
 };
 
 /* These are API file systems that might be mounted by other software,
@@ -121,12 +115,6 @@ static const MountPoint mount_table[] = {
 static const char ignore_paths[] =
         /* SELinux file systems */
         "/sys/fs/selinux\0"
-        "/selinux\0"
-        /* Legacy cgroup mount points */
-        "/dev/cgroup\0"
-        "/cgroup\0"
-        /* Legacy kernel file system */
-        "/proc/bus/usb\0"
         /* Container bind mounts */
         "/proc/sys\0"
         "/dev/console\0"
@@ -167,10 +155,9 @@ static int mount_one(const MountPoint *p, bool relabel) {
         if (relabel)
                 label_fix(p->where, true, true);
 
-        r = path_is_mount_point(p->where, true);
-        if (r < 0)
+        r = path_is_mount_point(p->where, AT_SYMLINK_FOLLOW);
+        if (r < 0 && r != -ENOENT)
                 return r;
-
         if (r > 0)
                 return 0;
 
@@ -385,7 +372,7 @@ int mount_setup(bool loaded_policy) {
         /* Create a few default symlinks, which are normally created
          * by udevd, but some scripts might need them before we start
          * udevd. */
-        dev_setup(NULL);
+        dev_setup(NULL, UID_INVALID, GID_INVALID);
 
         /* Mark the root directory as shared in regards to mount
          * propagation. The kernel defaults to "private", but we think