Commit 565e571c by Serge Hallyn Committed by Stéphane Graber

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: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent b1dad6f6
...@@ -4055,7 +4055,7 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data) ...@@ -4055,7 +4055,7 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data)
ret = lxc_map_ids(idmap, pid); ret = lxc_map_ids(idmap, pid);
lxc_free_idmap(idmap); lxc_free_idmap(idmap);
free(idmap); free(idmap);
if (ret < 0) { if (ret) {
ERROR("Error setting up child mappings"); ERROR("Error setting up child mappings");
goto err; goto err;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment