Skip to content

Commit 75135e1

Browse files
Merge pull request #27456 from Luap99/securejoin
update github.com/cyphar/filepath-securejoin to v0.5.1
2 parents 94c4951 + a6f1c63 commit 75135e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3296
-927
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/containers/winquit v1.1.0
2121
github.com/coreos/go-systemd/v22 v22.6.0
2222
github.com/crc-org/vfkit v0.6.1
23-
github.com/cyphar/filepath-securejoin v0.4.1
23+
github.com/cyphar/filepath-securejoin v0.5.1
2424
github.com/digitalocean/go-qemu v0.0.0-20250212194115-ee9b0668d242
2525
github.com/docker/distribution v2.8.3+incompatible
2626
github.com/docker/docker v28.5.2+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
8888
github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
8989
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 h1:uX1JmpONuD549D73r6cgnxyUu18Zb7yHAy5AYU0Pm4Q=
9090
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw=
91-
github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
92-
github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
91+
github.com/cyphar/filepath-securejoin v0.5.1 h1:eYgfMq5yryL4fbWfkLpFFy2ukSELzaJOTaUTuh+oF48=
92+
github.com/cyphar/filepath-securejoin v0.5.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
9393
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9494
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9595
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

libpod/container_internal_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/containers/podman/v6/libpod/define"
1818
"github.com/containers/podman/v6/libpod/shutdown"
1919
"github.com/containers/podman/v6/pkg/rootless"
20-
securejoin "github.com/cyphar/filepath-securejoin"
20+
"github.com/cyphar/filepath-securejoin/pathrs-lite"
2121
"github.com/moby/sys/capability"
2222
spec "github.com/opencontainers/runtime-spec/specs-go"
2323
"github.com/opencontainers/runtime-tools/generate"
@@ -741,7 +741,7 @@ func (s *safeMountInfo) Close() {
741741
// The caller is responsible for closing the file descriptor and unmounting the subpath
742742
// when it's no longer needed.
743743
func (c *Container) safeMountSubPath(mountPoint, subpath string) (s *safeMountInfo, err error) {
744-
file, err := securejoin.OpenInRoot(mountPoint, subpath)
744+
file, err := pathrs.OpenInRoot(mountPoint, subpath)
745745
if err != nil {
746746
return nil, err
747747
}
@@ -834,7 +834,7 @@ var hasCapSysResource = sync.OnceValues(func() (bool, error) {
834834

835835
// containerPathIsFile returns true if the given containerPath is a file
836836
func containerPathIsFile(unsafeRoot string, containerPath string) (bool, error) {
837-
f, err := securejoin.OpenInRoot(unsafeRoot, containerPath)
837+
f, err := pathrs.OpenInRoot(unsafeRoot, containerPath)
838838
if err != nil {
839839
return false, err
840840
}

pkg/domain/infra/abi/play_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ package abi
55
import (
66
"os"
77

8-
securejoin "github.com/cyphar/filepath-securejoin"
8+
"github.com/cyphar/filepath-securejoin/pathrs-lite"
99
)
1010

1111
// openSymlinkPath opens the path under root using securejoin.OpenatInRoot().
1212
func openSymlinkPath(root *os.File, unsafePath string, flags int) (*os.File, error) {
13-
file, err := securejoin.OpenatInRoot(root, unsafePath)
13+
file, err := pathrs.OpenatInRoot(root, unsafePath)
1414
if err != nil {
1515
return nil, err
1616
}
17-
return securejoin.Reopen(file, flags)
17+
return pathrs.Reopen(file, flags)
1818
}

vendor/github.com/cyphar/filepath-securejoin/.golangci.yml

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md

Lines changed: 150 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)