summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-08-24 18:58:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-16 15:24:02 +0100
commit189673244b571ad4b9fb121fbffded0e4568d31b (patch)
treea5e46b5a2e5c38e697740bac91b6728aa78921ef /meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
parent08dc55ce846ee198e69e36dd8b49d26610279c86 (diff)
downloadpoky-189673244b571ad4b9fb121fbffded0e4568d31b.tar.gz
cve-check-tool: Add recipe
cve-check-tool is a program for public CVEs checking. This tool also seek to determine if a vulnerability has been addressed by a patch. The recipe also includes the do_populate_cve_db task that will populate the database used by the tool. [YOCTO #7515] (From OE-Core rev: 5deadfe634638b99420342950bc544547f7121dc) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb')
-rw-r--r--meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
new file mode 100644
index 0000000000..116555962c
--- /dev/null
+++ b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
@@ -0,0 +1,59 @@
1SUMMARY = "cve-check-tool"
2DESCRIPTION = "cve-check-tool is a tool for checking known (public) CVEs.\
3The tool will identify potentially vunlnerable software packages within Linux distributions through version matching."
4HOMEPAGE = "https://github.com/ikeydoherty/cve-check-tool"
5SECTION = "Development/Tools"
6LICENSE = "GPL-2.0+"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=e8c1458438ead3c34974bc0be3a03ed6"
8
9SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.tar.xz \
10 file://check-for-malloc_trim-before-using-it.patch \
11 "
12
13SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
14SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b"
15
16DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates"
17
18RDEPENDS_${PN} = "ca-certificates"
19
20inherit pkgconfig autotools
21
22EXTRA_OECONF = "--disable-coverage"
23CFLAGS_append = " -Wno-error=pedantic"
24
25python do_populate_cve_db () {
26 import subprocess
27 import time
28
29 if d.getVar("BB_NO_NETWORK", True) == "1":
30 bb.error("BB_NO_NETWORK is set; Can't update cve-check-tool database, "
31 "CVEs won't be checked")
32 return
33
34 bb.utils.export_proxies(d)
35 # In case we don't inherit cve-check class, use default values defined in the class.
36 cve_dir = d.getVar("CVE_CHECK_DB_DIR", True) or d.expand("${DL_DIR}/CVE_CHECK")
37 cve_file = d.getVar("CVE_CHECK_TMP_FILE", True) or d.expand("${TMPDIR}/cve_check")
38 cve_cmd = "cve-check-update"
39 cmd = [cve_cmd, "-d", cve_dir]
40 bb.debug(1, "Updating cve-check-tool database located in %s" % cve_dir)
41 try:
42 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
43 bb.debug(2, "Command '%s' returned:\n%s" % ("\n".join(cmd), output))
44 time_utc = time.gmtime(time.time())
45 time_format = "%Y-%m-%d %H:%M:%S"
46 with open(cve_file, "w") as f:
47 f.write("CVE database was updated on %s UTC\n\n"
48 % time.strftime(time_format, time_utc))
49
50 except subprocess.CalledProcessError as e:
51 bb.warn("Error in executing cve-check-update: %s (output %s)" % (e, e.output))
52 if bb.data.inherits_class('cve-check', d):
53 bb.warn("Failed to update cve-check-tool database, CVEs won't be checked")
54}
55
56addtask populate_cve_db after do_populate_sysroot
57do_populate_cve_db[nostamp] = "1"
58
59BBCLASSEXTEND = "native nativesdk"