[lxc-devel] [PATCH 2/3] Fix mode when creating temporary directory
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Nov 9 23:34:32 UTC 2015
Quoting Christian Brauner (christian.brauner at mailbox.org):
> From: Christian Brauner <christianvanbrauner at gmail.com>
>
> When we create a random container directory with mkdtemp() we set the mode to
> 0770 otherwise do_lxcapi_clone() will complain about not being able to create
> the config.
>
> Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/lxc/lxc_copy.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/lxc/lxc_copy.c b/src/lxc/lxc_copy.c
> index 1a2d007..e5f52d2 100644
> --- a/src/lxc/lxc_copy.c
> +++ b/src/lxc/lxc_copy.c
> @@ -382,6 +382,8 @@ static int do_clone_ephemeral(struct lxc_container *c,
> return -1;
> if (!mkdtemp(randname))
> return -1;
> + if (chmod(randname, 0770) < 0)
> + return -1;
> my_args->newname = randname + strlen(my_args->newpath) + 1;
> }
>
> --
> 2.6.2
>
More information about the lxc-devel
mailing list