[lxc-devel] [PATCH] userns_exec_1: catch errors in the spawned process.

Stéphane Graber stgraber at ubuntu.com
Wed Jan 29 15:55:56 UTC 2014


On Wed, Jan 29, 2014 at 03:17:06PM +0000, Serge Hallyn wrote:
> lxc_map_ids can call system(3), which on error from the
> spawned process returns > 0.  No path should return > 0
> when it meant success.  So check the lxc_map_ids() value
> to be != rather than just < 0.
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 71b3407..7dc1fef 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -4055,7 +4055,7 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data)
>  	ret = lxc_map_ids(idmap, pid);
>  	lxc_free_idmap(idmap);
>  	free(idmap);
> -	if (ret < 0) {
> +	if (ret) {
>  		ERROR("Error setting up child mappings");
>  		goto err;
>  	}
> -- 
> 1.8.5.3
> 
> _______________________________________________
> 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: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140129/c7c360f5/attachment.pgp>


More information about the lxc-devel mailing list