[lxc-devel] [PATCH] lxc-start-ephemeral: Force sane mode for /

Stéphane Graber stgraber at ubuntu.com
Sat Feb 22 23:19:01 UTC 2014


When using a tmpfs, even with mode=0755 or mode=755, the container's /
ends up being 1755 which is obviously less than idea. This fix forces
some sanity by always chmoding /.

I have been unable to reproduce that problem with lxc-clone, so only
sending a patch for start-ephemeral.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/lxc/lxc-start-ephemeral.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in
index 822f802..c6d12c4 100644
--- a/src/lxc/lxc-start-ephemeral.in
+++ b/src/lxc/lxc-start-ephemeral.in
@@ -251,6 +251,7 @@ LXC_NAME="%s"
                      dst_path, src_path, dst_path))
 
     fd.write("""
+chmod 755 $LXC_DIR/rootfs/
 [ -e $LXC_DIR/configured ] && exit 0
 for file in $LXC_DIR/rootfs/etc/hostname \\
             $LXC_DIR/rootfs/etc/hosts \\
-- 
1.9.0



More information about the lxc-devel mailing list