]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
userns_exec_1: catch errors in the spawned process.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 29 Jan 2014 15:17:06 +0000 (15:17 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 29 Jan 2014 15:56:54 +0000 (15:56 +0000)
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@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/conf.c

index 71b34073ea045c5e8d7b42b9cd820df55705f463..7dc1fefee7193a344a331ea2e61b6f4f3987e31d 100644 (file)
@@ -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;
        }