Skip to content

Commit

Permalink
libct: rm x/sys/execabs usage
Browse files Browse the repository at this point in the history
Since Go 1.19, the same functionality is there in os/exec package.
As we require go 1.22 now, there's no need to have this.

This basically reverts commit 9258eac ("libct/start: use execabs for
newuidmap lookup").

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Oct 23, 2024
1 parent 891d8ff commit eb2ff52
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 143 deletions.
5 changes: 2 additions & 3 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"github.com/vishvananda/netlink/nl"
"golang.org/x/sys/execabs"
"golang.org/x/sys/unix"

"github.com/opencontainers/runc/libcontainer/cgroups"
Expand Down Expand Up @@ -1127,7 +1126,7 @@ func (c *Container) bootstrapData(cloneFlags uintptr, nsMaps map[configs.Namespa
// We resolve the paths for new{u,g}idmap from
// the context of runc to avoid doing a path
// lookup in the nsexec context.
if path, err := execabs.LookPath("newuidmap"); err == nil {
if path, err := exec.LookPath("newuidmap"); err == nil {
r.AddData(&Bytemsg{
Type: UidmapPathAttr,
Value: []byte(path),
Expand Down Expand Up @@ -1155,7 +1154,7 @@ func (c *Container) bootstrapData(cloneFlags uintptr, nsMaps map[configs.Namespa
Value: b,
})
if c.config.RootlessEUID {
if path, err := execabs.LookPath("newgidmap"); err == nil {
if path, err := exec.LookPath("newgidmap"); err == nil {
r.AddData(&Bytemsg{
Type: GidmapPathAttr,
Value: []byte(path),
Expand Down
102 changes: 0 additions & 102 deletions vendor/golang.org/x/sys/execabs/execabs.go

This file was deleted.

17 changes: 0 additions & 17 deletions vendor/golang.org/x/sys/execabs/execabs_go118.go

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/golang.org/x/sys/execabs/execabs_go119.go

This file was deleted.

1 change: 0 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ golang.org/x/exp/constraints
golang.org/x/net/bpf
# golang.org/x/sys v0.22.0
## explicit; go 1.18
golang.org/x/sys/execabs
golang.org/x/sys/unix
golang.org/x/sys/windows
# google.golang.org/protobuf v1.33.0
Expand Down

0 comments on commit eb2ff52

Please sign in to comment.