summaryrefslogtreecommitdiff
path: root/libpod/container_exec.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-07 09:44:37 -0500
committerGitHub <noreply@github.com>2021-01-07 09:44:37 -0500
commit3cf41c4a7349d2f2529ce94801de2de9898ae27f (patch)
tree0982a64d3ffd90561a8f1465be0581edfca489d3 /libpod/container_exec.go
parent74af9254b98eb21e25c9776b0cf0664d3cb2c46e (diff)
parentdb71759b1aa575633649091b97ea9b856aebc687 (diff)
downloadpodman-3cf41c4a7349d2f2529ce94801de2de9898ae27f.tar.gz
podman-3cf41c4a7349d2f2529ce94801de2de9898ae27f.tar.bz2
podman-3cf41c4a7349d2f2529ce94801de2de9898ae27f.zip
Merge pull request #8821 from rhatdan/caps
Containers should not get inheritable caps by default
Diffstat (limited to 'libpod/container_exec.go')
-rw-r--r--libpod/container_exec.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index fce26acb0..5aee847e1 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -8,7 +8,6 @@ import (
"strconv"
"time"
- "github.com/containers/common/pkg/capabilities"
"github.com/containers/podman/v2/libpod/define"
"github.com/containers/podman/v2/libpod/events"
"github.com/containers/storage/pkg/stringid"
@@ -973,20 +972,12 @@ func (c *Container) removeAllExecSessions() error {
// Make an ExecOptions struct to start the OCI runtime and prepare its exec
// bundle.
func prepareForExec(c *Container, session *ExecSession) (*ExecOptions, error) {
- // TODO: check logic here - should we set Privileged if the container is
- // privileged?
- var capList []string
- if session.Config.Privileged || c.config.Privileged {
- capList = capabilities.AllCapabilities()
- }
-
if err := c.createExecBundle(session.ID()); err != nil {
return nil, err
}
opts := new(ExecOptions)
opts.Cmd = session.Config.Command
- opts.CapAdd = capList
opts.Env = session.Config.Environment
opts.Terminal = session.Config.Terminal
opts.Cwd = session.Config.WorkDir
@@ -995,6 +986,7 @@ func prepareForExec(c *Container, session *ExecSession) (*ExecOptions, error) {
opts.DetachKeys = session.Config.DetachKeys
opts.ExitCommand = session.Config.ExitCommand
opts.ExitCommandDelay = session.Config.ExitCommandDelay
+ opts.Privileged = session.Config.Privileged
return opts, nil
}