[lxc-devel] [PATCH] Always try to create lxcpath

Stéphane Graber stgraber at ubuntu.com
Wed Jan 15 15:02:37 UTC 2014


On Wed, Jan 15, 2014 at 08:53:52AM -0600, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
> (An error msg there might save some frustration in the future though)

I didn't put one because mkdir_p will raise on itself.

> 
> > ---
> >  src/lxc/lxc_create.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c
> > index d02dacc..6d94709 100644
> > --- a/src/lxc/lxc_create.c
> > +++ b/src/lxc/lxc_create.c
> > @@ -206,6 +206,9 @@ int main(int argc, char *argv[])
> >  		exit(1);
> >  
> >  	if (geteuid()) {
> > +		if (mkdir_p(my_args.lxcpath[0], 0755)) {
> > +			exit(1);
> > +		}
> >  		if (access(my_args.lxcpath[0], O_RDWR) < 0) {
> >  			fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]);
> >  			exit(1);
> > -- 
> > 1.8.5.2
> > 
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140115/242986b8/attachment.pgp>


More information about the lxc-devel mailing list