diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-03-14 17:44:03 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-03-14 17:44:03 +0100 |
commit | 3bd66c05d5d775a82768e0772c83a7300baee366 (patch) | |
tree | 2c015cf9e62c6e01d7b684621712faf1cbdc639c /src/nspawn.c | |
parent | 6f79c579ec9c188173dde41395bbfb86c547fdd3 (diff) |
nspawn: don't require selinux on if it is compiled in
Diffstat (limited to 'src/nspawn.c')
-rw-r--r-- | src/nspawn.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nspawn.c b/src/nspawn.c index a053a4d555..451d539625 100644 --- a/src/nspawn.c +++ b/src/nspawn.c @@ -101,18 +101,19 @@ static int mount_all(const char *dest) { const char *type; const char *options; unsigned long flags; + bool fatal; } 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, true }, + { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND, true }, /* Bind mount first */ + { "/proc/sys", "/proc/sys", "bind", NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, true }, /* Then, make it r/o */ + { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, true }, + { "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID, true }, + { "/dev/pts", "/dev/pts", "bind", NULL, MS_BIND, true }, + { "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true }, #ifdef HAVE_SELINUX - { "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY }, + { "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false }, #endif }; @@ -148,7 +149,8 @@ static int mount_all(const char *dest) { where, mount_table[k].type, mount_table[k].flags, - mount_table[k].options) < 0) { + mount_table[k].options) < 0 && + mount_table[k].fatal) { log_error("mount(%s) failed: %m", where); |