1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #42656 from thaJeztah/update_containerd_binary_1.5.4

Update containerd v1.5.4
This commit is contained in:
Akihiro Suda 2021-07-20 20:04:56 +09:00 committed by GitHub
commit 471fd27709
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 24 deletions

View file

@ -4,7 +4,7 @@ set -e
# containerd is also pinned in vendor.conf. When updating the binary # containerd is also pinned in vendor.conf. When updating the binary
# version you may also need to update the vendor version to pick up bug # version you may also need to update the vendor version to pick up bug
# fixes or new APIs. # fixes or new APIs.
: "${CONTAINERD_COMMIT:=0e8719f54c6dc6571fc1170da75a85e86c17636b}" # v1.5.3 : "${CONTAINERD_COMMIT:=69107e47a62e1d690afa2b9b1d43f8ece3ff4483}" # v1.5.4
install_containerd() ( install_containerd() (
echo "Install containerd version $CONTAINERD_COMMIT" echo "Install containerd version $CONTAINERD_COMMIT"

View file

@ -128,7 +128,7 @@ github.com/googleapis/gax-go bd5b16380fd03dc758d11cef74ba
google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8 google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8
# containerd # containerd
github.com/containerd/containerd 0e8719f54c6dc6571fc1170da75a85e86c17636b # v1.5.3 github.com/containerd/containerd 69107e47a62e1d690afa2b9b1d43f8ece3ff4483 # v1.5.4
github.com/containerd/fifo 650e8a8a179d040123db61f016cb133143e7a581 # v1.0.0 github.com/containerd/fifo 650e8a8a179d040123db61f016cb133143e7a581 # v1.0.0
github.com/containerd/continuity bce1c3f9669b6f3e7f6656ee715b0b4d75fa64a6 # v0.1.0 github.com/containerd/continuity bce1c3f9669b6f3e7f6656ee715b0b4d75fa64a6 # v0.1.0
github.com/containerd/cgroups b9de8a2212026c07cec67baf3323f1fc0121e048 # v1.0.1 github.com/containerd/cgroups b9de8a2212026c07cec67baf3323f1fc0121e048 # v1.0.1

View file

@ -393,9 +393,8 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
} }
} }
// There is no LChmod, so ignore mode for symlink. Also, this // call lchmod after lchown since lchown can modify the file mode
// must happen after chown, as that can modify the file mode if err := lchmod(path, hdrInfo.Mode()); err != nil {
if err := handleLChmod(hdr, path, hdrInfo); err != nil {
return err return err
} }

View file

@ -18,7 +18,11 @@
package archive package archive
import "golang.org/x/sys/unix" import (
"os"
"golang.org/x/sys/unix"
)
// mknod wraps unix.Mknod. FreeBSD's unix.Mknod signature is different from // mknod wraps unix.Mknod. FreeBSD's unix.Mknod signature is different from
// other Unix and Unix-like operating systems. // other Unix and Unix-like operating systems.
@ -34,3 +38,11 @@ func lsetxattrCreate(link string, attr string, data []byte) error {
} }
return err return err
} }
func lchmod(path string, mode os.FileMode) error {
err := unix.Fchmodat(unix.AT_FDCWD, path, uint32(mode), unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
err = &os.PathError{Op: "lchmod", Path: path, Err: err}
}
return err
}

View file

@ -18,7 +18,11 @@
package archive package archive
import "golang.org/x/sys/unix" import (
"os"
"golang.org/x/sys/unix"
)
// mknod wraps Unix.Mknod and casts dev to int // mknod wraps Unix.Mknod and casts dev to int
func mknod(path string, mode uint32, dev uint64) error { func mknod(path string, mode uint32, dev uint64) error {
@ -34,3 +38,18 @@ func lsetxattrCreate(link string, attr string, data []byte) error {
} }
return err return err
} }
// lchmod checks for symlink and changes the mode if not a symlink
func lchmod(path string, mode os.FileMode) error {
fi, err := os.Lstat(path)
if err != nil {
return err
}
if fi.Mode()&os.ModeSymlink == 0 {
if err := os.Chmod(path, mode); err != nil {
return err
}
}
return nil
}

View file

@ -111,21 +111,6 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
return mknod(path, mode, unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor))) return mknod(path, mode, unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor)))
} }
func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
if hdr.Typeflag == tar.TypeLink {
if fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {
if err := os.Chmod(path, hdrInfo.Mode()); err != nil && !os.IsNotExist(err) {
return err
}
}
} else if hdr.Typeflag != tar.TypeSymlink {
if err := os.Chmod(path, hdrInfo.Mode()); err != nil {
return err
}
}
return nil
}
func getxattr(path, attr string) ([]byte, error) { func getxattr(path, attr string) ([]byte, error) {
b, err := sysx.LGetxattr(path, attr) b, err := sysx.LGetxattr(path, attr)
if err == unix.ENOTSUP || err == sysx.ENODATA { if err == unix.ENOTSUP || err == sysx.ENODATA {

View file

@ -98,7 +98,7 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
return nil return nil
} }
func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error { func lchmod(path string, mode os.FileMode) error {
return nil return nil
} }

View file

@ -23,7 +23,7 @@ var (
Package = "github.com/containerd/containerd" Package = "github.com/containerd/containerd"
// Version holds the complete version number. Filled in at linking time. // Version holds the complete version number. Filled in at linking time.
Version = "1.5.3+unknown" Version = "1.5.4+unknown"
// Revision is filled with the VCS (e.g. git) revision being used to build // Revision is filled with the VCS (e.g. git) revision being used to build
// the program at linking time. // the program at linking time.