summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-18 19:29:50 +0100
committerGitHub <noreply@github.com>2019-01-18 19:29:50 +0100
commit37002ad549fc6bd5dd7cb126433d3a9580451a70 (patch)
tree46e76565383169cc3c60c5da0ad04beae4e326b0
parent27de1c19e9387949e4b600fca6d6d6434818abe7 (diff)
parent8156f8c69473f8a7f970ca4f1b4a5f01a99d368a (diff)
downloadpodman-37002ad549fc6bd5dd7cb126433d3a9580451a70.tar.gz
podman-37002ad549fc6bd5dd7cb126433d3a9580451a70.tar.bz2
podman-37002ad549fc6bd5dd7cb126433d3a9580451a70.zip
Merge pull request #2186 from giuseppe/rootless-fix-pid-host
rootless: fix --pid=host without --privileged
-rw-r--r--pkg/spec/spec.go4
-rw-r--r--test/e2e/rootless_test.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index 9ef0223f2..46105af4a 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -376,6 +376,10 @@ func CreateConfigToOCISpec(config *CreateConfig) (*spec.Spec, error) { //nolint
}
func blockAccessToKernelFilesystems(config *CreateConfig, g *generate.Generator) {
+ if config.PidMode.IsHost() && rootless.IsRootless() {
+ return
+ }
+
if !config.Privileged {
for _, mp := range []string{
"/proc/acpi",
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go
index daf8b8c32..2b84d34c9 100644
--- a/test/e2e/rootless_test.go
+++ b/test/e2e/rootless_test.go
@@ -276,6 +276,10 @@ var _ = Describe("Podman rootless", func() {
runRootlessHelper([]string{"--net", "host"})
})
+ It("podman rootless rootfs --pid host", func() {
+ runRootlessHelper([]string{"--pid", "host"})
+ })
+
It("podman rootless rootfs --privileged", func() {
runRootlessHelper([]string{"--privileged"})
})