diff --git a/backport-Unblock-signals-in-forked-scriptlets.patch b/backport-Unblock-signals-in-forked-scriptlets.patch new file mode 100644 index 0000000000000000000000000000000000000000..d58ccff74d833a239a3dd9f231b4d5c2c820c2af --- /dev/null +++ b/backport-Unblock-signals-in-forked-scriptlets.patch @@ -0,0 +1,37 @@ +From cb6aa82dbc10d554f8d234e934ae7c77e39a3ce2 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Tue, 12 Jan 2021 13:35:23 +0200 +Subject: [PATCH] Unblock signals in forked scriptlets + +Since commit c5f82d3f6223ebd0c5cc0a07ea60393ae7284929 we've blocked +most signals during transactions, which makes sense to rpm itself but +the signal mask is inherited to childs and carried even across exec(), +so all scriptlets are executing with those signals blocked as well. +Which in turn does not make sense, the scriptlets could run stuff that +actually depends on signal delivery (such as SIGALARM in RhBug:1913765). + +Unblock all signals for forked scriptlet execution (Lua scriptlets are +totally different as they execute in-process for now) +--- + lib/rpmscript.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/rpmscript.c b/lib/rpmscript.c +index 2ae3378f7..c69d29554 100644 +--- a/lib/rpmscript.c ++++ b/lib/rpmscript.c +@@ -152,6 +152,11 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes, + FD_t scriptFd, FD_t out) + { + int xx; ++ sigset_t set; ++ ++ /* Unmask all signals, the scripts may need them */ ++ sigfillset(&set); ++ sigprocmask(SIG_UNBLOCK, &set, NULL); + + /* SIGPIPE is ignored in rpm, reset to default for the scriptlet */ + (void) signal(SIGPIPE, SIG_DFL); +-- +2.27.0 + diff --git a/rpm.spec b/rpm.spec index dbc17db04e4b0d771d3123be069a4382cdb32e0e..21886eda16b4adebfb10a87782e766f599b504bc 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.15.1 -Release: 40 +Release: 41 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -182,6 +182,7 @@ Patch162: backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch 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 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 @@ -465,6 +466,12 @@ make check || (cat tests/rpmtests.log; exit 0) %{_mandir}/man1/gendiff.1* %changelog +* Mon Nov 14 2022 Chen Xiao - 4.15.1-41 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:unblock signals in forked scriptlets. + * Mon Nov 07 2022 renhongxun - 4.15.1-40 - Type:bugfix - ID:NA