summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-03-07 15:16:25 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-03-07 15:16:28 +0100
commitffe1ed70588fe9540ec92ac00866a2de4cb0f619 (patch)
tree50b4c527e1c927296d9503d41508410fed99993d /libpod/oci.go
parentea031be2dfb76b326bf0542d3d9b02fe254d4d76 (diff)
downloadpodman-ffe1ed70588fe9540ec92ac00866a2de4cb0f619.tar.gz
podman-ffe1ed70588fe9540ec92ac00866a2de4cb0f619.tar.bz2
podman-ffe1ed70588fe9540ec92ac00866a2de4cb0f619.zip
oci: make explicit the extra files to the exec
In the previous version I forgot to add the fds to preserve into AdditionalFiles. It doesn't make a difference as the files were still preserved, but this seems to be the correct way of making it explicit. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 2cbf25699..c3b5f9af2 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -805,6 +805,12 @@ func (r *OCIRuntime) execContainer(c *Container, cmd, capAdd, env []string, tty
execCmd.Env = append(execCmd.Env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir))
+ if preserveFDs > 0 {
+ for fd := 3; fd < 3+preserveFDs; fd++ {
+ execCmd.ExtraFiles = append(execCmd.ExtraFiles, os.NewFile(uintptr(fd), fmt.Sprintf("fd-%d", fd)))
+ }
+ }
+
if err := execCmd.Start(); err != nil {
return nil, errors.Wrapf(err, "cannot start container %s", c.ID())
}