build(deps): bump github.com/Microsoft/hcsshim from 0.9.9 to 0.11.1
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.9 to 0.11.1. - [Release notes](https://github.com/Microsoft/hcsshim/releases) - [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.9...v0.11.1) --- updated-dependencies: - dependency-name: github.com/Microsoft/hcsshim dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
1
vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go
generated
vendored
Normal file
1
vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
package safefile
|
30
vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
generated
vendored
30
vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package safefile
|
||||
|
||||
import (
|
||||
@ -156,7 +158,6 @@ func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os.
|
||||
if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 {
|
||||
return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: winapi.RtlNtStatusToDosError(winapi.STATUS_REPARSE_POINT_ENCOUNTERED)}
|
||||
}
|
||||
|
||||
} else {
|
||||
parent = newroot
|
||||
}
|
||||
@ -339,6 +340,33 @@ func MkdirRelative(path string, root *os.File) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// MkdirAllRelative creates each directory in the path relative to a root, failing if
|
||||
// any existing intermediate path components are reparse points.
|
||||
func MkdirAllRelative(path string, root *os.File) error {
|
||||
pathParts := strings.Split(filepath.Clean(path), (string)(filepath.Separator))
|
||||
for index := range pathParts {
|
||||
partialPath := filepath.Join(pathParts[0 : index+1]...)
|
||||
stat, err := LstatRelative(partialPath, root)
|
||||
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if err := MkdirRelative(partialPath, root); err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if !stat.IsDir() {
|
||||
fullPath := filepath.Join(root.Name(), partialPath)
|
||||
return &os.PathError{Op: "mkdir", Path: fullPath, Err: syscall.ENOTDIR}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// LstatRelative performs a stat operation on a file relative to a root, failing
|
||||
// if any intermediate path components are reparse points.
|
||||
func LstatRelative(path string, root *os.File) (os.FileInfo, error) {
|
||||
|
Reference in New Issue
Block a user