summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-01-11 10:34:27 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-01-11 10:34:30 +0100
commitb3e7be7a0b1d5484b98bbb733ce58af84137316a (patch)
tree8f89fd9f473b2acba12b2dec10aa89ad7bfa48f1 /libpod/container_internal_linux.go
parent36d96c19f947aeac2675afe64a3b482e54f9e4c4 (diff)
downloadpodman-b3e7be7a0b1d5484b98bbb733ce58af84137316a.tar.gz
podman-b3e7be7a0b1d5484b98bbb733ce58af84137316a.tar.bz2
podman-b3e7be7a0b1d5484b98bbb733ce58af84137316a.zip
spec: add nosuid,noexec,nodev to ro bind mount
runc fails to change the ro mode of a rootless bind mount if the other flags are not kept. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 2f03d45ea..9c343d051 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -227,7 +227,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
Options: []string{"bind", "private"},
}
if c.IsReadOnly() && dstPath != "/dev/shm" {
- newMount.Options = append(newMount.Options, "ro")
+ newMount.Options = append(newMount.Options, "ro", "nosuid", "noexec", "nodev")
}
if !MountExists(g.Mounts(), dstPath) {
g.AddMount(newMount)