From 51c130e9a289a0b4a4930b6e7028f7d0213dc758 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 9 Jul 2023 11:47:01 +0200 Subject: [PATCH] - merged PLD changes --- rpm.spec | 7 ++++-- sqlite-log-crash.patch | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 sqlite-log-crash.patch diff --git a/rpm.spec b/rpm.spec index 5ef7409..f1c4b4a 100644 --- a/rpm.spec +++ b/rpm.spec @@ -34,14 +34,14 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM Summary(uk.UTF-8): Менеджер пакетів від RPM Name: rpm Version: 4.17.1.1 -Release: 3 +Release: 5 Epoch: 1 License: GPL v2 / LGPL v2.1 Group: Base Source0: http://ftp.rpm.org/releases/rpm-4.17.x/%{name}-%{version}.tar.bz2 # Source0-md5: 30e5806bdcb06a17cabf23d8f07b6b0f Source1: https://ftp.tld-linux.org/TLD/TLD-Linux.asc -# Source1-md5: 5b5caff8c570489ad5bf950734546c24 +# Source1-md5: 23914bb49fafe7153cee87126d966461 Source2: macros.local Source3: macros.lang Source4: %{name}.sysconfig @@ -94,6 +94,7 @@ Patch35: pl-po.patch Patch36: build-locale.patch Patch37: no-exe-for-elf-req.patch Patch38: gem-in-package-builddir.patch +Patch39: sqlite-log-crash.patch URL: https://rpm.org/ BuildRequires: acl-devel %{?with_audit:BuildRequires: audit-libs-devel} @@ -275,6 +276,7 @@ Requires: bzip2-devel Requires: elfutils-devel >= 0.159 Requires: libcap-devel Requires: libgcrypt-devel +Requires: libgomp-devel >= 6:4.5 Requires: libmagic-devel %if %{with selinux} Requires: libselinux-devel @@ -672,6 +674,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze %patch36 -p1 %patch37 -p1 %patch38 -p1 +%patch39 -p1 %{__rm} po/*.gmo diff --git a/sqlite-log-crash.patch b/sqlite-log-crash.patch new file mode 100644 index 0000000..87137f5 --- /dev/null +++ b/sqlite-log-crash.patch @@ -0,0 +1,48 @@ +From ea3187cfcf9cac87e5bc5e7db79b0338da9e355e Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Mon, 26 Jun 2023 12:45:09 +0300 +Subject: [PATCH] Don't muck with per-process global sqlite configuration from + the db backend + +sqlite3_config() affects all in-process uses of sqlite. librpm being a +low-level library, it has no business whatsoever making such decisions +for the applications running on top of it. Besides that, the callback can +easily end up pointing to an already closed database, causing an +innocent API user to crash in librpm on an entirely unrelated error on +some other database. "Oops." + +The sqlite API doesn't seem to provide any per-db or non-global context +for logging errors, thus we can only remove the call and let sqlite output +errors the way it pleases (print through stderr, presumably). + +Thanks to Jan Palus for spotting and reporting! +--- + lib/backend/sqlite.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c +index 5a029d575a..b612732267 100644 +--- a/lib/backend/sqlite.c ++++ b/lib/backend/sqlite.c +@@ -44,13 +44,6 @@ static void rpm_match3(sqlite3_context *sctx, int argc, sqlite3_value **argv) + sqlite3_result_int(sctx, match); + } + +-static void errCb(void *data, int err, const char *msg) +-{ +- rpmdb rdb = data; +- rpmlog(RPMLOG_WARNING, "%s: %s: %s\n", +- rdb->db_descr, sqlite3_errstr(err), msg); +-} +- + static int dbiCursorReset(dbiCursor dbc) + { + if (dbc->stmt) { +@@ -170,7 +163,6 @@ static int sqlite_init(rpmdb rdb, const char * dbhome) + * the "database is locked" errors at every cost + */ + sqlite3_busy_timeout(sdb, 10000); +- sqlite3_config(SQLITE_CONFIG_LOG, errCb, rdb); + + sqlexec(sdb, "PRAGMA secure_delete = OFF"); + sqlexec(sdb, "PRAGMA case_sensitive_like = ON"); -- 2.46.0