浏览代码

cve-update-nvd2-native: Remove rejected CVE from database

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.

(From OE-Core rev: 5b17b563908206667a7d14f390bd9b2de897774c)

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>
Yoann Congal 1 年之前
父节点
当前提交
521775dcd5
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      meta/recipes-core/meta/cve-update-nvd2-native.bb

+ 4 - 0
meta/recipes-core/meta/cve-update-nvd2-native.bb

@@ -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']: