From: Christian Brauner <christianvanbrau...@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 <christianvanbrau...@gmail.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

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to