Commit b84e8c4b by Christian Brauner Committed by Stéphane Graber

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: 's avatarChristian Brauner <christianvanbrauner@gmail.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent dca0532e
...@@ -382,6 +382,8 @@ static int do_clone_ephemeral(struct lxc_container *c, ...@@ -382,6 +382,8 @@ static int do_clone_ephemeral(struct lxc_container *c,
return -1; return -1;
if (!mkdtemp(randname)) if (!mkdtemp(randname))
return -1; return -1;
if (chmod(randname, 0770) < 0)
return -1;
my_args->newname = randname + strlen(my_args->newpath) + 1; my_args->newname = randname + strlen(my_args->newpath) + 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment