From 132c66bd394dbb278f19a62153f19adf3eedbc3f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 18 2017 14:35:19 +0000 Subject: import libqb-1.0-1.el7_3.1 --- diff --git a/SOURCES/bz1437023-ipc-detect-corrupt-shm-in-peek.patch b/SOURCES/bz1437023-ipc-detect-corrupt-shm-in-peek.patch new file mode 100644 index 0000000..d056672 --- /dev/null +++ b/SOURCES/bz1437023-ipc-detect-corrupt-shm-in-peek.patch @@ -0,0 +1,31 @@ +diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c +index db842ce..6badb6a 100644 +--- a/lib/ringbuffer.c ++++ b/lib/ringbuffer.c +@@ -650,7 +650,11 @@ qb_rb_chunk_peek(struct qb_ringbuffer_s * rb, void **data_out, int32_t timeout) + if (rb->notifier.post_fn) { + (void)rb->notifier.post_fn(rb->notifier.instance, res); + } +- return 0; ++#ifdef EBADMSG ++ return -EBADMSG; ++#else ++ return -EINVAL; ++#endif + } + chunk_size = QB_RB_CHUNK_SIZE_GET(rb, read_pt); + *data_out = QB_RB_CHUNK_DATA_GET(rb, read_pt); +diff --git a/tests/check_rb.c b/tests/check_rb.c +index c77f360..abe3987 100644 +--- a/tests/check_rb.c ++++ b/tests/check_rb.c +@@ -178,7 +178,8 @@ START_TEST(test_ring_buffer4) + } + for (i = 0; i < 2000; i++) { + l = qb_rb_chunk_peek(t, (void **)&new_data, 0); +- if (l == 0) { ++ if (l < 0) { ++ /* no more to read */ + break; + } + ck_assert_int_eq(l, strlen(data)); diff --git a/SPECS/libqb.spec b/SPECS/libqb.spec index fd72cf8..61c2e61 100644 --- a/SPECS/libqb.spec +++ b/SPECS/libqb.spec @@ -1,13 +1,15 @@ Name: libqb Version: 1.0 -Release: 1%{?dist} +Release: 1%{?dist}.1 Summary: An IPC library for high performance servers Group: System Environment/Libraries License: LGPLv2+ URL: http://clusterlabs.github.io/libqb/ Source0: https://github.com/ClusterLabs/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz -#Source0: https://github.com/ClusterLabs/%{name}/archive/v%{version}.tar.gz + +Patch0: bz1437023-ipc-detect-corrupt-shm-in-peek.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -21,6 +23,8 @@ Initially these are IPC and poll. %prep %setup -q +%patch0 -p1 -b .bz1437023-ipc-detect-corrupt-shm-in-peek.patch + # work-around for broken epoll in rawhide/f17 %build @@ -69,6 +73,9 @@ developing applications that use %{name}. %{_mandir}/man8/qb-blackbox.8.gz %changelog +* Wed Mar 29 2017 Christine Caulfield - 1.0-1.1 + Detect corruption in IPC shared memory + Resolves: rhbz#1437023 * Thu Apr 21 2016 Christine Caulfield - 1.0-1 Rebase to 1.0