]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix mode when creating temporary directory
authorChristian Brauner <christianvanbrauner@gmail.com>
Mon, 9 Nov 2015 20:47:28 +0000 (21:47 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 17 Nov 2015 16:35:46 +0000 (11:35 -0500)
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@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_copy.c

index 6336b537be463f6678b0171b2ee208c87fec09f8..69f88de9e279e5eda093112b30e7dfd4b39b0c90 100644 (file)
@@ -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;
        }