From 390c256c3804366a7aff406e9570202f1e75905d Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Mon, 8 Aug 2022 18:57:08 +0600 Subject: [PATCH] chore(image): skip symlinks and hardlinks from tar scan (#2634) --- pkg/fanal/walker/tar.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/fanal/walker/tar.go b/pkg/fanal/walker/tar.go index 4875ce00a66..836c22fc562 100644 --- a/pkg/fanal/walker/tar.go +++ b/pkg/fanal/walker/tar.go @@ -64,10 +64,11 @@ func (w LayerTar) Walk(layer io.Reader, analyzeFn WalkFunc) ([]string, []string, skipDirs = append(skipDirs, filePath) continue } - case tar.TypeSymlink, tar.TypeLink, tar.TypeReg: + case tar.TypeReg: if w.shouldSkipFile(filePath) { continue } + // symlinks and hardlinks have no content in reader, skip them default: continue }