X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount-setup.c;h=56ce2ae71a01a72634020e2cfeeebafff69af573;hb=7c49259fc8f63ade6cb212a43477d7030aaaf423;hp=d902211ead787d179435f3e903e32ee427edfddd;hpb=71f737d2de635d4ac6183face7e9c8b7981631ab;p=elogind.git diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index d902211ea..56ce2ae71 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -38,6 +38,7 @@ #include "set.h" #include "strv.h" #include "mkdir.h" +#include "path-util.h" #ifndef TTY_GID #define TTY_GID 5 @@ -72,11 +73,22 @@ static const MountPoint mount_table[] = { /* These are API file systems that might be mounted by other software, * we just list them here so that we know that we should ignore them */ -static const char * const ignore_paths[] = { - "/sys/fs/selinux", - "/selinux", - "/proc/bus/usb" -}; +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" + "/proc/kmsg\0" + "/etc/localtime\0" + "/etc/timezone\0" + "/etc/machine-id\0"; bool mount_point_is_api(const char *path) { unsigned i; @@ -92,10 +104,10 @@ bool mount_point_is_api(const char *path) { } bool mount_point_ignore(const char *path) { - unsigned i; + const char *i; - for (i = 0; i < ELEMENTSOF(ignore_paths); i++) - if (path_equal(path, ignore_paths[i])) + NULSTR_FOREACH(i, ignore_paths) + if (path_equal(path, i)) return true; return false;