summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2024-03-15 01:20:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-03-15 07:36:11 +0000
commit641ae3f36e09af9932dc33043a0a5fbfce62122e (patch)
treeccd99b84b40f75dc67596dec3202c2c0f0ada979 /meta/recipes-core
parente0157b3b81333a24abd31dbb23a6abebca3e7ba7 (diff)
downloadopenembedded-core-641ae3f36e09af9932dc33043a0a5fbfce62122e.tar.gz
cve-update-nvd2-native: Fix CVE configuration update
When a CVE is created, it often has no precise version information and this is stored as "-" (matching any version). After an update, version information is added. The previous "-" must be removed, otherwise, the CVE is still "Unpatched" for cve-check. Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/meta/cve-update-nvd2-native.bb4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb
index 5bba2219d6..4b8d01fe84 100644
--- a/meta/recipes-core/meta/cve-update-nvd2-native.bb
+++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb
@@ -357,6 +357,10 @@ def update_db(conn, elt):
[cveId, cveDesc, cvssv2, cvssv3, date, accessVector, vectorString]).close()
try:
+ # Remove any pre-existing CVE configuration. Even for partial database
+ # update, those will be repopulated. This ensures that old
+ # configuration is not kept for an updated CVE.
+ conn.execute("delete from PRODUCTS where ID = ?", [cveId]).close()
for config in elt['cve']['configurations']:
# This is suboptimal as it doesn't handle AND/OR and negate, but is better than nothing
for node in config["nodes"]: