forked from anchore/syft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip filling in empty fields in APK metadata (anchore#1484)
Signed-off-by: Nils Hanke <[email protected]> Signed-off-by: Nils Hanke <[email protected]>
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,43 @@ func TestSinglePackageDetails(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
{ | ||
fixture: "test-fixtures/empty-deps-and-provides", | ||
expected: pkg.ApkMetadata{ | ||
Package: "alpine-baselayout-data", | ||
OriginPackage: "alpine-baselayout", | ||
Version: "3.4.0-r0", | ||
Description: "Alpine base dir structure and init scripts", | ||
Maintainer: "Natanael Copa <[email protected]>", | ||
License: "GPL-2.0-only", | ||
Architecture: "x86_64", | ||
URL: "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", | ||
Size: 11664, | ||
InstalledSize: 77824, | ||
Dependencies: []string{}, | ||
Provides: []string{}, | ||
Checksum: "Q15ffjKT28lB7iSXjzpI/eDdYRCwM=", | ||
GitCommit: "bd965a7ebf7fd8f07d7a0cc0d7375bf3e4eb9b24", | ||
Files: []pkg.ApkFileRecord{ | ||
{Path: "/etc"}, | ||
{Path: "/etc/fstab"}, | ||
{Path: "/etc/group"}, | ||
{Path: "/etc/hostname"}, | ||
{Path: "/etc/hosts"}, | ||
{Path: "/etc/inittab"}, | ||
{Path: "/etc/modules"}, | ||
{Path: "/etc/mtab", OwnerUID: "0", OwnerGID: "0", Permissions: "0777"}, | ||
{Path: "/etc/nsswitch.conf"}, | ||
{Path: "/etc/passwd"}, | ||
{Path: "/etc/profile"}, | ||
{Path: "/etc/protocols"}, | ||
{Path: "/etc/services"}, | ||
{Path: "/etc/shadow", OwnerUID: "0", OwnerGID: "148", Permissions: "0640"}, | ||
{Path: "/etc/shells"}, | ||
{Path: "/etc/sysctl.conf"}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
fixture: "test-fixtures/base", | ||
expected: pkg.ApkMetadata{ | ||
|
35 changes: 35 additions & 0 deletions
35
syft/pkg/cataloger/apkdb/test-fixtures/empty-deps-and-provides
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
P:alpine-baselayout-data | ||
V:3.4.0-r0 | ||
A:x86_64 | ||
L:GPL-2.0-only | ||
T:Alpine base dir structure and init scripts | ||
o:alpine-baselayout | ||
m:Natanael Copa <[email protected]> | ||
U:https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout | ||
D: | ||
p: | ||
c:bd965a7ebf7fd8f07d7a0cc0d7375bf3e4eb9b24 | ||
i:[] | ||
t:1667573027 | ||
S:11664 | ||
I:77824 | ||
k:0 | ||
C:Q15ffjKT28lB7iSXjzpI/eDdYRCwM= | ||
F:etc | ||
R:fstab | ||
R:group | ||
R:hostname | ||
R:hosts | ||
R:inittab | ||
R:modules | ||
R:mtab | ||
a:0:0:0777 | ||
R:nsswitch.conf | ||
R:passwd | ||
R:profile | ||
R:protocols | ||
R:services | ||
R:shadow | ||
a:0:148:0640 | ||
R:shells | ||
R:sysctl.conf |