Bump github.com/containers/storage from 1.31.1 to 1.31.2

Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.31.1 to 1.31.2.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.31.1...v1.31.2)

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2021-05-21 07:25:04 +00:00
committed by GitHub
parent e48aa8c82f
commit 94665bdf01
14 changed files with 65 additions and 18 deletions

View File

@@ -129,6 +129,17 @@ func (overlayWhiteoutConverter) ConvertReadWithHandler(hdr *tar.Header, path str
originalPath := filepath.Join(dir, originalBase)
if err := handler.Mknod(originalPath, unix.S_IFCHR, 0); err != nil {
// If someone does:
// rm -rf /foo/bar
// in an image, some tools will generate a layer with:
// /.wh.foo
// /foo/.wh.bar
// and when doing the second mknod(), we will fail with
// ENOTDIR, since the previous /foo was mknod()'d as a
// character device node and not a directory.
if isENOTDIR(err) {
return false, nil
}
return false, err
}
if err := handler.Chown(originalPath, hdr.Uid, hdr.Gid); err != nil {

View File

@@ -121,6 +121,9 @@ func isENOTDIR(err error) bool {
if err == nil {
return false
}
if err == syscall.ENOTDIR {
return true
}
if perror, ok := err.(*os.PathError); ok {
if errno, ok := perror.Err.(syscall.Errno); ok {
return errno == syscall.ENOTDIR