From bbb99c30d01a8bcdc27fb151cc6376a7877a6b07 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Jan 2015 01:27:06 +0100 Subject: nspawn: mount /tmp in the container, don't leave this to the container's init We really want /tmp to be properly mounted, especially in containers that lack CAP_SYS_ADMIN or that are not fully booted up and only get a shell, hence let's do so in nspawn already. --- src/nspawn/nspawn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 25828cf3cc..4e465dfe4f 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -816,6 +816,7 @@ static int mount_all(const char *dest) { { "devpts", "/dev/pts", "devpts","newinstance,ptmxmode=0666,mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, true }, { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true }, { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true }, + { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, true }, #ifdef HAVE_SELINUX { "/sys/fs/selinux", "/sys/fs/selinux", NULL, NULL, MS_BIND, false }, /* Bind mount first */ { NULL, "/sys/fs/selinux", NULL, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, false }, /* Then, make it r/o */ -- cgit v1.2.3-54-g00ecf