mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
hide digests for rpm dirs
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
e415bb21e7
commit
1c2254f5cf
@ -97,14 +97,19 @@ func extractRpmdbFileRecords(resolver source.FilePathResolver, entry *rpmdb.Pack
|
|||||||
for _, record := range entry.Files {
|
for _, record := range entry.Files {
|
||||||
// only persist RPMDB file records which exist in the image/directory, otherwise ignore them
|
// only persist RPMDB file records which exist in the image/directory, otherwise ignore them
|
||||||
if resolver.HasPath(record.Path) {
|
if resolver.HasPath(record.Path) {
|
||||||
records = append(records, pkg.RpmdbFileRecord{
|
var digest *file.Digest
|
||||||
Path: record.Path,
|
if record.Digest != "" {
|
||||||
Mode: pkg.RpmdbFileMode(record.Mode),
|
digest = &file.Digest{
|
||||||
Size: int(record.Size),
|
|
||||||
Digest: file.Digest{
|
|
||||||
Value: record.Digest,
|
Value: record.Digest,
|
||||||
Algorithm: entry.DigestAlgorithm.String(),
|
Algorithm: entry.DigestAlgorithm.String(),
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
records = append(records, pkg.RpmdbFileRecord{
|
||||||
|
Path: record.Path,
|
||||||
|
Mode: pkg.RpmdbFileMode(record.Mode),
|
||||||
|
Size: int(record.Size),
|
||||||
|
Digest: digest,
|
||||||
UserName: record.Username,
|
UserName: record.Username,
|
||||||
GroupName: record.Groupname,
|
GroupName: record.Groupname,
|
||||||
Flags: record.Flags.String(),
|
Flags: record.Flags.String(),
|
||||||
|
|||||||
@ -37,7 +37,7 @@ type RpmdbFileRecord struct {
|
|||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Mode RpmdbFileMode `json:"mode"`
|
Mode RpmdbFileMode `json:"mode"`
|
||||||
Size int `json:"size"`
|
Size int `json:"size"`
|
||||||
Digest file.Digest `json:"digest"`
|
Digest *file.Digest `json:"digest,omitempty"`
|
||||||
UserName string `json:"userName"`
|
UserName string `json:"userName"`
|
||||||
GroupName string `json:"groupName"`
|
GroupName string `json:"groupName"`
|
||||||
Flags string `json:"flags"`
|
Flags string `json:"flags"`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user