From: Lennart Poettering Date: Fri, 23 Jan 2015 00:27:06 +0000 (+0100) Subject: nspawn: mount /tmp in the container, don't leave this to the container's init X-Git-Tag: v219~325 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=bbb99c30d01a8bcdc27fb151cc6376a7877a6b07;hp=05e7da5afa07b5620c06507a3f033334a5179d21;ds=sidebyside 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. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 25828cf3c..4e465dfe4 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 */