From: Christian Brauner Date: Mon, 9 Nov 2015 20:47:28 +0000 (+0100) Subject: Fix mode when creating temporary directory X-Git-Tag: lxc-2.0.0.beta1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84e8c4bb2a63936f0eae0ab5f9a9ff39a79d8dc;p=thirdparty%2Flxc.git Fix mode when creating temporary directory 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 Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/lxc_copy.c b/src/lxc/lxc_copy.c index 6336b537b..69f88de9e 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; }