diff --git a/backport-Fix-regression-on-ctrl-c-during-transaction-killing-.patch b/backport-Fix-regression-on-ctrl-c-during-transaction-killing-.patch new file mode 100644 index 0000000..9265e46 --- /dev/null +++ b/backport-Fix-regression-on-ctrl-c-during-transaction-killing-.patch @@ -0,0 +1,36 @@ +From 25c4c61a9599590ce4d610621ff0bffde7ae5e82 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Thu, 3 Mar 2022 10:31:28 +0200 +Subject: [PATCH] Fix regression on ctrl-c during transaction killing + scriptlets + +Commit cb6aa82dbc10d554f8d234e934ae7c77e39a3ce2 unblocked all signals +from scriptlets, but turns out this is too much: SIGINT, SIGTSTP and +SIGQUIT sent from the terminal are passed to the process group, and +with unblocked signals end up killing our scriptlets while rpm itself +continues. -ENOSENSE. + +Stopping (and continuing) is okay though so we don't block that. +--- + lib/rpmscript.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/rpmscript.c b/lib/rpmscript.c +index e123916a9..3d6f3a72c 100644 +--- a/lib/rpmscript.c ++++ b/lib/rpmscript.c +@@ -197,8 +197,10 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes, + int xx; + sigset_t set; + +- /* Unmask all signals, the scripts may need them */ ++ /* Unmask most signals, the scripts may need them */ + sigfillset(&set); ++ sigdelset(&set, SIGINT); ++ sigdelset(&set, SIGQUIT); + sigprocmask(SIG_UNBLOCK, &set, NULL); + + /* SIGPIPE is ignored in rpm, reset to default for the scriptlet */ +-- +2.27.0 + diff --git a/rpm.spec b/rpm.spec index 21886ed..27cf5a2 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.15.1 -Release: 41 +Release: 42 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -183,6 +183,7 @@ Patch163: backport-rpm2cpio.sh-Don-t-drop-newlines-from-header-sizes.patch Patch164: backport-rpm2cpio.sh-strip-null-bytes-with-tr.patch Patch165: backport-rpm2cpio.sh-only-read-needed-bytes-of-file-magic.patch Patch166: backport-Unblock-signals-in-forked-scriptlets.patch +Patch167: backport-Fix-regression-on-ctrl-c-during-transaction-killing-.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 @@ -466,6 +467,12 @@ make check || (cat tests/rpmtests.log; exit 0) %{_mandir}/man1/gendiff.1* %changelog +* Tue Nov 15 2022 renhongxun - 4.15.1-42 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Fix regression on ctrl-c during transaction killing scriptlets + * Mon Nov 14 2022 Chen Xiao - 4.15.1-41 - Type:bugfix - ID:NA