From 58ab99ae4b96d5d63f607d178f9490d631c9c921 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 31 Jan 2014 09:51:21 +0000 Subject: [PATCH] specify mode whenever mounting tmpfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- src/lxc/cgmanager.c | 2 +- src/lxc/conf.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c index f5d42ff07..4241ca01c 100644 --- a/src/lxc/cgmanager.c +++ b/src/lxc/cgmanager.c @@ -697,7 +697,7 @@ static bool cgm_bind_dir(const char *root, const char *dirname) } /* mount a tmpfs there so we can create subdirs */ - if (mount("cgroup", cgpath, "tmpfs", 0, "size=10000")) { + if (mount("cgroup", cgpath, "tmpfs", 0, "size=10000,mode=755")) { SYSERROR("Failed to mount tmpfs at %s", cgpath); return false; } diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 3c79a5ab8..8b790a2fc 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1321,7 +1321,7 @@ static int mount_autodev(const char *name, char *root, const char *lxcpath) /* Only mount a tmpfs on here if we don't already a mount */ if ( ! mount_check_fs( host_path, NULL ) ) { DEBUG("Mounting tmpfs to %s", host_path ); - ret = mount("none", path, "tmpfs", 0, "size=100000"); + ret = mount("none", path, "tmpfs", 0, "size=100000,mode=755"); } else { /* This allows someone to manually set up a mount */ DEBUG("Bind mounting %s to %s", host_path, path ); @@ -1471,7 +1471,7 @@ static int chroot_into_slave(struct lxc_conf *conf) SYSERROR("failed to make %s slave", destpath); return -1; } - if (mount("none", destpath, "tmpfs", 0, "size=10000")) { + if (mount("none", destpath, "tmpfs", 0, "size=10000,mode=755")) { SYSERROR("Failed to mount tmpfs / at %s", destpath); return -1; } -- 2.47.2