Merge pull request #413 from transcedentalia/master

Fixing the always database revision 0 for Ubuntu
This commit is contained in:
Jimmy Zelinskie 2017-06-12 11:13:59 -04:00
parent 4f8d6bee1e
commit 2453d67c36
2 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,8 @@ func (d detector) Detect(files tarutil.FilesMap) (*database.Namespace, error) {
OS = "debian" OS = "debian"
break break
} }
line[2] = strings.Split(line[2], "/")[0]
version, found = database.UbuntuReleasesMapping[line[2]] version, found = database.UbuntuReleasesMapping[line[2]]
if found { if found {
OS = "ubuntu" OS = "ubuntu"

View File

@ -344,6 +344,7 @@ func parseUbuntuCVE(fileContent io.Reader) (vulnerability database.Vulnerability
// Only consider the package if its status is needed, active, deferred, not-affected or // Only consider the package if its status is needed, active, deferred, not-affected or
// released. Ignore DNE (package does not exist), needs-triage, ignored, pending. // released. Ignore DNE (package does not exist), needs-triage, ignored, pending.
if md["status"] == "needed" || md["status"] == "active" || md["status"] == "deferred" || md["status"] == "released" || md["status"] == "not-affected" { if md["status"] == "needed" || md["status"] == "active" || md["status"] == "deferred" || md["status"] == "released" || md["status"] == "not-affected" {
md["release"] = strings.Split(md["release"], "/")[0]
if _, isReleaseIgnored := ubuntuIgnoredReleases[md["release"]]; isReleaseIgnored { if _, isReleaseIgnored := ubuntuIgnoredReleases[md["release"]]; isReleaseIgnored {
continue continue
} }