2013-07-12 16:11:14 +02:00
|
|
|
--- ./lib/rpmdb.c.orig 2013-06-10 15:55:10.000000000 +0000
|
|
|
|
+++ ./lib/rpmdb.c 2013-07-12 11:28:22.000000000 +0000
|
|
|
|
@@ -730,10 +730,12 @@ 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;
|
2011-05-16 18:07:44 +02:00
|
|
|
(void) rpmdbUnlink(db);
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2009-08-28 15:54:03 +02:00
|
|
|
if (db->nrefs > 0)
|
2013-07-12 16:11:14 +02:00
|
|
|
@@ -761,7 +763,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) {
|
|
|
|
(void) rpmsqEnable(-SIGHUP, NULL);
|
|
|
|
(void) rpmsqEnable(-SIGINT, NULL);
|
|
|
|
(void) rpmsqEnable(-SIGTERM, NULL);
|
2013-07-12 16:11:14 +02:00
|
|
|
@@ -830,7 +832,7 @@ static int openDatabase(const char * pre
|
|
|
|
/* Try to ensure db home exists, error out if we can't even create */
|
2011-05-16 18:07:44 +02:00
|
|
|
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
|
|
|
|
if (rc == 0) {
|
2011-10-19 18:38:28 +02:00
|
|
|
- if (rpmdbRock == NULL) {
|
|
|
|
+ if (rpmdbRock == NULL && (db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
|
|
|
|
(void) rpmsqEnable(SIGHUP, NULL);
|
|
|
|
(void) rpmsqEnable(SIGINT, NULL);
|
|
|
|
(void) rpmsqEnable(SIGTERM, NULL);
|