diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-07 07:20:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 07:20:18 -0800 |
commit | a07053192fc720f0c30222ff4c30cb164a94670a (patch) | |
tree | d026a95c90129f3cb37c0c46fadca90f2775ea91 | |
parent | 153cf39b520f2b6eb6d2c250ab5edf58e1db4a6a (diff) | |
parent | ffe1ed70588fe9540ec92ac00866a2de4cb0f619 (diff) | |
download | podman-a07053192fc720f0c30222ff4c30cb164a94670a.tar.gz podman-a07053192fc720f0c30222ff4c30cb164a94670a.tar.bz2 podman-a07053192fc720f0c30222ff4c30cb164a94670a.zip |
Merge pull request #2573 from giuseppe/exec-extra-files
oci: make explicit the extra files to the exec
-rw-r--r-- | libpod/oci.go | 6 |
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()) } |