]> 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)
committerSteve Sakoman <steve@sakoman.com>
Fri, 15 Mar 2024 15:07:18 +0000 (05:07 -1000)
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>
(cherry picked from commit f276a980b8930b98e6c8f0e1a865d77dfcfe5085)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
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']: