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:
Christopher Angelo Phillips 2026-08-20 16:02:14 -04:00 committed by GitHub
parent 168eb64235
commit 236755a6b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View File

@ -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",

Binary file not shown.