]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cve-update-nvd2-native: Remove rejected CVE from database
authorYoann Congal <yoann.congal@smile.fr>
Fri, 15 Mar 2024 00:20:20 +0000 (01:20 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Mar 2024 07:36:11 +0000 (07:36 +0000)
When a CVE is updated to be rejected, matching database entries must be
removed. Otherwise:
* an incremental update is not equivalent the to an initial download.
* rejected CVEs might still appear as Unpatched in cve-check.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/meta/cve-update-nvd2-native.bb

index 4b8d01fe84a3f96bf9025d005fcb226a2e9ad660..1901641965a5f37f0264c1defd60e1cffb575711 100644 (file)
@@ -324,6 +324,10 @@ def update_db(conn, elt):
     vectorString = None
     cveId = elt['cve']['id']
     if elt['cve']['vulnStatus'] ==  "Rejected":
+        c = conn.cursor()
+        c.execute("delete from PRODUCTS where ID = ?;", [cveId])
+        c.execute("delete from NVD where ID = ?;", [cveId])
+        c.close()
         return
     cveDesc = ""
     for desc in elt['cve']['descriptions']: