Re: [lxc-devel] [PATCH 2/3] Fix mode when creating temporary directory
Quoting Christian Brauner (christian.brau...@mailbox.org): > From: Christian Brauner > > 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 > --- > 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
[lxc-devel] [PATCH 2/3] Fix mode when creating temporary directory
From: Christian Brauner 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 --- 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