public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: - fix signal blocking/unblocking regression on rpmdb open/close (#739492)
@ 2026-11-23  9:27 Panu Matilainen
  0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23  9:27 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 0d72de20ce98ddea69c0e8b0b4500912af8954ff
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2011-09-19T13:09:38+03:00
Stats  : +61/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/0d72de20ce98ddea69c0e8b0b4500912af8954ff?branch=pmatilai-v6

Log:
- fix signal blocking/unblocking regression on rpmdb open/close (#739492)

---
diff --git a/rpm-4.9.1-rpmdb-signals.patch b/rpm-4.9.1-rpmdb-signals.patch
new file mode 100644
index 0000000..cb36154
--- /dev/null
+++ b/rpm-4.9.1-rpmdb-signals.patch
@@ -0,0 +1,54 @@
+commit 36f6874fcf5222f4553fb5b7782af18c7b6ea92a
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Fri Apr 15 09:18:15 2011 +0300
+
+    Only muck with signals on first and last db open/close
+    - Signals are per-process global, as long as there are other
+      databases open (or references to the same db) we shouldn't mess
+      with them. Less important on open, but if somebody is changing
+      rpmsq-handling we shouldn't override that either.
+    (cherry picked from commit dcf650f5a73846773c7b81de08e2608391f733b8)
+
+diff --git a/lib/rpmdb.c b/lib/rpmdb.c
+index 50bb6b1..44cdb2b 100644
+--- a/lib/rpmdb.c
++++ b/lib/rpmdb.c
+@@ -661,12 +661,14 @@ int rpmdbClose(rpmdb db)
+ 
+     db = _free(db);
+ 
++    if (rpmdbRock == NULL) {
++	(void) rpmsqEnable(-SIGHUP, NULL);
++	(void) rpmsqEnable(-SIGINT, NULL);
++	(void) rpmsqEnable(-SIGTERM, NULL);
++	(void) rpmsqEnable(-SIGQUIT, NULL);
++	(void) rpmsqEnable(-SIGPIPE, NULL);
++    }
+ exit:
+-    (void) rpmsqEnable(-SIGHUP,	NULL);
+-    (void) rpmsqEnable(-SIGINT,	NULL);
+-    (void) rpmsqEnable(-SIGTERM,NULL);
+-    (void) rpmsqEnable(-SIGQUIT,NULL);
+-    (void) rpmsqEnable(-SIGPIPE,NULL);
+     return rc;
+ }
+ 
+@@ -728,11 +730,13 @@ static int openDatabase(const char * prefix,
+     /* 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 (rpmdbRock == NULL) {
++	    (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;

diff --git a/rpm.spec b/rpm.spec
index 0a9f39d..5bcf87c 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}2%{?dist}
+Release: %{?snapver:0.%{snapver}.}3%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.9.x/%{name}-%{srcver}.tar.bz2
@@ -40,6 +40,7 @@ Patch3: rpm-4.8.0-no-man-dirs.patch
 Patch4: rpm-4.8.1-use-gpg2.patch
 
 # Patches already in upstream
+Patch100: rpm-4.9.1-rpmdb-signals.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -209,6 +210,8 @@ packages on a system.
 %patch3 -p1 -b .no-man-dirs
 %patch4 -p1 -b .use-gpg2
 
+%patch100 -p1 -b .rpmdb-signals
+
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
 %patch303 -p1 -b .debuginfo-allnames
@@ -426,6 +429,9 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
+* Mon Sep 19 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.1.1-3
+- fix signal blocking/unblocking regression on rpmdb open/close (#739492)
+
 * Mon Aug 08 2011 Adam Jackson <ajax@redhat.com> 4.9.1.1-2
 - Add RPM_LD_FLAGS to build environment (#728974)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:27 [rpms/rpm] pmatilai-v6: - fix signal blocking/unblocking regression on rpmdb open/close (#739492) Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox