]> err.no Git - systemd/commitdiff
nspawn: mount /selinux if needed
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 14:33:23 +0000 (15:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 14:37:09 +0000 (15:37 +0100)
src/nspawn.c

index 7cefd3debd9cb09be9f61349df21ccbd605bbb19..a053a4d5553f466e75c09e881ca5f92de9fb2add 100644 (file)
@@ -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;