diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-18 13:14:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-18 13:14:48 +0200 |
commit | 49d6468b939a3c4ffed4d529c438f3849c252e7b (patch) | |
tree | f26a731ddef43a6de09102472e580f98cb74e584 /pkg | |
parent | 8caed305741c8c9e34ec767c9054e3c5e0d33576 (diff) | |
parent | 0cd2f2d974789b82ad8e5471963df45211dafaea (diff) | |
download | podman-49d6468b939a3c4ffed4d529c438f3849c252e7b.tar.gz podman-49d6468b939a3c4ffed4d529c438f3849c252e7b.tar.bz2 podman-49d6468b939a3c4ffed4d529c438f3849c252e7b.zip |
Merge pull request #7292 from spearlineltd/cleanupzombie
Wait for reexec to finish when fileOutput is nil
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/rootless/rootless_linux.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index ecd309d36..bbd797817 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -233,6 +233,11 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo if pid < 0 { return false, -1, errors.Errorf("cannot re-exec process") } + defer func() { + if retErr != nil { + C.reexec_in_user_namespace_wait(pidC, 0) + } + }() uids, gids, err := GetConfiguredMappings() if err != nil { @@ -294,6 +299,11 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo } if fileOutput != nil { + ret := C.reexec_in_user_namespace_wait(pidC, 0) + if ret < 0 { + return false, -1, errors.New("error waiting for the re-exec process") + } + return true, 0, nil } |