2020-10-27 11:36:01 +01:00
|
|
|
--- ./lib/rpmdb.c.orig 2020-05-28 10:04:25.037136686 +0000
|
|
|
|
+++ ./lib/rpmdb.c 2020-09-30 12:23:50.708547165 +0000
|
2017-12-05 11:46:24 +01:00
|
|
|
@@ -387,9 +387,11 @@ int rpmdbClose(rpmdb db)
|
2011-05-16 18:07:44 +02:00
|
|
|
{
|
2006-12-19 00:17:44 +01:00
|
|
|
rpmdb * prev, next;
|
|
|
|
int rc = 0;
|
|
|
|
+ int dbmode;
|
|
|
|
|
|
|
|
if (db == NULL)
|
|
|
|
goto exit;
|
|
|
|
+ dbmode = db->db_mode;
|
|
|
|
|
2017-01-19 16:41:55 +01:00
|
|
|
prev = &rpmdbRock;
|
|
|
|
while ((next = *prev) != NULL && next != db)
|
2020-10-27 11:36:01 +01:00
|
|
|
@@ -423,7 +425,7 @@ int rpmdbClose(rpmdb db)
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2011-10-19 18:38:28 +02:00
|
|
|
db = _free(db);
|
2009-08-28 15:54:03 +02:00
|
|
|
|
2011-10-19 18:38:28 +02:00
|
|
|
- if (rpmdbRock == NULL) {
|
|
|
|
+ if (rpmdbRock == NULL && (dbmode & (O_RDWR|O_WRONLY)) != 0) {
|
2017-12-05 11:46:24 +01:00
|
|
|
rpmsqActivate(0);
|
|
|
|
}
|
|
|
|
exit:
|
2020-10-27 11:36:01 +01:00
|
|
|
@@ -510,7 +512,7 @@ static int openDatabase(const char * pre
|
|
|
|
int justPkgs = (db->db_flags & RPMDB_FLAG_REBUILD) &&
|
|
|
|
((db->db_mode & O_ACCMODE) == O_RDONLY);
|
2018-10-16 11:54:56 +02:00
|
|
|
/* Enable signal queue on the first db open */
|
|
|
|
- if (db->db_next == NULL) {
|
|
|
|
+ if (db->db_next == NULL && (db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
|
2017-12-05 11:46:24 +01:00
|
|
|
rpmsqActivate(1);
|
|
|
|
}
|
|
|
|
|