sigpipe: init the struct so that first apply ignores

Resolves: RHEL-53327
This commit is contained in:
Jacek Migacz 2024-08-07 16:39:55 +02:00
parent 15f06cda53
commit 5178d7ce56
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From 3eec5afbd0b6377eca893c392569b2faf094d970 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 5 Aug 2024 00:17:17 +0200
Subject: [PATCH] sigpipe: init the struct so that first apply ignores
Initializes 'no_signal' to TRUE, so that a call to sigpipe_apply() after
init ignores the signal (unless CURLOPT_NOSIGNAL) is set.
I have read the existing code multiple times now and I think it gets the
initial state reversed this missing to ignore.
Regression from 17e6f06ea37136c36d27
Reported-by: Rasmus Thomsen
Fixes #14344
Closes #14390
---
lib/sigpipe.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/sigpipe.h b/lib/sigpipe.h
index b91a2f513..d78afd905 100644
--- a/lib/sigpipe.h
+++ b/lib/sigpipe.h
@@ -39,6 +39,7 @@ struct sigpipe_ignore {
static void sigpipe_init(struct sigpipe_ignore *ig)
{
memset(ig, 0, sizeof(*ig));
+ ig->no_signal = TRUE;
}
/*
--
2.45.2

View File

@ -10,6 +10,9 @@ Source1: https://curl.se/download/%{name}-%{version}.tar.xz.asc
# which points to the GPG key as of April 7th 2016 of https://daniel.haxx.se/mykey.asc
Source2: mykey.asc
# fix crashes with transmission due to SIGPIPE
Patch001: 0001-curl-8.9.1-sigpipe-init-the-struct-so-that-first-apply-ignores.patch
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@ -400,6 +403,7 @@ rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mk-ca-bundle.1*
%changelog
* Fri Aug 02 2024 Jacek Migacz <jmigacz@redhat.com> - 8.9.1-2
- add gating configuration (RHEL-52103)
- sigpipe: init the struct so that first apply ignores (RHEL-53327)
* Wed Jul 31 2024 Jacek Migacz <jmigacz@redhat.com> - 8.9.1-1
- new upstream release (RHEL-50806)