mirror of
https://github.com/anchore/syft.git
synced 2026-08-22 01:53:35 +02:00
fix(binary): gzip classifier & GNU gzip identity string (#5202)
--------- Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
parent
168eb64235
commit
236755a6b1
@ -899,6 +899,11 @@ func DefaultClassifiers() []binutils.Classifier {
|
||||
Class: "gzip-binary",
|
||||
FileGlob: "**/gzip",
|
||||
EvidenceMatcher: m.FileContentsVersionMatcher(
|
||||
// GNU gzip keeps the version as a bare NUL-delimited token, so require an identifying
|
||||
// string from the program as well. Without it any binary that happens to be named gzip
|
||||
// (such as the busybox multicall binary behind a gzip applet symlink) would have an
|
||||
// arbitrary NUL-delimited "N.N" token reported as a GNU gzip version.
|
||||
`%s: %s: not in gzip format`,
|
||||
`\x00(?P<version>[0-9]+\.[0-9]+)\x00`,
|
||||
),
|
||||
Package: "gzip",
|
||||
|
||||
BIN
syft/pkg/cataloger/binary/testdata/classifiers/negative/gzip
vendored
Normal file
BIN
syft/pkg/cataloger/binary/testdata/classifiers/negative/gzip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user