]> code.ossystems Code Review - openembedded-core.git/commitdiff
cve-check: allow recipes to override their version
authorRoss Burton <ross.burton@intel.com>
Fri, 9 Feb 2018 12:37:08 +0000 (12:37 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Feb 2018 18:05:25 +0000 (18:05 +0000)
For reasons which I don't understand, the Berkeley DB tarball is version 5.3.28
but in CVE reports the version is 11.2.5.3.28.

To handle this allow recipes to override their version as well as their name.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/cve-check.bbclass

index 62dd6424d5cd7acd719d9ade6331e558cab3cc46..061e883fa7b1b1e06d290d2a8544bdc7342c3dae 100644 (file)
@@ -23,6 +23,7 @@
 # The product name that the CVE database uses.  Defaults to BPN, but may need to
 # be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).
 CVE_PRODUCT ??= "${BPN}"
+CVE_VERSION ??= "${PV}"
 
 CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
 CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvd.db"
@@ -168,7 +169,7 @@ def check_cves(d, patched_cves):
     cves_patched = []
     cves_unpatched = []
     bpn = d.getVar("CVE_PRODUCT")
-    pv = d.getVar("PV").split("+git")[0]
+    pv = d.getVar("CVE_VERSION").split("+git")[0]
     cves = " ".join(patched_cves)
     cve_db_dir = d.getVar("CVE_CHECK_DB_DIR")
     cve_whitelist = ast.literal_eval(d.getVar("CVE_CHECK_CVE_WHITELIST"))