Fix(reporting): NotFixedYet of SourcePackage in OVAL match on Debian and Ubuntu (#656)

* fix(refactoring): oval

* Fix(reporting): NotFixedYet of SourcePackage in OVAL match on Debian and Ubuntu #655
This commit is contained in:
Kota Kanbe
2018-05-22 18:53:08 +09:00
committed by GitHub
parent 9cc78770a3
commit 09779962cf
8 changed files with 89 additions and 10 deletions

View File

@@ -64,7 +64,18 @@ func (o DebianBase) update(r *models.ScanResult, defPacks defPacks) {
defPacks.actuallyAffectedPackNames[pack.Name] = notFixedYet
}
vinfo.AffectedPackages = defPacks.toPackStatuses(r.Family)
// update notFixedYet of SrcPackage
for binName := range defPacks.actuallyAffectedPackNames {
if srcPack, ok := r.SrcPackages.FindByBinName(binName); ok {
for _, p := range defPacks.def.AffectedPacks {
if p.Name == srcPack.Name {
defPacks.actuallyAffectedPackNames[binName] = p.NotFixedYet
}
}
}
}
vinfo.AffectedPackages = defPacks.toPackStatuses()
vinfo.AffectedPackages.Sort()
r.ScannedCves[defPacks.def.Debian.CveID] = vinfo
}