mirror of https://github.com/containers/podman.git
rootless: fix --pid=host without --privileged
When using --pid=host don't try to cover /proc paths, as they are coming from the /proc bind mounted from the host. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
a2ab36d0d1
commit
8156f8c694
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue