From: Ross Burton Date: Wed, 23 Feb 2022 12:54:31 +0000 (+0000) Subject: cve-check: get_cve_info should open the database read-only X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~5097 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8de517238f1f418d9af1ce312d99de04ce2e26fc;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git cve-check: get_cve_info should open the database read-only All of the function in cve-check should open the database read-only, as the only writer is the fetch task in cve-update-db. However, get_cve_info() was failing to do this, which might be causing locking issues with sqlite. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index 2d69aeba4ba..d715fbf4d8a 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass @@ -265,7 +265,8 @@ def get_cve_info(d, cves): import sqlite3 cve_data = {} - conn = sqlite3.connect(d.getVar("CVE_CHECK_DB_FILE")) + db_file = d.expand("file:${CVE_CHECK_DB_FILE}?mode=ro") + conn = sqlite3.connect(db_file, uri=True) for cve in cves: for row in conn.execute("SELECT * FROM NVD WHERE ID IS ?", (cve,)):