summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2023-07-03 14:59:08 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-10 11:36:34 +0100
commit817937f57e98193834c9c6ef42c81f27e80d08ff (patch)
treeb77f97b1232cf985aa5aef9f5fa3f183adbba8ae /meta/recipes-devtools/rpm
parentbd530bd3dcebd2efe9584ab6f836dd2284f1c550 (diff)
downloadpoky-817937f57e98193834c9c6ef42c81f27e80d08ff.tar.gz
rpm: backport fix to prevent crashes with latest sqlite
SQLite 3.42.0 causes crashes when installing RPM packages at rootfs creation time. Backport an upstream fix to resolve the issue. (From OE-Core rev: f6e4227efb29ed9b1680a1c516e4487804f6e64c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r--meta/recipes-devtools/rpm/files/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch51
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.18.1.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch b/meta/recipes-devtools/rpm/files/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch
new file mode 100644
index 0000000000..470dda1dcf
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch
@@ -0,0 +1,51 @@
1From ea3187cfcf9cac87e5bc5e7db79b0338da9e355e Mon Sep 17 00:00:00 2001
2From: Panu Matilainen <pmatilai@redhat.com>
3Date: Mon, 26 Jun 2023 12:45:09 +0300
4Subject: [PATCH] Don't muck with per-process global sqlite configuration from
5 the db backend
6
7sqlite3_config() affects all in-process uses of sqlite. librpm being a
8low-level library, it has no business whatsoever making such decisions
9for the applications running on top of it. Besides that, the callback can
10easily end up pointing to an already closed database, causing an
11innocent API user to crash in librpm on an entirely unrelated error on
12some other database. "Oops."
13
14The sqlite API doesn't seem to provide any per-db or non-global context
15for logging errors, thus we can only remove the call and let sqlite output
16errors the way it pleases (print through stderr, presumably).
17
18Thanks to Jan Palus for spotting and reporting!
19
20Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e]
21Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
22---
23 lib/backend/sqlite.c | 8 --------
24 1 file changed, 8 deletions(-)
25
26diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c
27index 5a029d575a..b612732267 100644
28--- a/lib/backend/sqlite.c
29+++ b/lib/backend/sqlite.c
30@@ -44,13 +44,6 @@ static void rpm_match3(sqlite3_context *sctx, int argc, sqlite3_value **argv)
31 sqlite3_result_int(sctx, match);
32 }
33
34-static void errCb(void *data, int err, const char *msg)
35-{
36- rpmdb rdb = data;
37- rpmlog(RPMLOG_WARNING, "%s: %s: %s\n",
38- rdb->db_descr, sqlite3_errstr(err), msg);
39-}
40-
41 static int dbiCursorReset(dbiCursor dbc)
42 {
43 if (dbc->stmt) {
44@@ -170,7 +163,6 @@ static int sqlite_init(rpmdb rdb, const char * dbhome)
45 * the "database is locked" errors at every cost
46 */
47 sqlite3_busy_timeout(sdb, 10000);
48- sqlite3_config(SQLITE_CONFIG_LOG, errCb, rdb);
49
50 sqlexec(sdb, "PRAGMA secure_delete = OFF");
51 sqlexec(sdb, "PRAGMA case_sensitive_like = ON");
diff --git a/meta/recipes-devtools/rpm/rpm_4.18.1.bb b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
index 83537d4761..95a9e92f96 100644
--- a/meta/recipes-devtools/rpm/rpm_4.18.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
@@ -39,6 +39,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protoc
39 file://0001-configure.ac-add-linux-gnux32-variant-to-triplet-han.patch \ 39 file://0001-configure.ac-add-linux-gnux32-variant-to-triplet-han.patch \
40 file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \ 40 file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \
41 file://fix-declaration.patch \ 41 file://fix-declaration.patch \
42 file://ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch \
42 " 43 "
43 44
44PE = "1" 45PE = "1"