mirror of
https://github.com/containers/podman.git
synced 2025-07-14 10:09:13 +08:00
Merge pull request #7292 from spearlineltd/cleanupzombie
Wait for reexec to finish when fileOutput is nil
This commit is contained in:
@ -233,6 +233,11 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
|
|||||||
if pid < 0 {
|
if pid < 0 {
|
||||||
return false, -1, errors.Errorf("cannot re-exec process")
|
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()
|
uids, gids, err := GetConfiguredMappings()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -294,6 +299,11 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if fileOutput != nil {
|
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
|
return true, 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user