This adds a Windows TERM signal which makes propagation of termination to containers work properly.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
This commit is contained in:
Mathieu Champlon 2021-09-16 16:17:20 +02:00
Родитель 8b85274d26
Коммит a4e7460872
29 изменённых файлов: 76 добавлений и 72 удалений

Просмотреть файл

@ -45,7 +45,7 @@ github.com/Microsoft/go-winio 5c2e05d71961716a6c392a06ada4
github.com/miekg/pkcs11 210dc1e16747c5ba98a03bcbcf728c38086ea357 # v1.0.3 github.com/miekg/pkcs11 210dc1e16747c5ba98a03bcbcf728c38086ea357 # v1.0.3
github.com/mitchellh/mapstructure d16e9488127408e67948eb43b6d3fbb9f222da10 # v1.3.2 github.com/mitchellh/mapstructure d16e9488127408e67948eb43b6d3fbb9f222da10 # v1.3.2
github.com/moby/buildkit 9f254e18360a24c2ae47b26f772c3c89533bcbb7 # master / v0.9.0-dev github.com/moby/buildkit 9f254e18360a24c2ae47b26f772c3c89533bcbb7 # master / v0.9.0-dev
github.com/moby/sys 9b0136d132d8e0d1c116a38d7ec9af70d3a59536 # signal/v0.5.0 (latest tag, either mount/vXXX, mountinfo/vXXX, signal/vXXX, or symlink/vXXX) github.com/moby/sys 03b9f8d59a07f5206a2264105f4903a222aea964 # signal/v0.6.0 (latest tag, either mount/vXXX, mountinfo/vXXX, signal/vXXX, or symlink/vXXX)
github.com/moby/term 3f7ff695adc6a35abc925370dd0a4dafb48ec64d github.com/moby/term 3f7ff695adc6a35abc925370dd0a4dafb48ec64d
github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3
github.com/modern-go/reflect2 94122c33edd36123c84d5368cfb2b69df93a0ec8 # v1.0.1 github.com/modern-go/reflect2 94122c33edd36123c84d5368cfb2b69df93a0ec8 # v1.0.1

1
vendor/github.com/moby/sys/mount/flags_bsd.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build freebsd || openbsd
// +build freebsd openbsd // +build freebsd openbsd
package mount package mount

3
vendor/github.com/moby/sys/mount/flags_unix.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !darwin && !windows
// +build !darwin,!windows // +build !darwin,!windows
package mount package mount
@ -101,7 +102,7 @@ func MergeTmpfsOptions(options []string) ([]string, error) {
} }
opt := strings.SplitN(option, "=", 2) opt := strings.SplitN(option, "=", 2)
if len(opt) != 2 || !validFlags[opt[0]] { if len(opt) != 2 || !validFlags[opt[0]] {
return nil, fmt.Errorf("Invalid tmpfs option %q", opt) return nil, fmt.Errorf("invalid tmpfs option %q", opt)
} }
if !dataCollisions[opt[0]] { if !dataCollisions[opt[0]] {
// We prepend the option and add to collision map // We prepend the option and add to collision map

6
vendor/github.com/moby/sys/mount/go.mod сгенерированный поставляемый
Просмотреть файл

@ -1,8 +1,8 @@
module github.com/moby/sys/mount module github.com/moby/sys/mount
go 1.14 go 1.16
require ( require (
github.com/moby/sys/mountinfo v0.4.1 github.com/moby/sys/mountinfo v0.5.0
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860 golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
) )

1
vendor/github.com/moby/sys/mount/mount_errors.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package mount package mount

3
vendor/github.com/moby/sys/mount/mount_unix.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !darwin && !windows
// +build !darwin,!windows // +build !darwin,!windows
package mount package mount
@ -22,7 +23,7 @@ func Mount(device, target, mType, options string) error {
// a normal unmount. If target is not a mount point, no error is returned. // a normal unmount. If target is not a mount point, no error is returned.
func Unmount(target string) error { func Unmount(target string) error {
err := unix.Unmount(target, mntDetach) err := unix.Unmount(target, mntDetach)
if err == nil || err == unix.EINVAL { if err == nil || err == unix.EINVAL { //nolint:errorlint // unix errors are bare
// Ignore "not mounted" error here. Note the same error // Ignore "not mounted" error here. Note the same error
// can be returned if flags are invalid, so this code // can be returned if flags are invalid, so this code
// assumes that the flags value is always correct. // assumes that the flags value is always correct.

1
vendor/github.com/moby/sys/mount/mounter_freebsd.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build freebsd && cgo
// +build freebsd,cgo // +build freebsd,cgo
package mount package mount

1
vendor/github.com/moby/sys/mount/mounter_linux.go сгенерированный поставляемый
Просмотреть файл

@ -65,7 +65,6 @@ func mount(device, target, mType string, flags uintptr, data string) error {
flags: oflags | unix.MS_REMOUNT, flags: oflags | unix.MS_REMOUNT,
err: err, err: err,
} }
} }
} }

1
vendor/github.com/moby/sys/mount/mounter_openbsd.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build openbsd && cgo
// +build openbsd,cgo // +build openbsd,cgo
/* /*

1
vendor/github.com/moby/sys/mount/mounter_unsupported.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build (!linux && !freebsd && !openbsd && !windows) || (freebsd && !cgo) || (openbsd && !cgo)
// +build !linux,!freebsd,!openbsd,!windows freebsd,!cgo openbsd,!cgo // +build !linux,!freebsd,!openbsd,!windows freebsd,!cgo openbsd,!cgo
package mount package mount

4
vendor/github.com/moby/sys/mountinfo/go.mod сгенерированный поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
module github.com/moby/sys/mountinfo module github.com/moby/sys/mountinfo
go 1.14 go 1.16
require golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 require golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359

11
vendor/github.com/moby/sys/mountinfo/mounted_linux.go сгенерированный поставляемый
Просмотреть файл

@ -16,9 +16,6 @@ func mountedByOpenat2(path string) (bool, error) {
Flags: unix.O_PATH | unix.O_CLOEXEC, Flags: unix.O_PATH | unix.O_CLOEXEC,
}) })
if err != nil { if err != nil {
if err == unix.ENOENT { // not a mount
return false, nil
}
return false, &os.PathError{Op: "openat2", Path: dir, Err: err} return false, &os.PathError{Op: "openat2", Path: dir, Err: err}
} }
fd, err := unix.Openat2(dirfd, last, &unix.OpenHow{ fd, err := unix.Openat2(dirfd, last, &unix.OpenHow{
@ -26,20 +23,22 @@ func mountedByOpenat2(path string) (bool, error) {
Resolve: unix.RESOLVE_NO_XDEV, Resolve: unix.RESOLVE_NO_XDEV,
}) })
_ = unix.Close(dirfd) _ = unix.Close(dirfd)
switch err { switch err { //nolint:errorlint // unix errors are bare
case nil: // definitely not a mount case nil: // definitely not a mount
_ = unix.Close(fd) _ = unix.Close(fd)
return false, nil return false, nil
case unix.EXDEV: // definitely a mount case unix.EXDEV: // definitely a mount
return true, nil return true, nil
case unix.ENOENT: // not a mount
return false, nil
} }
// not sure // not sure
return false, &os.PathError{Op: "openat2", Path: path, Err: err} return false, &os.PathError{Op: "openat2", Path: path, Err: err}
} }
func mounted(path string) (bool, error) { func mounted(path string) (bool, error) {
path, err := normalizePath(path)
if err != nil {
return false, err
}
// Try a fast path, using openat2() with RESOLVE_NO_XDEV. // Try a fast path, using openat2() with RESOLVE_NO_XDEV.
mounted, err := mountedByOpenat2(path) mounted, err := mountedByOpenat2(path)
if err == nil { if err == nil {

16
vendor/github.com/moby/sys/mountinfo/mounted_unix.go сгенерированный поставляемый
Просмотреть файл

@ -1,9 +1,9 @@
// +build linux freebsd,cgo openbsd,cgo //go:build linux || (freebsd && cgo) || (openbsd && cgo) || (darwin && cgo)
// +build linux freebsd,cgo openbsd,cgo darwin,cgo
package mountinfo package mountinfo
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -15,10 +15,6 @@ func mountedByStat(path string) (bool, error) {
var st unix.Stat_t var st unix.Stat_t
if err := unix.Lstat(path, &st); err != nil { if err := unix.Lstat(path, &st); err != nil {
if err == unix.ENOENT {
// Treat ENOENT as "not mounted".
return false, nil
}
return false, &os.PathError{Op: "stat", Path: path, Err: err} return false, &os.PathError{Op: "stat", Path: path, Err: err}
} }
dev := st.Dev dev := st.Dev
@ -49,14 +45,6 @@ func normalizePath(path string) (realPath string, err error) {
} }
func mountedByMountinfo(path string) (bool, error) { func mountedByMountinfo(path string) (bool, error) {
path, err := normalizePath(path)
if err != nil {
if errors.Is(err, unix.ENOENT) {
// treat ENOENT as "not mounted"
return false, nil
}
return false, err
}
entries, err := GetMounts(SingleEntryFilter(path)) entries, err := GetMounts(SingleEntryFilter(path))
if err != nil { if err != nil {
return false, err return false, err

9
vendor/github.com/moby/sys/mountinfo/mountinfo.go сгенерированный поставляемый
Просмотреть файл

@ -10,11 +10,12 @@ func GetMounts(f FilterFunc) ([]*Info, error) {
return parseMountTable(f) return parseMountTable(f)
} }
// Mounted determines if a specified path is a mount point. // Mounted determines if a specified path is a mount point. In case of any
// error, false (and an error) is returned.
// //
// The argument must be an absolute path, with all symlinks resolved, and clean. // The non-existent path returns an error. If a caller is not interested
// One way to ensure it is to process the path using filepath.Abs followed by // in this particular error, it should handle it separately using e.g.
// filepath.EvalSymlinks before calling this function. // errors.Is(err, os.ErrNotExist).
func Mounted(path string) (bool, error) { func Mounted(path string) (bool, error) {
// root is always mounted // root is always mounted
if path == string(os.PathSeparator) { if path == string(os.PathSeparator) {

9
vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go сгенерированный поставляемый
Просмотреть файл

@ -1,4 +1,5 @@
// +build freebsd,cgo openbsd,cgo //go:build (freebsd && cgo) || (openbsd && cgo) || (darwin && cgo)
// +build freebsd,cgo openbsd,cgo darwin,cgo
package mountinfo package mountinfo
@ -21,7 +22,7 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT))
if count == 0 { if count == 0 {
return nil, fmt.Errorf("Failed to call getmntinfo") return nil, fmt.Errorf("failed to call getmntinfo")
} }
var entries []C.struct_statfs var entries []C.struct_statfs
@ -55,6 +56,10 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
} }
func mounted(path string) (bool, error) { func mounted(path string) (bool, error) {
path, err := normalizePath(path)
if err != nil {
return false, err
}
// Fast path: compare st.st_dev fields. // Fast path: compare st.st_dev fields.
// This should always work for FreeBSD and OpenBSD. // This should always work for FreeBSD and OpenBSD.
mounted, err := mountedByStat(path) mounted, err := mountedByStat(path)

27
vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go сгенерированный поставляемый
Просмотреть файл

@ -52,7 +52,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
numFields := len(fields) numFields := len(fields)
if numFields < 10 { if numFields < 10 {
// should be at least 10 fields // should be at least 10 fields
return nil, fmt.Errorf("Parsing '%s' failed: not enough fields (%d)", text, numFields) return nil, fmt.Errorf("parsing '%s' failed: not enough fields (%d)", text, numFields)
} }
// separator field // separator field
@ -67,7 +67,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
for fields[sepIdx] != "-" { for fields[sepIdx] != "-" {
sepIdx-- sepIdx--
if sepIdx == 5 { if sepIdx == 5 {
return nil, fmt.Errorf("Parsing '%s' failed: missing - separator", text) return nil, fmt.Errorf("parsing '%s' failed: missing - separator", text)
} }
} }
@ -75,46 +75,39 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
p.Mountpoint, err = unescape(fields[4]) p.Mountpoint, err = unescape(fields[4])
if err != nil { if err != nil {
return nil, fmt.Errorf("Parsing '%s' failed: mount point: %w", fields[4], err) return nil, fmt.Errorf("parsing '%s' failed: mount point: %w", fields[4], err)
} }
p.FSType, err = unescape(fields[sepIdx+1]) p.FSType, err = unescape(fields[sepIdx+1])
if err != nil { if err != nil {
return nil, fmt.Errorf("Parsing '%s' failed: fstype: %w", fields[sepIdx+1], err) return nil, fmt.Errorf("parsing '%s' failed: fstype: %w", fields[sepIdx+1], err)
} }
p.Source, err = unescape(fields[sepIdx+2]) p.Source, err = unescape(fields[sepIdx+2])
if err != nil { if err != nil {
return nil, fmt.Errorf("Parsing '%s' failed: source: %w", fields[sepIdx+2], err) return nil, fmt.Errorf("parsing '%s' failed: source: %w", fields[sepIdx+2], err)
} }
p.VFSOptions = fields[sepIdx+3] p.VFSOptions = fields[sepIdx+3]
// ignore any numbers parsing errors, as there should not be any // ignore any numbers parsing errors, as there should not be any
p.ID, _ = strconv.Atoi(fields[0]) p.ID, _ = strconv.Atoi(fields[0])
p.Parent, _ = strconv.Atoi(fields[1]) p.Parent, _ = strconv.Atoi(fields[1])
mm := strings.Split(fields[2], ":") mm := strings.SplitN(fields[2], ":", 3)
if len(mm) != 2 { if len(mm) != 2 {
return nil, fmt.Errorf("Parsing '%s' failed: unexpected minor:major pair %s", text, mm) return nil, fmt.Errorf("parsing '%s' failed: unexpected major:minor pair %s", text, mm)
} }
p.Major, _ = strconv.Atoi(mm[0]) p.Major, _ = strconv.Atoi(mm[0])
p.Minor, _ = strconv.Atoi(mm[1]) p.Minor, _ = strconv.Atoi(mm[1])
p.Root, err = unescape(fields[3]) p.Root, err = unescape(fields[3])
if err != nil { if err != nil {
return nil, fmt.Errorf("Parsing '%s' failed: root: %w", fields[3], err) return nil, fmt.Errorf("parsing '%s' failed: root: %w", fields[3], err)
} }
p.Options = fields[5] p.Options = fields[5]
// zero or more optional fields // zero or more optional fields
switch { p.Optional = strings.Join(fields[6:sepIdx], " ")
case sepIdx == 6:
// zero, do nothing
case sepIdx == 7:
p.Optional = fields[6]
default:
p.Optional = strings.Join(fields[6:sepIdx-1], " ")
}
// Run the filter after parsing all of the fields. // Run the filter after parsing all fields.
var skip, stop bool var skip, stop bool
if filter != nil { if filter != nil {
skip, stop = filter(p) skip, stop = filter(p)

3
vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go сгенерированный поставляемый
Просмотреть файл

@ -1,4 +1,5 @@
// +build !windows,!linux,!freebsd,!openbsd freebsd,!cgo openbsd,!cgo //go:build (!windows && !linux && !freebsd && !openbsd && !darwin) || (freebsd && !cgo) || (openbsd && !cgo) || (darwin && !cgo)
// +build !windows,!linux,!freebsd,!openbsd,!darwin freebsd,!cgo openbsd,!cgo darwin,!cgo
package mountinfo package mountinfo

4
vendor/github.com/moby/sys/signal/go.mod сгенерированный поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
module github.com/moby/sys/signal module github.com/moby/sys/signal
go 1.13 go 1.16
require golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c require golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359

4
vendor/github.com/moby/sys/signal/signal.go сгенерированный поставляемый
Просмотреть файл

@ -39,13 +39,13 @@ func ParseSignal(rawSignal string) (syscall.Signal, error) {
s, err := strconv.Atoi(rawSignal) s, err := strconv.Atoi(rawSignal)
if err == nil { if err == nil {
if s == 0 { if s == 0 {
return -1, fmt.Errorf("Invalid signal: %s", rawSignal) return -1, fmt.Errorf("invalid signal: %s", rawSignal)
} }
return syscall.Signal(s), nil return syscall.Signal(s), nil
} }
signal, ok := SignalMap[strings.TrimPrefix(strings.ToUpper(rawSignal), "SIG")] signal, ok := SignalMap[strings.TrimPrefix(strings.ToUpper(rawSignal), "SIG")]
if !ok { if !ok {
return -1, fmt.Errorf("Invalid signal: %s", rawSignal) return -1, fmt.Errorf("invalid signal: %s", rawSignal)
} }
return signal, nil return signal, nil
} }

2
vendor/github.com/moby/sys/signal/signal_darwin.go сгенерированный поставляемый
Просмотреть файл

@ -8,7 +8,7 @@ import (
var SignalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT, "ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM, "ALRM": syscall.SIGALRM,
"BUG": syscall.SIGBUS, "BUS": syscall.SIGBUS,
"CHLD": syscall.SIGCHLD, "CHLD": syscall.SIGCHLD,
"CONT": syscall.SIGCONT, "CONT": syscall.SIGCONT,
"EMT": syscall.SIGEMT, "EMT": syscall.SIGEMT,

2
vendor/github.com/moby/sys/signal/signal_freebsd.go сгенерированный поставляемый
Просмотреть файл

@ -8,7 +8,7 @@ import (
var SignalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT, "ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM, "ALRM": syscall.SIGALRM,
"BUF": syscall.SIGBUS, "BUS": syscall.SIGBUS,
"CHLD": syscall.SIGCHLD, "CHLD": syscall.SIGCHLD,
"CONT": syscall.SIGCONT, "CONT": syscall.SIGCONT,
"EMT": syscall.SIGEMT, "EMT": syscall.SIGEMT,

1
vendor/github.com/moby/sys/signal/signal_linux.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !mips && !mipsle && !mips64 && !mips64le
// +build !mips,!mipsle,!mips64,!mips64le // +build !mips,!mipsle,!mips64,!mips64le
package signal package signal

1
vendor/github.com/moby/sys/signal/signal_linux_mipsx.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build linux && (mips || mipsle || mips64 || mips64le)
// +build linux // +build linux
// +build mips mipsle mips64 mips64le // +build mips mipsle mips64 mips64le

3
vendor/github.com/moby/sys/signal/signal_unix.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package signal package signal
@ -16,6 +17,4 @@ const (
SIGWINCH = syscall.SIGWINCH SIGWINCH = syscall.SIGWINCH
// SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading // SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading
SIGPIPE = syscall.SIGPIPE SIGPIPE = syscall.SIGPIPE
// DefaultStopSignal is the syscall signal used to stop a container in unix systems.
DefaultStopSignal = "SIGTERM"
) )

1
vendor/github.com/moby/sys/signal/signal_unsupported.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !linux && !darwin && !freebsd && !windows
// +build !linux,!darwin,!freebsd,!windows // +build !linux,!darwin,!freebsd,!windows
package signal package signal

22
vendor/github.com/moby/sys/signal/signal_windows.go сгенерированный поставляемый
Просмотреть файл

@ -2,6 +2,8 @@ package signal
import ( import (
"syscall" "syscall"
"golang.org/x/sys/windows"
) )
// Signals used in cli/command (no windows equivalent, use // Signals used in cli/command (no windows equivalent, use
@ -10,17 +12,23 @@ const (
SIGCHLD = syscall.Signal(0xff) SIGCHLD = syscall.Signal(0xff)
SIGWINCH = syscall.Signal(0xff) SIGWINCH = syscall.Signal(0xff)
SIGPIPE = syscall.Signal(0xff) SIGPIPE = syscall.Signal(0xff)
// DefaultStopSignal is the syscall signal used to stop a container in windows systems.
DefaultStopSignal = "15"
) )
// SignalMap is a map of "supported" signals. As per the comment in GOLang's // SignalMap is a map of "supported" signals. As per the comment in GOLang's
// ztypes_windows.go: "More invented values for signals". Windows doesn't // ztypes_windows.go: "More invented values for signals". Windows doesn't
// really support signals in any way, shape or form that Unix does. // really support signals in any way, shape or form that Unix does.
//
// We have these so that docker kill can be used to gracefully (TERM) and
// forcibly (KILL) terminate a container on Windows.
var SignalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"KILL": syscall.SIGKILL, "ABRT": syscall.Signal(windows.SIGABRT),
"TERM": syscall.SIGTERM, "ALRM": syscall.Signal(windows.SIGALRM),
"BUS": syscall.Signal(windows.SIGBUS),
"FPE": syscall.Signal(windows.SIGFPE),
"HUP": syscall.Signal(windows.SIGHUP),
"ILL": syscall.Signal(windows.SIGILL),
"INT": syscall.Signal(windows.SIGINT),
"KILL": syscall.Signal(windows.SIGKILL),
"PIPE": syscall.Signal(windows.SIGPIPE),
"QUIT": syscall.Signal(windows.SIGQUIT),
"SEGV": syscall.Signal(windows.SIGSEGV),
"TERM": syscall.Signal(windows.SIGTERM),
"TRAP": syscall.Signal(windows.SIGTRAP),
} }

1
vendor/github.com/moby/sys/symlink/fs_unix.go сгенерированный поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package symlink package symlink

4
vendor/github.com/moby/sys/symlink/fs_windows.go сгенерированный поставляемый
Просмотреть файл

@ -89,7 +89,7 @@ func walkSymlinks(path string) (string, error) {
var b bytes.Buffer var b bytes.Buffer
for n := 0; path != ""; n++ { for n := 0; path != ""; n++ {
if n > maxIter { if n > maxIter {
return "", errors.New("EvalSymlinks: too many links in " + originalPath) return "", errors.New("too many links in " + originalPath)
} }
// A path beginning with `\\?\` represents the root, so automatically // A path beginning with `\\?\` represents the root, so automatically
@ -101,7 +101,7 @@ func walkSymlinks(path string) (string, error) {
} }
// find next path component, p // find next path component, p
var i = -1 i := -1
for j, c := range path { for j, c := range path {
if c < utf8RuneSelf && os.IsPathSeparator(uint8(c)) { if c < utf8RuneSelf && os.IsPathSeparator(uint8(c)) {
i = j i = j

4
vendor/github.com/moby/sys/symlink/go.mod сгенерированный поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
module github.com/moby/sys/symlink module github.com/moby/sys/symlink
go 1.14 go 1.16
require golang.org/x/sys v0.0.0-20200922070232-aee5d888a860 require golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359