Skip to content

Commit

Permalink
chore(image): skip symlinks and hardlinks from tar scan (#2634)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Aug 8, 2022
1 parent 63c33bf commit 390c256
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/fanal/walker/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 390c256

Please sign in to comment.