iputils/iputils-s20101006-sec-ping-unblock.diff
Andreas Stieger d8dca9d3c3 Accepting request 215034 from home:hreinecke:branches:network:utilities
- Update to upstream version s20121221 (FATE#316211)
  - See RELNOTES for full changelog
- Removed merges patches:
  * iputils-pingtypo.diff
  * iputils-s20101006-capabilities.diff
- Updated patches for apply
- Remove libsysfs dependency (FATE#316211)

OBS-URL: https://build.opensuse.org/request/show/215034
OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=35
2014-01-25 14:10:50 +00:00

42 lines
1020 B
Diff

From bf83678619dd0286f7a66f2ab02763751b0e8ca9 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Mon, 26 Aug 2013 13:02:36 +0200
Subject: Block SIGALRM in ping.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ping depends on SIGALRM to exit eventually, so we need to mask
it with UNBLOCK.
Signed-off-by: Marcus Schäfer <ms@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
ping.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ping.c b/ping.c
index 71b445d..0357c3d 100644
--- a/ping.c
+++ b/ping.c
@@ -139,6 +139,16 @@ main(int argc, char **argv)
enable_capability_raw();
+ /*
+ * ping depend on SIGALARM to exit sometimes,
+ * but to popen, system, fork carry on parent signal handler
+ * so we mask it ourself.
+ */
+ sigset_t s;
+ sigaddset(&s, SIGALRM);
+ sigprocmask(SIG_UNBLOCK, &s, NULL);
+ set_signal(SIGALRM, doexit);
+
icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
socket_errno = errno;
--
1.8.1.4