From bee654296baee423c43e903650e4b9ad568943c1 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 27 Aug 2018 12:13:04 +0200 Subject: rootless: fix --ipc=host Signed-off-by: Giuseppe Scrivano Closes: #1349 Approved by: rhatdan --- pkg/spec/spec.go | 10 ++++++++++ test/e2e/rootless_test.go | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index 8038dd6ba..ac894c00c 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -69,6 +69,16 @@ func CreateConfigToOCISpec(config *CreateConfig) (*spec.Spec, error) { //nolint } g.AddMount(devPts) } + if inUserNS && config.IpcMode.IsHost() { + g.RemoveMount("/dev/mqueue") + devMqueue := spec.Mount{ + Destination: "/dev/mqueue", + Type: "bind", + Source: "/dev/mqueue", + Options: []string{"bind", "nosuid", "noexec", "nodev"}, + } + g.AddMount(devMqueue) + } if addCgroup { cgroupMnt := spec.Mount{ diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go index 0bc537507..9d11a5be9 100644 --- a/test/e2e/rootless_test.go +++ b/test/e2e/rootless_test.go @@ -163,4 +163,8 @@ var _ = Describe("Podman rootless", func() { It("podman rootless rootfs --uts host", func() { runRootless([]string{"--uts", "host"}) }) + + It("podman rootless rootfs --ipc host", func() { + runRootless([]string{"--ipc", "host"}) + }) }) -- cgit v1.2.3-54-g00ecf