mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 08:26:38 +01:00
fix: restore case-insensitive java globbing for licenses, version and nested jars
The `archiveEntries` refactor dropped `GlobMatch`'s case-insensitive flag, so with nested cataloging off (the default) three lookups that main matched regardless of case became case-sensitive: - license files under `/META-INF/*` and `/*` (`meta-inf/LICENSE` was missed) - `/version.properties` - the `**/*.jar`, `**/*.war` check behind the "nested archives not cataloged" unknown, so `LIB.JAR` slipped past it `archiveEntries` now has a `globFold` for those call sites. The zip side restores `GlobMatch(true, ...)`, and the resolver side matches case-folded over every entry, since resolver globs are case-sensitive. Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -122,6 +122,10 @@ func TestZipFileManifest_GlobMatch(t *testing.T) {
|
||||
"**/a-file.txt",
|
||||
[]string{"some-dir/a-file.txt"},
|
||||
},
|
||||
{
|
||||
"**/A-file.txt",
|
||||
[]string{"some-dir/a-file.txt"},
|
||||
},
|
||||
{
|
||||
"**/*.zip",
|
||||
[]string{"nested.zip"},
|
||||
@@ -132,7 +136,7 @@ func TestZipFileManifest_GlobMatch(t *testing.T) {
|
||||
t.Run(tc.glob, func(t *testing.T) {
|
||||
glob := tc.glob
|
||||
|
||||
results := z.GlobMatch(glob)
|
||||
results := z.GlobMatch(true, glob)
|
||||
|
||||
require.ElementsMatch(t, tc.expected, results)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user