From 310a8f103808f28f4602e5a9e77c9a0de6f3da67 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 4 Jul 2023 16:36:10 +0100 Subject: [PATCH] libpod: use define.TypeBind when resolving container paths This fixes the "podman cp file from host to container mount" system test on FreeBSD where binding host paths into containers uses the nullfs mount type. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson --- libpod/container_path_resolution.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpod/container_path_resolution.go b/libpod/container_path_resolution.go index bd8c3f478a..af9c3277e6 100644 --- a/libpod/container_path_resolution.go +++ b/libpod/container_path_resolution.go @@ -5,6 +5,7 @@ import ( "path/filepath" "strings" + "github.com/containers/podman/v4/libpod/define" securejoin "github.com/cyphar/filepath-securejoin" "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" @@ -155,7 +156,7 @@ func isPathOnVolume(c *Container, containerPath string) bool { func findBindMount(c *Container, containerPath string) *specs.Mount { cleanedPath := filepath.Clean(containerPath) for _, m := range c.config.Spec.Mounts { - if m.Type != "bind" { + if m.Type != define.TypeBind { continue } if cleanedPath == filepath.Clean(m.Destination) {