Skip to content

Commit 44a0fcf

Browse files
committed
go.mod: update to github.com/cyphar/filepath-securejoin@v0.5.0
In order to avoid lint errors due to the deprecation of the top-level securejoin methods ported from libpathrs, we need to adjust internal/pathrs to use the new pathrs-lite subpackage instead. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
1 parent de87203 commit 44a0fcf

49 files changed

Lines changed: 3254 additions & 926 deletions

Some content is hidden

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/checkpoint-restore/go-criu/v7 v7.2.0
77
github.com/containerd/console v1.0.5
88
github.com/coreos/go-systemd/v22 v22.6.0
9-
github.com/cyphar/filepath-securejoin v0.4.1
9+
github.com/cyphar/filepath-securejoin v0.5.0
1010
github.com/docker/go-units v0.5.0
1111
github.com/godbus/dbus/v5 v5.1.0
1212
github.com/moby/sys/capability v0.4.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5z
99
github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU=
1010
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
1111
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
12-
github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
13-
github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
12+
github.com/cyphar/filepath-securejoin v0.5.0 h1:hIAhkRBMQ8nIeuVwcAoymp7MY4oherZdAxD+m0u9zaw=
13+
github.com/cyphar/filepath-securejoin v0.5.0/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
1414
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1515
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1616
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"os"
2424
"path/filepath"
2525

26-
securejoin "github.com/cyphar/filepath-securejoin"
26+
"github.com/cyphar/filepath-securejoin/pathrs-lite"
2727
"github.com/sirupsen/logrus"
2828
"golang.org/x/sys/unix"
2929
)
@@ -45,7 +45,7 @@ import (
4545
// This means that the path also must not contain ".." elements, otherwise an
4646
// error will occur.
4747
//
48-
// This uses securejoin.MkdirAllHandle under the hood, but it has special
48+
// This uses (pathrs-lite).MkdirAllHandle under the hood, but it has special
4949
// handling if unsafePath has already been scoped within the rootfs (this is
5050
// needed for a lot of runc callers and fixing this would require reworking a
5151
// lot of path logic).
@@ -83,7 +83,7 @@ func MkdirAllInRootOpen(root, unsafePath string, mode os.FileMode) (*os.File, er
8383
}
8484
defer rootDir.Close()
8585

86-
return securejoin.MkdirAllHandle(rootDir, unsafePath, mode)
86+
return pathrs.MkdirAllHandle(rootDir, unsafePath, mode)
8787
}
8888

8989
// MkdirAllInRoot is a wrapper around MkdirAllInRootOpen which closes the
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ package pathrs
2121
import (
2222
"os"
2323

24-
securejoin "github.com/cyphar/filepath-securejoin"
24+
"github.com/cyphar/filepath-securejoin/pathrs-lite"
2525
)
2626

27-
// Reopen is a wrapper around securejoin.Reopen.
27+
// Reopen is a wrapper around pathrs.Reopen.
2828
func Reopen(file *os.File, flags int) (*os.File, error) {
29-
return securejoin.Reopen(file, flags)
29+
return pathrs.Reopen(file, flags)
3030
}

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: 119 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)