X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmount-setup.c;h=4adb86f15731acd4a912fae0fe1793b1a4e12fba;hp=9eb2832c6ecd6935252b10f1fda44146c40623c0;hb=46ff0ed7b09d7c76254285b69cfe9d5f86950b8f;hpb=57f2a956e63d6b981b9d6277ab800ad4ad386f42 diff --git a/src/mount-setup.c b/src/mount-setup.c index 9eb2832c6..4adb86f15 100644 --- a/src/mount-setup.c +++ b/src/mount-setup.c @@ -55,7 +55,7 @@ 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 igore them */ + * we just list them here so that we know that we should ignore them */ static const char * const ignore_paths[] = { "/selinux", @@ -78,7 +78,7 @@ bool mount_point_is_api(const char *path) { } bool mount_point_ignore(const char *path) { - unsigned i; + unsigned i; for (i = 0; i < ELEMENTSOF(ignore_paths); i++) if (path_equal(path, ignore_paths[i])) @@ -138,8 +138,9 @@ static int mount_cgroup_controllers(void) { for (;;) { MountPoint p; char *controller, *where; + int enabled = false; - if (fscanf(f, "%ms %*i %*i %*i", &controller) != 1) { + if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { if (feof(f)) break; @@ -149,6 +150,11 @@ static int mount_cgroup_controllers(void) { goto finish; } + if (!enabled) { + free(controller); + continue; + } + if (asprintf(&where, "/sys/fs/cgroup/%s", controller) < 0) { free(controller); r = -ENOMEM; @@ -202,13 +208,17 @@ static int nftw_cb( int tflag, struct FTW *ftwbuf) { + /* No need to label /dev twice in a row... */ + if (ftwbuf->level == 0) + return 0; + label_fix(fpath); return 0; }; int mount_setup(void) { - const char *symlinks = + const char symlinks[] = "/proc/kcore\0" "/dev/core\0" "/proc/self/fd\0" "/dev/fd\0" "/proc/self/fd/0\0" "/dev/stdin\0"