mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
contrib/fs-idmap: Reap childs
This is what we should do, although in practice this probably won't be a big issue as the parent also exits. While we are there, instead of waiting for the child to finish, kill it if we did everything we wanted to do. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
@@ -31,6 +31,10 @@ func main() {
|
||||
if err := cmd.Start(); err != nil {
|
||||
log.Fatalf("failed to run the helper binary: %v", err)
|
||||
}
|
||||
defer func() {
|
||||
_ = cmd.Process.Kill()
|
||||
_ = cmd.Wait()
|
||||
}()
|
||||
|
||||
path := fmt.Sprintf("/proc/%d/ns/user", cmd.Process.Pid)
|
||||
var userNsFile *os.File
|
||||
|
||||
Reference in New Issue
Block a user