From d82cede64b2717df5630b099d5e05d8f74d25fca Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Jan 30 2023 22:31:30 +0000 Subject: Handle SIGPIPE as a fatal signal Backport of upstream commit 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 Remove after 4.4.1 or later --- diff --git a/make-4.4-sigpipe.patch b/make-4.4-sigpipe.patch new file mode 100644 index 0000000..380f7ee --- /dev/null +++ b/make-4.4-sigpipe.patch @@ -0,0 +1,33 @@ +From 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 Mon Sep 17 00:00:00 2001 +From: Paul Smith +Date: Sun, 6 Nov 2022 15:22:02 -0500 +Subject: * src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal + +Always ignoring SIGPIPE is visible to child processes. + +diff --git a/src/main.c b/src/main.c +index eec93656..f2caf7a8 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1182,11 +1182,6 @@ main (int argc, char **argv, char **envp) + /* Useful for attaching debuggers, etc. */ + SPIN ("main-entry"); + +- /* Don't die if our stdout sends us SIGPIPE. */ +-#ifdef SIGPIPE +- bsd_signal (SIGPIPE, SIG_IGN); +-#endif +- + #ifdef HAVE_ATEXIT + if (ANY_SET (check_io_state (), IO_STDOUT_OK)) + atexit (close_stdout); +@@ -1264,6 +1259,9 @@ main (int argc, char **argv, char **envp) + #endif + #ifdef SIGQUIT + FATAL_SIG (SIGQUIT); ++#endif ++#ifdef SIGPIPE ++ FATAL_SIG (SIGPIPE); + #endif + FATAL_SIG (SIGINT); + FATAL_SIG (SIGTERM); diff --git a/make.spec b/make.spec index 4a169b0..6d181f2 100644 --- a/make.spec +++ b/make.spec @@ -5,7 +5,7 @@ Name: make Epoch: 1 Version: 4.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/make/ Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.gz @@ -44,6 +44,10 @@ Patch1: make-4.0-noclock_gettime.patch # BZs #142691, #17374 Patch2: make-4.3-j8k.patch +# Upstream commit 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 +# Remove for 4.4.1 or later +Patch3: make-4.4-sigpipe.patch + # autoreconf BuildRequires: make BuildRequires: autoconf, automake, gettext-devel @@ -134,6 +138,9 @@ echo ============END TESTING=========== %{_includedir}/gnumake.h %changelog +* Mon Jan 30 2023 DJ Delorie - 1:4.4-3 +- Handle SIGPIPE as a fatal signal + * Thu Jan 19 2023 Fedora Release Engineering - 1:4.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild