From 0b505454713ef719ce0c17e27f1c253c0e420322 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 31 Jul 2026 18:09:40 +0200 Subject: [PATCH] vendor: github.com/moby/go-archive v0.3.1 full diff: https://github.com/moby/go-archive/compare/v0.3.0...v0.3.1 Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 +- vendor/github.com/moby/go-archive/archive.go | 113 +++++++++---------- vendor/modules.txt | 2 +- 4 files changed, 59 insertions(+), 62 deletions(-) diff --git a/vendor.mod b/vendor.mod index db9e9ac843c3..bf59f607d24c 100644 --- a/vendor.mod +++ b/vendor.mod @@ -31,7 +31,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/uuid v1.6.0 github.com/mattn/go-runewidth v0.0.24 - github.com/moby/go-archive v0.3.0 + github.com/moby/go-archive v0.3.1 github.com/moby/moby/api v1.55.0 github.com/moby/moby/client v0.5.1 github.com/moby/patternmatcher v0.6.1 diff --git a/vendor.sum b/vendor.sum index 86c70a452ba0..62355dcfd127 100644 --- a/vendor.sum +++ b/vendor.sum @@ -107,8 +107,8 @@ github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhg github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/go-archive v0.3.0 h1:nos4BtzzUIqB406BgQnWGMI4qib9BZ8XUHU+ucv/n1c= -github.com/moby/go-archive v0.3.0/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE= +github.com/moby/go-archive v0.3.1 h1:AHwfS8lTrPOb4rg9IFuc3k5Xg7jCzYidPt8SimWPHLM= +github.com/moby/go-archive v0.3.1/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE= github.com/moby/moby/api v1.55.0 h1:2/sexvQyqIWS8pRSCFddBfpW2qE7vR7FCL+vN8pxwMc= github.com/moby/moby/api v1.55.0/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= github.com/moby/moby/client v0.5.1 h1:tYNaJno4c0HXz12y5BiqEDy0rVTYkWzI26lGvnTMiJw= diff --git a/vendor/github.com/moby/go-archive/archive.go b/vendor/github.com/moby/go-archive/archive.go index 4d9e87d20490..2bcadec55664 100644 --- a/vendor/github.com/moby/go-archive/archive.go +++ b/vendor/github.com/moby/go-archive/archive.go @@ -698,13 +698,13 @@ func (t *Tarballer) Do() { defer func() { // Make sure to check the error on Close. - if err := ta.TarWriter.Close(); err != nil { + if err := ta.TarWriter.Close(); err != nil && !errors.Is(err, io.ErrClosedPipe) { log.G(context.TODO()).Errorf("Can't close tar writer: %s", err) } - if err := t.compressWriter.Close(); err != nil { + if err := t.compressWriter.Close(); err != nil && !errors.Is(err, io.ErrClosedPipe) { log.G(context.TODO()).Errorf("Can't close compress writer: %s", err) } - if err := t.pipeWriter.Close(); err != nil { + if err := t.pipeWriter.Close(); err != nil && !errors.Is(err, io.ErrClosedPipe) { log.G(context.TODO()).Errorf("Can't close pipe writer: %s", err) } }() @@ -1034,71 +1034,68 @@ func unrepresentableOnWindows(hdr *tar.Header) error { // destination at the OS level (openat(2) semantics), preventing escape via // symlinks in the destination tree. func createImpliedDirectories(root *os.Root, hdr *tar.Header, options *TarOptions) error { - // For non-directory entries, ensure that the parent directory exists. - if hdr.Typeflag != tar.TypeDir { - parent := filepath.FromSlash(path.Dir(strings.TrimSuffix(hdr.Name, "/"))) - // Skip when the parent is the root itself; nothing to create. - if parent == "." || parent == "" { - return nil - } - if _, err := root.Lstat(parent); err == nil { - return nil - } else if !os.IsNotExist(err) { - return err + parent := filepath.FromSlash(path.Dir(strings.TrimSuffix(hdr.Name, "/"))) + // Skip when the parent is the root itself; nothing to create. + if parent == "." || parent == "" { + return nil + } + if _, err := root.Lstat(parent); err == nil { + return nil + } else if !os.IsNotExist(err) { + return err + } + // RootPair() is confined inside this loop as most cases will not require a call, so we can spend some + // unneeded function calls in the uncommon case to encapsulate logic -- implied directories are a niche + // usage that reduces the portability of an image. + uid, gid := options.IDMap.RootPair() + + // Similar to [user.MkdirAllAndChown] + // + // [user.MkdirAllAndChown]: https://pkg.go.dev/github.com/moby/sys/user#MkdirAllAndChown + var cur string + for c := range strings.SplitSeq(parent, string(os.PathSeparator)) { + if c == "" { + continue } - // RootPair() is confined inside this loop as most cases will not require a call, so we can spend some - // unneeded function calls in the uncommon case to encapsulate logic -- implied directories are a niche - // usage that reduces the portability of an image. - uid, gid := options.IDMap.RootPair() - - // Similar to [user.MkdirAllAndChown] - // - // [user.MkdirAllAndChown]: https://pkg.go.dev/github.com/moby/sys/user#MkdirAllAndChown - var cur string - for c := range strings.SplitSeq(parent, string(os.PathSeparator)) { - if c == "" { - continue + cur = filepath.Join(cur, c) + if err := root.Mkdir(cur, ImpliedDirectoryMode); err != nil { + if !errors.Is(err, os.ErrExist) { + return err } - cur = filepath.Join(cur, c) - if err := root.Mkdir(cur, ImpliedDirectoryMode); err != nil { - if !errors.Is(err, os.ErrExist) { - return err - } - fi, err := root.Stat(cur) - if err != nil { - return err - } - if fi.IsDir() { - continue - } - return &os.PathError{Op: "mkdir", Path: cur, Err: syscall.ENOTDIR} - } - if options.NoLchown { - continue - } - // Only the successful Mkdir case is newly-created. - dir, err := root.Open(cur) + fi, err := root.Stat(cur) if err != nil { return err } - if uid != 0 || gid != 0 { - if err := dir.Chown(uid, gid); err != nil { - _ = dir.Close() - return err - } + if fi.IsDir() { + continue } - // root.Mkdir applies the mode subject to the process umask, so - // re-apply it with Chmod to guarantee ImpliedDirectoryMode - // independent of umask, matching the previous MkdirAllAndChown - // behavior. - if err := dir.Chmod(ImpliedDirectoryMode); err != nil { + return &os.PathError{Op: "mkdir", Path: cur, Err: syscall.ENOTDIR} + } + if options.NoLchown { + continue + } + // Only the successful Mkdir case is newly-created. + dir, err := root.Open(cur) + if err != nil { + return err + } + if uid != 0 || gid != 0 { + if err := dir.Chown(uid, gid); err != nil { _ = dir.Close() return err } - if err := dir.Close(); err != nil { - return err - } + } + // root.Mkdir applies the mode subject to the process umask, so + // re-apply it with Chmod to guarantee ImpliedDirectoryMode + // independent of umask, matching the previous MkdirAllAndChown + // behavior. + if err := dir.Chmod(ImpliedDirectoryMode); err != nil { + _ = dir.Close() + return err + } + if err := dir.Close(); err != nil { + return err } } diff --git a/vendor/modules.txt b/vendor/modules.txt index b5f6d9db5581..a872abe516db 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -162,7 +162,7 @@ github.com/mattn/go-runewidth # github.com/moby/docker-image-spec v1.3.1 ## explicit; go 1.18 github.com/moby/docker-image-spec/specs-go/v1 -# github.com/moby/go-archive v0.3.0 +# github.com/moby/go-archive v0.3.1 ## explicit; go 1.25 github.com/moby/go-archive github.com/moby/go-archive/compression