summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/exec.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 0cd6f98b7..ed11b3c4b 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "os"
"strings"
"github.com/containers/libpod/cmd/podman/libpodruntime"
@@ -84,6 +85,18 @@ func execCmd(c *cli.Context) error {
return errors.Wrapf(err, "unable to exec into %s", args[0])
}
+ pid, err := ctr.PID()
+ if err != nil {
+ return err
+ }
+ became, ret, err := rootless.JoinNS(uint(pid))
+ if err != nil {
+ return err
+ }
+ if became {
+ os.Exit(ret)
+ }
+
// ENVIRONMENT VARIABLES
env := defaultEnvVariables
for _, e := range c.StringSlice("env") {