From a6f1c63c190bcf999750fed41edb068c545219c9 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 6 Nov 2025 16:10:13 +0100 Subject: [PATCH] fix lint issues with github.com/cyphar/filepath-securejoin The old location is deprecated and has been removed in v0.6.0 even. I did this as extra commit to make cherry-picking easier. Signed-off-by: Paul Holzinger --- libpod/container_internal_linux.go | 6 +++--- pkg/domain/infra/abi/play_linux.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 70dfa3c895..3574c4b194 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -17,7 +17,7 @@ import ( "github.com/containers/podman/v6/libpod/define" "github.com/containers/podman/v6/libpod/shutdown" "github.com/containers/podman/v6/pkg/rootless" - securejoin "github.com/cyphar/filepath-securejoin" + "github.com/cyphar/filepath-securejoin/pathrs-lite" "github.com/moby/sys/capability" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-tools/generate" @@ -741,7 +741,7 @@ func (s *safeMountInfo) Close() { // The caller is responsible for closing the file descriptor and unmounting the subpath // when it's no longer needed. func (c *Container) safeMountSubPath(mountPoint, subpath string) (s *safeMountInfo, err error) { - file, err := securejoin.OpenInRoot(mountPoint, subpath) + file, err := pathrs.OpenInRoot(mountPoint, subpath) if err != nil { return nil, err } @@ -834,7 +834,7 @@ var hasCapSysResource = sync.OnceValues(func() (bool, error) { // containerPathIsFile returns true if the given containerPath is a file func containerPathIsFile(unsafeRoot string, containerPath string) (bool, error) { - f, err := securejoin.OpenInRoot(unsafeRoot, containerPath) + f, err := pathrs.OpenInRoot(unsafeRoot, containerPath) if err != nil { return false, err } diff --git a/pkg/domain/infra/abi/play_linux.go b/pkg/domain/infra/abi/play_linux.go index a0f9811516..e1127732bf 100644 --- a/pkg/domain/infra/abi/play_linux.go +++ b/pkg/domain/infra/abi/play_linux.go @@ -5,14 +5,14 @@ package abi import ( "os" - securejoin "github.com/cyphar/filepath-securejoin" + "github.com/cyphar/filepath-securejoin/pathrs-lite" ) // openSymlinkPath opens the path under root using securejoin.OpenatInRoot(). func openSymlinkPath(root *os.File, unsafePath string, flags int) (*os.File, error) { - file, err := securejoin.OpenatInRoot(root, unsafePath) + file, err := pathrs.OpenatInRoot(root, unsafePath) if err != nil { return nil, err } - return securejoin.Reopen(file, flags) + return pathrs.Reopen(file, flags) }