Handle SIGPIPE as a fatal signal

Backport of upstream commit 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74
Remove after 4.4.1 or later
This commit is contained in:
DJ Delorie 2023-01-30 17:31:30 -05:00
parent 9099b69d72
commit d82cede64b
2 changed files with 41 additions and 1 deletions

33
make-4.4-sigpipe.patch Normal file
View File

@ -0,0 +1,33 @@
From 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 Mon Sep 17 00:00:00 2001
From: Paul Smith <psmith@gnu.org>
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);

View File

@ -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 <dj@redhat.com> - 1:4.4-3
- Handle SIGPIPE as a fatal signal
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild