From 1143c12a97529fbfc60cecdefb53b6e8d0c33d4b Mon Sep 17 00:00:00 2001 From: sputnik-mac Date: Mon, 29 Jun 2026 21:17:52 +0700 Subject: [PATCH] fix: add .bpl file extension support to PE/DLL cataloger (closes #4664) (#4688) Borland Package Library (.bpl) files are standard Windows PE/DLL files used in Delphi and C++Builder ecosystems. This adds the .bpl glob pattern to the PE file discovery so these files are cataloged alongside .dll and .exe files. --- syft/pkg/cataloger/dotnet/cataloger_test.go | 2 ++ syft/pkg/cataloger/dotnet/deps_binary_cataloger.go | 3 ++- .../pkg/cataloger/dotnet/testdata/glob-paths/src/something.bpl | 0 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 syft/pkg/cataloger/dotnet/testdata/glob-paths/src/something.bpl diff --git a/syft/pkg/cataloger/dotnet/cataloger_test.go b/syft/pkg/cataloger/dotnet/cataloger_test.go index 163e5718a..65076f9f1 100644 --- a/syft/pkg/cataloger/dotnet/cataloger_test.go +++ b/syft/pkg/cataloger/dotnet/cataloger_test.go @@ -32,6 +32,7 @@ func TestCataloger_Globs(t *testing.T) { fixture: "testdata/glob-paths", cataloger: NewDotnetPortableExecutableCataloger(), expected: []string{ + "src/something.bpl", "src/something.dll", "src/something.exe", }, @@ -41,6 +42,7 @@ func TestCataloger_Globs(t *testing.T) { fixture: "testdata/glob-paths", cataloger: NewDotnetDepsBinaryCataloger(DefaultCatalogerConfig()), expected: []string{ + "src/something.bpl", "src/something.deps.json", "src/something.dll", "src/something.exe", diff --git a/syft/pkg/cataloger/dotnet/deps_binary_cataloger.go b/syft/pkg/cataloger/dotnet/deps_binary_cataloger.go index 105c98c47..fbf53e648 100644 --- a/syft/pkg/cataloger/dotnet/deps_binary_cataloger.go +++ b/syft/pkg/cataloger/dotnet/deps_binary_cataloger.go @@ -23,6 +23,7 @@ const ( depsJSONGlob = "**/*.deps.json" dllGlob = "**/*.dll" exeGlob = "**/*.exe" + bplGlob = "**/*.bpl" ) // depsBinaryCataloger will search for both deps.json evidence and PE file evidence to create packages. All packages @@ -472,7 +473,7 @@ func readDepsJSON(resolver file.Resolver, loc file.Location) (*depsJSON, error) // findPEFiles locates and parses all PE files (dll/exe). func findPEFiles(resolver file.Resolver) ([]logicalPE, error, error) { - peLocs, err := resolver.FilesByGlob(dllGlob, exeGlob) + peLocs, err := resolver.FilesByGlob(dllGlob, exeGlob, bplGlob) if err != nil { return nil, nil, fmt.Errorf("unable to find PE files: %w", err) } diff --git a/syft/pkg/cataloger/dotnet/testdata/glob-paths/src/something.bpl b/syft/pkg/cataloger/dotnet/testdata/glob-paths/src/something.bpl new file mode 100644 index 000000000..e69de29bb