]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
cve-update-nvd2-native: Remove rejected CVE from database
authorYoann Congal <yoann.congal@smile.fr>
Mon, 18 Mar 2024 02:21:52 +0000 (16:21 -1000)
committerSteve Sakoman <steve@sakoman.com>
Mon, 18 Mar 2024 21:44:32 +0000 (11:44 -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 0044529b7d50c0368f89391c277e80e2e553b3e4..1a3eeba6d0c50d4c92d6fcb9f96ad81bce308da5 100644 (file)
@@ -323,6 +323,10 @@ def update_db(conn, elt):
     accessVector = 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']: