From d4673e7dddf2711c4cde6961d25404af21ada38d9efecec43a02fbbcdd354dc5 Mon Sep 17 00:00:00 2001 From: Marcus Schaefer Date: Tue, 23 Jul 2013 09:05:43 +0000 Subject: [PATCH 1/2] - ping denpend on SIGALRM to exit sometime, so we mask it UNBLOCK (bnc #674304) OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=30 --- iputils-s20101006-sec-ping-unblock.diff | 19 +++++++++++++++++++ iputils.changes | 5 +++++ iputils.spec | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 iputils-s20101006-sec-ping-unblock.diff diff --git a/iputils-s20101006-sec-ping-unblock.diff b/iputils-s20101006-sec-ping-unblock.diff new file mode 100644 index 0000000..08ffb46 --- /dev/null +++ b/iputils-s20101006-sec-ping-unblock.diff @@ -0,0 +1,19 @@ +--- ping.c 2013-07-23 11:02:26.364843595 +0200 ++++ ping.c 2013-07-23 11:02:32.740900627 +0200 +@@ -129,6 +129,16 @@ + cap_t caps; + #endif + ++ /* ++ * 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; + diff --git a/iputils.changes b/iputils.changes index 51aa5b3..aa4c802 100644 --- a/iputils.changes +++ b/iputils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 23 11:04:46 CEST 2013 - ms@suse.de + +- ping denpend on SIGALRM to exit sometime, so we mask it UNBLOCK (bnc #674304) + ------------------------------------------------------------------- Fri Mar 8 03:27:28 UTC 2013 - crrodriguez@opensuse.org diff --git a/iputils.spec b/iputils.spec index 524eb68..3b94762 100644 --- a/iputils.spec +++ b/iputils.spec @@ -42,6 +42,7 @@ Patch2: iputils-traceroute6-stdint.diff Patch3: iputils-ifenslave.diff Patch6: iputils-s20101006-capabilities.diff Patch7: iputils-pingtypo.diff +Patch8: iputils-s20101006-sec-ping-unblock.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: permissions @@ -59,6 +60,7 @@ cp -a %SOURCE1 . #patch5 %patch6 -p1 %patch7 +%patch8 mkdir linux touch linux/autoconf.h From e0818bf09569e3597eb4da138bd840be755aab17828b9dc631c756b8f62b6cec Mon Sep 17 00:00:00 2001 From: Marcus Schaefer Date: Tue, 23 Jul 2013 09:17:26 +0000 Subject: [PATCH 2/2] - follow up patch for UNBLOCK mask OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=31 --- iputils-s20101006-ping-interrupt.diff | 29 +++++++++++++++++++++++++++ iputils.spec | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 iputils-s20101006-ping-interrupt.diff diff --git a/iputils-s20101006-ping-interrupt.diff b/iputils-s20101006-ping-interrupt.diff new file mode 100644 index 0000000..02f5bb3 --- /dev/null +++ b/iputils-s20101006-ping-interrupt.diff @@ -0,0 +1,29 @@ +--- ping.c 2013-07-23 11:15:15.851715020 +0200 ++++ ping.c 2013-07-23 11:15:28.075824028 +0200 +@@ -103,6 +103,7 @@ + static u_short in_cksum(const u_short *addr, int len, u_short salt); + static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp); + static int parsetos(char *str); ++static void doexit (int); + + static struct { + struct cmsghdr cm; +@@ -266,6 +267,8 @@ + options |= F_SOURCEROUTE; + } + } ++ set_signal(SIGINT, doexit); ++ + while (argc > 0) { + target = *argv; + +@@ -1273,3 +1276,9 @@ + " [-T tstamp-options] [-Q tos] [hop1 ...] destination\n"); + exit(2); + } ++ ++static void doexit(int signo) ++{ ++ exit (1); ++} ++ diff --git a/iputils.spec b/iputils.spec index 3b94762..2474c1c 100644 --- a/iputils.spec +++ b/iputils.spec @@ -43,6 +43,7 @@ Patch3: iputils-ifenslave.diff Patch6: iputils-s20101006-capabilities.diff Patch7: iputils-pingtypo.diff Patch8: iputils-s20101006-sec-ping-unblock.diff +Patch9: iputils-s20101006-ping-interrupt.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: permissions @@ -61,6 +62,7 @@ cp -a %SOURCE1 . %patch6 -p1 %patch7 %patch8 +%patch9 mkdir linux touch linux/autoconf.h