Revert back to implicit database creation for now

This commit is contained in:
renxichen 2023-02-22 15:39:37 +08:00
parent aec68b08e0
commit 08fa7119f1
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,49 @@
From 4d04e84ac4421bc3d9c2f9572a10c7980ff8d43f Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 26 Apr 2021 10:43:47 +0300
Subject: [PATCH] Revert back to implicit database creation for now
The implicit database creation even on read-only access is rooted so
deep in so many places that this needs more thought and saner APIs.
While creating databases on read-only access remains a crazy thing to
do, we need to have a proper solution to point people to when changing
the behavior, and right now we don't.
This effectively reverts 86f593d5135b00a9dbf7dc6d5efc8b341002aa08,
d601a7b7ae764b31ad74b2dceff1eafb5297147f and
afbc2b07839c9ffe9f274f3a4bc2395c76d65472, but adopting 4.16.x version
of the sqlite open error message to avoid accessing freed handle, and
leaving the testcase for query on non-existent db in place (just
changing the expected result) as this is a rather fundamental behavior
thing.
---
lib/depends.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/lib/depends.c b/lib/depends.c
index cae0a9a..dce614a 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -4,8 +4,6 @@
#include "system.h"
-#include <fcntl.h>
-
#include <rpm/rpmlib.h> /* rpmVersionCompare, rpmlib provides */
#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
@@ -418,10 +416,6 @@ static int addPackage(rpmts ts, Header h,
if (isSource)
op = RPMTE_INSTALL;
- /* Ensure database creation on initial installs */
- if (!isSource && rpmtsGetDBMode(ts) == O_RDONLY)
- rpmtsSetDBMode(ts, (O_RDWR|O_CREAT));
-
/* Do lazy (readonly?) open of rpm database for upgrades. */
if (op != RPMTE_INSTALL && rpmtsGetRdb(ts) == NULL && rpmtsGetDBMode(ts) != -1) {
if ((ec = rpmtsOpenDB(ts, rpmtsGetDBMode(ts))) != 0)
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.15.1
Release: 45
Release: 46
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -194,6 +194,8 @@ Patch174: backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
Patch175: Change-log-level-when-deal-with-digest-list-process.patch
Patch176: backport-Revert-back-to-implicit-database-creation-for-now.patch
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel libdb-devel
BuildRequires: zlib-devel libzstd-devel xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
BuildRequires: dbus-devel fakechroot elfutils-devel elfutils-libelf-devel ima-evm-utils
@ -476,6 +478,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Wed Feb 22 2023 renhongxun<renhongxun@h-partners.com> - 4.15.1-46
- Revert back to implicit database creation for now
* Sat Feb 18 2023 zcfsite<zhchf2010@126.com> - 4.15.1-45
- DESC:Change log level when deal with digest list process