From 565e571c8f88aeef8c23bf79479b0fde3c8e069b Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 29 Jan 2014 15:17:06 +0000 Subject: [PATCH] userns_exec_1: catch errors in the spawned process. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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; } -- 2.47.2