mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 08:12:20 +00:00
Merge pull request #2149 from tych0/fix-userns-error-handling
fix userns helper error handling
This commit is contained in:
commit
056fec39f7
@ -4003,14 +4003,14 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data,
|
||||
}
|
||||
|
||||
on_error:
|
||||
/* Wait for child to finish. */
|
||||
if (pid > 0)
|
||||
status = wait_for_pid(pid);
|
||||
|
||||
if (p[0] != -1)
|
||||
close(p[0]);
|
||||
close(p[1]);
|
||||
|
||||
/* Wait for child to finish. */
|
||||
if (pid > 0)
|
||||
status = wait_for_pid(pid);
|
||||
|
||||
if (status < 0)
|
||||
ret = -1;
|
||||
|
||||
@ -4178,6 +4178,10 @@ int userns_exec_full(struct lxc_conf *conf, int (*fn)(void *), void *data,
|
||||
}
|
||||
|
||||
on_error:
|
||||
if (p[0] != -1)
|
||||
close(p[0]);
|
||||
close(p[1]);
|
||||
|
||||
/* Wait for child to finish. */
|
||||
if (pid > 0)
|
||||
ret = wait_for_pid(pid);
|
||||
@ -4189,10 +4193,6 @@ on_error:
|
||||
if (host_gid_map && (host_gid_map != container_root_gid))
|
||||
free(host_gid_map);
|
||||
|
||||
if (p[0] != -1)
|
||||
close(p[0]);
|
||||
close(p[1]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user