From: Serge Hallyn Date: Wed, 29 Jan 2014 15:17:06 +0000 (+0000) Subject: userns_exec_1: catch errors in the spawned process. X-Git-Tag: lxc-1.0.0.beta4~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=565e571c8f88aeef8c23bf79479b0fde3c8e069b;p=thirdparty%2Flxc.git userns_exec_1: catch errors in the spawned process. 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 Acked-by: Stéphane Graber --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 71b34073e..7dc1fefee 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; }