summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/spec/spec.go10
-rw-r--r--test/e2e/rootless_test.go4
2 files changed, 14 insertions, 0 deletions
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"})
+ })
})