Skip to content

Commit e91ec0a

Browse files
committed
switch from filepath.EvalSymlinks to fs.ResolvePath
Signed-off-by: Hamza El-Saawy <[email protected]>
1 parent b6806f3 commit e91ec0a

File tree

22 files changed

+687
-74
lines changed

22 files changed

+687
-74
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/Microsoft/hcsshim
33
go 1.18
44

55
require (
6-
github.com/Microsoft/go-winio v0.6.0
6+
github.com/Microsoft/go-winio v0.6.1
77
github.com/blang/semver/v4 v4.0.0
88
github.com/cenkalti/backoff/v4 v4.2.0
99
github.com/containerd/cgroups v1.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JP
7272
github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
7373
github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
7474
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
75-
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
76-
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
75+
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
76+
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
7777
github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
7878
github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
7979
github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=

internal/hcsoci/hcsdoc_wcow.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strconv"
1414
"strings"
1515

16+
"github.com/Microsoft/go-winio/pkg/fs"
1617
specs "github.com/opencontainers/runtime-spec/specs-go"
1718
"github.com/sirupsen/logrus"
1819

@@ -62,7 +63,7 @@ func createMountsConfig(ctx context.Context, coi *createOptionsInternal) (*mount
6263
// if the path includes a symlink. Therefore, we resolve the path here before
6364
// passing it in. The issue does not occur with VSMB, so don't need to worry
6465
// about the isolated case.
65-
src, err := filepath.EvalSymlinks(mount.Source)
66+
src, err := fs.ResolvePath(mount.Source)
6667
if err != nil {
6768
return nil, fmt.Errorf("failed to eval symlinks for mount source %q: %s", mount.Source, err)
6869
}

internal/layers/layers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"path/filepath"
1111
"time"
1212

13+
"github.com/Microsoft/go-winio/pkg/fs"
1314
"github.com/pkg/errors"
1415
"github.com/sirupsen/logrus"
1516
"golang.org/x/sys/windows"
@@ -523,7 +524,7 @@ func getScratchVHDPath(layerFolders []string) (string, error) {
523524
// When not sharing a scratch space, `hostPath` will be the path to the sandbox.vhdx to use.
524525
//
525526
// Evaluate the symlink here (if there is one).
526-
hostPath, err := filepath.EvalSymlinks(hostPath)
527+
hostPath, err := fs.ResolvePath(hostPath)
527528
if err != nil {
528529
return "", errors.Wrap(err, "failed to eval symlinks")
529530
}

test/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/Microsoft/hcsshim/test
33
go 1.18
44

55
require (
6-
github.com/Microsoft/go-winio v0.6.0
6+
github.com/Microsoft/go-winio v0.6.1
77
github.com/Microsoft/hcsshim v0.10.0-rc.3
88
github.com/containerd/cgroups v1.1.0
99
github.com/containerd/containerd v1.6.12

test/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JP
105105
github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
106106
github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
107107
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
108-
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
109108
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
109+
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
110+
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
110111
github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU=
111112
github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY=
112113
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=

vendor/github.com/Microsoft/go-winio/.golangci.yml

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

vendor/github.com/Microsoft/go-winio/hvsock.go

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

vendor/github.com/Microsoft/go-winio/internal/fs/doc.go

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

vendor/github.com/Microsoft/go-winio/internal/fs/fs.go

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

0 commit comments

Comments
 (0)