mirror of
https://github.com/containers/podman.git
synced 2025-08-03 01:37:51 +08:00
container: do not create .containerenv with -v SRC:/run
if /run is on a volume do not create the file /run/.containerenv as it would leak outside of the container. Closes: https://github.com/containers/podman/issues/14577 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -2249,8 +2249,19 @@ func (c *Container) makeBindMounts() error {
|
||||
}
|
||||
}
|
||||
|
||||
_, hasRunContainerenv := c.state.BindMounts["/run/.containerenv"]
|
||||
if !hasRunContainerenv {
|
||||
// check in the spec mounts
|
||||
for _, m := range c.config.Spec.Mounts {
|
||||
if m.Destination == "/run/.containerenv" || m.Destination == "/run" {
|
||||
hasRunContainerenv = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make .containerenv if it does not exist
|
||||
if _, ok := c.state.BindMounts["/run/.containerenv"]; !ok {
|
||||
if !hasRunContainerenv {
|
||||
containerenv := c.runtime.graphRootMountedFlag(c.config.Spec.Mounts)
|
||||
isRootless := 0
|
||||
if rootless.IsRootless() {
|
||||
|
Reference in New Issue
Block a user