mirror of
https://github.com/containers/podman.git
synced 2025-11-29 09:37:38 +08:00
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 <pholzing@redhat.com>
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/containers/podman/v6/libpod/define"
|
"github.com/containers/podman/v6/libpod/define"
|
||||||
"github.com/containers/podman/v6/libpod/shutdown"
|
"github.com/containers/podman/v6/libpod/shutdown"
|
||||||
"github.com/containers/podman/v6/pkg/rootless"
|
"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"
|
"github.com/moby/sys/capability"
|
||||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/opencontainers/runtime-tools/generate"
|
"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
|
// The caller is responsible for closing the file descriptor and unmounting the subpath
|
||||||
// when it's no longer needed.
|
// when it's no longer needed.
|
||||||
func (c *Container) safeMountSubPath(mountPoint, subpath string) (s *safeMountInfo, err error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -834,7 +834,7 @@ var hasCapSysResource = sync.OnceValues(func() (bool, error) {
|
|||||||
|
|
||||||
// containerPathIsFile returns true if the given containerPath is a file
|
// containerPathIsFile returns true if the given containerPath is a file
|
||||||
func containerPathIsFile(unsafeRoot string, containerPath string) (bool, error) {
|
func containerPathIsFile(unsafeRoot string, containerPath string) (bool, error) {
|
||||||
f, err := securejoin.OpenInRoot(unsafeRoot, containerPath)
|
f, err := pathrs.OpenInRoot(unsafeRoot, containerPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ package abi
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
securejoin "github.com/cyphar/filepath-securejoin"
|
"github.com/cyphar/filepath-securejoin/pathrs-lite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// openSymlinkPath opens the path under root using securejoin.OpenatInRoot().
|
// openSymlinkPath opens the path under root using securejoin.OpenatInRoot().
|
||||||
func openSymlinkPath(root *os.File, unsafePath string, flags int) (*os.File, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return securejoin.Reopen(file, flags)
|
return pathrs.Reopen(file, flags)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user