mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
make image listing more resilient
Handle more TOCTOUs operating on listed images. Also pull in containers/common/pull/1520 and containers/common/pull/1522 which do the same on the internal layer tree. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2216700 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/common/libimage/image.go
generated
vendored
2
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@@ -402,7 +402,7 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
|
||||
// have a closer look at the errors. On top, image removal should be
|
||||
// tolerant toward corrupted images.
|
||||
handleError := func(err error) error {
|
||||
if errors.Is(err, storage.ErrImageUnknown) || errors.Is(err, storage.ErrNotAnImage) || errors.Is(err, storage.ErrLayerUnknown) {
|
||||
if ErrorIsImageUnknown(err) {
|
||||
// The image or layers of the image may already have been removed
|
||||
// in which case we consider the image to be removed.
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user