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

Stéphane Graber stgraber at ubuntu.com
Sun Feb 23 00:32:08 UTC 2014


On Sat, Feb 22, 2014 at 06:19:01PM -0500, Stéphane Graber wrote:
> 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>

Please ignore this patch, V2 is on the way. For some reason my initial
attempt at passing the mode to the tmpfs mount failed because of some
mistake I made.

It is working as expected and is the right thing to do, so I'll send a
patch that does just that.

> ---
>  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
> 

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140222/a301a978/attachment.pgp>


More information about the lxc-devel mailing list