mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Search /usr/share for rpmdb to fix scan on ostree-managed images (#1756)
Fixes: https://github.com/anchore/syft/issues/1755 Signed-off-by: Filip Pytloun <filip@pytloun.cz> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
dd458a2b33
commit
95a04cadea
@ -16,6 +16,9 @@ func Test_DBCataloger_Globs(t *testing.T) {
|
||||
name: "obtain DB files",
|
||||
fixture: "test-fixtures/glob-paths",
|
||||
expected: []string{
|
||||
"usr/share/rpm/Packages",
|
||||
"usr/share/rpm/Packages.db",
|
||||
"usr/share/rpm/rpmdb.sqlite",
|
||||
"var/lib/rpm/Packages",
|
||||
"var/lib/rpm/Packages.db",
|
||||
"var/lib/rpm/rpmdb.sqlite",
|
||||
|
||||
@ -0,0 +1 @@
|
||||
bogus
|
||||
@ -0,0 +1 @@
|
||||
bogus
|
||||
@ -0,0 +1 @@
|
||||
bogus
|
||||
@ -8,10 +8,12 @@ import (
|
||||
"github.com/anchore/syft/syft/file"
|
||||
)
|
||||
|
||||
// /var/lib/rpm/... is the typical path for most distributions
|
||||
// /usr/share/rpm/... is common for rpm-ostree distributions (coreos-like)
|
||||
// Packages is the legacy Berkely db based format
|
||||
// Packages.db is the "ndb" format used in SUSE
|
||||
// rpmdb.sqlite is the sqlite format used in fedora + derivates
|
||||
const RpmDBGlob = "**/var/lib/rpm/{Packages,Packages.db,rpmdb.sqlite}"
|
||||
const RpmDBGlob = "**/{var/lib,usr/share}/rpm/{Packages,Packages.db,rpmdb.sqlite}"
|
||||
|
||||
// Used in CBL-Mariner distroless images
|
||||
const RpmManifestGlob = "**/var/lib/rpmmanifest/container-manifest-2"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user