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

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jan 15 14:53:52 UTC 2014


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)

> ---
>  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


More information about the lxc-devel mailing list