diff --git a/0001-lib-tevent-a-cleaner-fix-for-be4ac227842530d484659f.patch b/0001-lib-tevent-a-cleaner-fix-for-be4ac227842530d484659f.patch deleted file mode 100644 index 42656f4..0000000 --- a/0001-lib-tevent-a-cleaner-fix-for-be4ac227842530d484659f.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 455d44d9618afdc1d1f4198ae9f64ccc56dee62f Mon Sep 17 00:00:00 2001 -From: Rusty Russell -Date: Tue, 22 Sep 2009 10:32:10 +0930 -Subject: [PATCH] lib/tevent: a cleaner fix for be4ac227842530d484659f2db683453366326d8b segv - -Revert 23abcd2318c69753aa2a144e1dc0f9cf9efdb705 and fix logic bug. - -The current code loops through the event contexts, when it sees a different -one, it notifies the current one (ev) and updates ev to point to the new one. - -This is dumb, because: -(1) ev starts as NULL, so this code crashes, and -(2) The final context will not be notified. - -The correct fix for this is to update ev to the new one, then notify it. -Volker's fix works because we currently always have one event context. - -Signed-off-by: Rusty Russell ---- - lib/tevent/tevent_signal.c | 8 +------- - 1 files changed, 1 insertions(+), 7 deletions(-) - -diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c -index 0ca2a27..d3325b6 100644 ---- a/lib/tevent/tevent_signal.c -+++ b/lib/tevent/tevent_signal.c -@@ -90,18 +90,12 @@ static void tevent_common_signal_handler(int signum) - SIG_INCREMENT(sig_state->signal_count[signum]); - SIG_INCREMENT(sig_state->got_signal); - -- if (sig_state->sig_handlers[signum] != NULL) { -- ev = sig_state->sig_handlers[signum]->se->event_ctx; -- /* doesn't matter if this pipe overflows */ -- res = write(ev->pipe_fds[1], &c, 1); -- } -- - /* Write to each unique event context. */ - for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) { - if (sl->se->event_ctx != ev) { -+ ev = sl->se->event_ctx; - /* doesn't matter if this pipe overflows */ - res = write(ev->pipe_fds[1], &c, 1); -- ev = sl->se->event_ctx; - } - } - --- -1.6.2.5 - diff --git a/libtevent.spec b/libtevent.spec index 5b17199..5ef049c 100644 --- a/libtevent.spec +++ b/libtevent.spec @@ -1,6 +1,6 @@ Name: libtevent Version: 0.9.8 -Release: 4%{?dist} +Release: 5%{?dist} Group: System Environment/Daemons Summary: The tevent library License: LGPLv3+ @@ -10,7 +10,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Patch1: tevent-098-add_abi_scripts_and_fix_exports.patch Patch2: tevent-098-abi-compat.patch -Patch3: 0001-lib-tevent-a-cleaner-fix-for-be4ac227842530d484659f.patch +Patch3: tevent_signal_segfault.patch BuildRequires: libtalloc-devel >= 2.0.0 @@ -70,7 +70,7 @@ rm -rf $RPM_BUILD_ROOT %postun -p /sbin/ldconfig %changelog -* Wed Sep 23 2009 Simo Sorce - 0.9.8-4 +* Wed Sep 23 2009 Simo Sorce - 0.9.8-5 - Add patch to fix a segfault case * Wed Sep 16 2009 Simo Sorce - 0.9.8-2 diff --git a/tevent_signal_segfault.patch b/tevent_signal_segfault.patch new file mode 100644 index 0000000..b31101a --- /dev/null +++ b/tevent_signal_segfault.patch @@ -0,0 +1,23 @@ +diff -uPr tevent-0.9.8.orig/tevent_signal.c tevent-0.9.8/tevent_signal.c +--- tevent-0.9.8.orig/tevent_signal.c 2009-09-23 12:41:48.000000000 -0400 ++++ tevent-0.9.8/tevent_signal.c 2009-09-23 12:42:25.000000000 -0400 +@@ -89,18 +89,12 @@ + SIG_INCREMENT(sig_state->signal_count[signum]); + SIG_INCREMENT(sig_state->got_signal); + +- if (sig_state->sig_handlers[signum] != NULL) { +- ev = sig_state->sig_handlers[signum]->se->event_ctx; +- /* doesn't matter if this pipe overflows */ +- res = write(ev->pipe_fds[1], &c, 1); +- } +- + /* Write to each unique event context. */ + for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) { + if (sl->se->event_ctx != ev) { ++ ev = sl->se->event_ctx; + /* doesn't matter if this pipe overflows */ + res = write(ev->pipe_fds[1], &c, 1); +- ev = sl->se->event_ctx; + } + } + }