Change structure of VulnInfo.Pacakges to []string

This commit is contained in:
Kota Kanbe
2017-05-09 00:20:11 +09:00
committed by kota kanbe
parent 210e3dc990
commit b977558f38
9 changed files with 128 additions and 137 deletions

View File

@@ -33,7 +33,14 @@ type bsd struct {
// NewBSD constructor
func newBsd(c config.ServerInfo) *bsd {
d := &bsd{}
d := &bsd{
base: base{
osPackages: osPackages{
Packages: models.Packages{},
VulnInfos: models.VulnInfos{},
},
},
}
d.log = util.NewCustomLogger(c)
d.setServerInfo(c)
return d
@@ -155,9 +162,13 @@ func (o *bsd) scanUnsecurePackages() (vulnInfos []models.VulnInfo, err error) {
})
}
names := []string{}
for name := range packs {
names = append(names, name)
}
vulnInfos = append(vulnInfos, models.VulnInfo{
CveID: k,
Packages: packs,
PackageNames: names,
DistroAdvisories: disAdvs,
Confidence: models.PkgAuditMatch,
})