summaryrefslogtreecommitdiff
path: root/src/nspawn.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-14 15:33:23 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-14 15:37:09 +0100
commit9b634ea5fb7cb5466f1f7873204bd67d02652981 (patch)
tree2893067307166fb42883186e9a09e05e3e9640ca /src/nspawn.c
parent40e85d00198c4d9305bbfc794b384f8174fae300 (diff)
nspawn: mount /selinux if needed
Diffstat (limited to 'src/nspawn.c')
-rw-r--r--src/nspawn.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nspawn.c b/src/nspawn.c
index 7cefd3debd..a053a4d555 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -104,13 +104,16 @@ static int mount_all(const char *dest) {
} MountPoint;
static const MountPoint mount_table[] = {
- { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV },
- { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND }, /* Bind mount first */
- { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND|MS_RDONLY|MS_REMOUNT }, /* Then, make it r/o */
- { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY },
- { "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID },
- { "/dev/pts", "/dev/pts", "bind", NULL, MS_BIND },
- { "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV },
+ { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV },
+ { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND }, /* Bind mount first */
+ { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND|MS_RDONLY|MS_REMOUNT }, /* Then, make it r/o */
+ { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY },
+ { "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID },
+ { "/dev/pts", "/dev/pts", "bind", NULL, MS_BIND },
+ { "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV },
+#ifdef HAVE_SELINUX
+ { "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY },
+#endif
};
unsigned k;