From d4a967e6e6489cd18e366ef9274e9664d79c34ff Mon Sep 17 00:00:00 2001 From: alinar Date: Wed, 7 Jun 2017 12:37:24 +0100 Subject: [PATCH] Fixing always revision 0 for ubuntu --- ext/featurens/aptsources/aptsources.go | 2 ++ ext/vulnsrc/ubuntu/ubuntu.go | 1 + 2 files changed, 3 insertions(+) diff --git a/ext/featurens/aptsources/aptsources.go b/ext/featurens/aptsources/aptsources.go index 3330ec69..c43818e7 100644 --- a/ext/featurens/aptsources/aptsources.go +++ b/ext/featurens/aptsources/aptsources.go @@ -68,6 +68,8 @@ func (d detector) Detect(files tarutil.FilesMap) (*database.Namespace, error) { OS = "debian" break } + + line[2] = strings.Split(line[2], "/")[0] version, found = database.UbuntuReleasesMapping[line[2]] if found { OS = "ubuntu" diff --git a/ext/vulnsrc/ubuntu/ubuntu.go b/ext/vulnsrc/ubuntu/ubuntu.go index c328ae31..28803c76 100644 --- a/ext/vulnsrc/ubuntu/ubuntu.go +++ b/ext/vulnsrc/ubuntu/ubuntu.go @@ -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 // 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" { + md["release"] = strings.Split(md["release"], "/")[0] if _, isReleaseIgnored := ubuntuIgnoredReleases[md["release"]]; isReleaseIgnored { continue }