2011-05-16 18:07:44 +02:00
|
|
|
Do not block signals if the database is opened read-only, it just
|
2006-12-19 00:17:44 +01:00
|
|
|
annoys the users. [#48026]
|
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./lib/rpmdb.c.orig 2011-02-28 09:57:27.000000000 +0000
|
|
|
|
+++ ./lib/rpmdb.c 2011-05-10 16:58:21.000000000 +0000
|
|
|
|
@@ -623,10 +623,12 @@ int rpmdbClose(rpmdb db)
|
|
|
|
{
|
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)
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -655,11 +657,13 @@ int rpmdbClose(rpmdb db)
|
|
|
|
db = _free(db);
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
exit:
|
|
|
|
- (void) rpmsqEnable(-SIGHUP, NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGINT, NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGTERM,NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGQUIT,NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGPIPE,NULL);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ if ((dbmode & (O_RDWR|O_WRONLY)) != 0) {
|
|
|
|
+ (void) rpmsqEnable(-SIGHUP, NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGINT, NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGTERM,NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGQUIT,NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGPIPE,NULL);
|
|
|
|
+ }
|
|
|
|
return rc;
|
|
|
|
}
|
2009-08-28 15:54:03 +02:00
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -721,11 +725,13 @@ static int openDatabase(const char * pre
|
|
|
|
/* Try to ensure db home exists, error out if we cant even create */
|
|
|
|
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
|
|
|
|
if (rc == 0) {
|
|
|
|
- (void) rpmsqEnable(SIGHUP, NULL);
|
|
|
|
- (void) rpmsqEnable(SIGINT, NULL);
|
|
|
|
- (void) rpmsqEnable(SIGTERM,NULL);
|
|
|
|
- (void) rpmsqEnable(SIGQUIT,NULL);
|
|
|
|
- (void) rpmsqEnable(SIGPIPE,NULL);
|
|
|
|
+ if ((db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
|
|
|
|
+ (void) rpmsqEnable(SIGHUP, NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGINT, NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGTERM,NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGQUIT,NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGPIPE,NULL);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/* Just the primary Packages database opened here */
|
|
|
|
rc = (rpmdbOpenIndex(db, RPMDBI_PACKAGES, db->db_flags) != NULL) ? 0 : -2;
|