summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-04 16:32:43 -0700
committerLennart Poettering <lennart@poettering.net>2012-09-04 16:32:43 -0700
commite65aec12ae1d224aa2b7743fd5d5d10c586227ac (patch)
tree0e95efea2a2ce31dee0c58f0c3b1dd889a1dbfe1 /src
parenta8348796c0d39435b1c3d85ce6e95dad1ac85fec (diff)
nspawn: mount a clean instance of sysfs
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 40b99343d7..a8c8b7caf4 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -269,8 +269,7 @@ static int mount_all(const char *dest) {
{ "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND, true }, /* Bind mount first */
{ NULL, "/proc/sys", NULL, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, true }, /* Then, make it r/o */
- { "/sys", "/sys", NULL, NULL, MS_BIND, true }, /* Bind mount first */
- { NULL, "/sys", NULL, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, true }, /* Then, make it r/o */
+ { "sysfs", "/sys", "sysfs", NULL, MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME, true },
{ "/dev/pts", "/dev/pts", NULL, NULL, MS_BIND, true },
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true },
@@ -296,7 +295,7 @@ static int mount_all(const char *dest) {
break;
}
- t = path_is_mount_point(where, false);
+ t = path_is_mount_point(where, true);
if (t < 0) {
log_error("Failed to detect whether %s is a mount point: %s", where, strerror(-t));
free(where);