From 7b82ccca4313b33d232c4098a59b0bf536109043 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Fri, 9 Dec 2022 14:09:57 +0000 Subject: [PATCH] Auto sync2gitlab import of procps-ng-3.3.15-10.el8.src.rpm --- procps-ng-3.3.15-display-sig-unsafe.patch | 43 +++++++++++++++++++++++ procps-ng.spec | 7 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 procps-ng-3.3.15-display-sig-unsafe.patch diff --git a/procps-ng-3.3.15-display-sig-unsafe.patch b/procps-ng-3.3.15-display-sig-unsafe.patch new file mode 100644 index 0000000..1ab4632 --- /dev/null +++ b/procps-ng-3.3.15-display-sig-unsafe.patch @@ -0,0 +1,43 @@ +diff -up ./ps/display.c.ori ./ps/display.c +--- ./ps/display.c.ori 2018-05-18 23:32:21.998979977 +0200 ++++ ./ps/display.c 2022-11-24 15:11:26.678314866 +0100 +@@ -44,26 +44,31 @@ + #define SIGCHLD SIGCLD + #endif + ++#define SIG_IS_TERM_OR_HUP(signo) (((signo) == SIGTERM) || (signo) == SIGHUP) ++ + char *myname; + + /* just reports a crash */ + static void signal_handler(int signo){ + if(signo==SIGPIPE) _exit(0); /* "ps | head" will cause this */ + /* fprintf() is not reentrant, but we _exit() anyway */ +- fprintf(stderr, +- _("Signal %d (%s) caught by %s (%s).\n"), +- signo, +- signal_number_to_name(signo), +- myname, +- PACKAGE_VERSION +- ); ++ if (!SIG_IS_TERM_OR_HUP(signo)) { ++ fprintf(stderr, ++ _("Signal %d (%s) caught by %s (%s).\n"), ++ signo, ++ signal_number_to_name(signo), ++ myname, ++ PACKAGE_VERSION ++ ); ++ } + switch (signo) { + case SIGHUP: + case SIGUSR1: + case SIGUSR2: + exit(EXIT_FAILURE); + default: +- error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug")); ++ if (!SIG_IS_TERM_OR_HUP(signo)) ++ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug")); + signal(signo, SIG_DFL); /* allow core file creation */ + kill(getpid(), signo); + _exit(EXIT_FAILURE); diff --git a/procps-ng.spec b/procps-ng.spec index a7caab6..061d7f1 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -4,7 +4,7 @@ Summary: System and process monitoring utilities Name: procps-ng Version: 3.3.15 -Release: 9%{?dist} +Release: 10%{?dist} License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ Group: Applications/System URL: https://sourceforge.net/projects/procps-ng/ @@ -25,6 +25,7 @@ Patch6: procps-ng-3.3.15-uptime-pretty-mod.patch Patch7: procps-ng-3.3.15-vmstat-omit-first-report.patch Patch8: procps-ng-3.3.15-sysctl-config-dir-order.patch Patch9: procps-ng-3.3.15-pgrep-uid-gid-overflow.patch +Patch10: procps-ng-3.3.15-display-sig-unsafe.patch BuildRequires: ncurses-devel BuildRequires: libtool @@ -167,6 +168,10 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof %files i18n -f %{name}.lang %changelog +* Wed Nov 23 2022 Jan Rybar - 3.3.15-10 +- display.c: backport: async-signal-unsafe handler deadlocks on SIGHUP +- Resolves: rhbz#2141696 + * Wed Aug 17 2022 Jan Rybar - 3.3.15-9 - pgrep: backport uid/gid overflow fix - Resolves: rhbz#1827731