diff --git a/SOURCES/bz1018091-log-Filtering-by-function-and-file-must-match-ex.patch b/SOURCES/bz1018091-log-Filtering-by-function-and-file-must-match-ex.patch new file mode 100644 index 0000000..8d1c19e --- /dev/null +++ b/SOURCES/bz1018091-log-Filtering-by-function-and-file-must-match-ex.patch @@ -0,0 +1,68 @@ +From 9abb68637d6d448cccfa06daa05d9c5bf59f5d3e Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Thu, 17 Oct 2013 21:44:12 -0500 +Subject: [PATCH] Fix: log: Filtering by function and file must match exactly, + no substring matches + +--- + lib/log.c | 4 ++-- + tests/check_log.c | 6 ++++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/lib/log.c b/lib/log.c +index 6d3435e..3b4d6bd 100644 +--- a/lib/log.c ++++ b/lib/log.c +@@ -103,9 +103,9 @@ _cs_matches_filter_(struct qb_log_callsite *cs, + snprintf(token, 499, "%.*s", (int)(next - offset), offset); + + if (type == QB_LOG_FILTER_FILE) { +- match = (strstr(cs->filename, token) != NULL); ++ match = (strcmp(cs->filename, token) == 0) ? 1 : 0; + } else { +- match = (strstr(cs->function, token) != NULL); ++ match = (strcmp(cs->function, token) == 0) ? 1 : 0; + } + if (!match && next[0] != 0) { + next++; +diff --git a/tests/check_log.c b/tests/check_log.c +index 3653b50..896bd7d 100644 +--- a/tests/check_log.c ++++ b/tests/check_log.c +@@ -191,6 +191,7 @@ _test_logger(int32_t t, + test_buf[0] = '\0'; + qb_log_target_format(t, cs, timestamp, msg, test_buf); + test_priority = cs->priority; ++ + num_msgs++; + } + +@@ -282,6 +283,7 @@ START_TEST(test_log_basic) + rc = qb_log_ctl(t, QB_LOG_CONF_ENABLED, QB_TRUE); + ck_assert_int_eq(rc, 0); + ++ /* captures last log */ + memset(test_buf, 0, sizeof(test_buf)); + test_priority = 0; + num_msgs = 0; +@@ -304,7 +306,7 @@ START_TEST(test_log_basic) + qb_log_filter_ctl(t, QB_LOG_FILTER_CLEAR_ALL, + QB_LOG_FILTER_FILE, "*", LOG_TRACE); + qb_log_filter_ctl(t, QB_LOG_FILTER_ADD, +- QB_LOG_FILTER_FUNCTION, "log_it_please", LOG_WARNING); ++ QB_LOG_FILTER_FUNCTION, "otherlogging,log_it_please,morelogging", LOG_WARNING); + + num_msgs = 0; + qb_log(LOG_ERR, "try if you: log_it_please()"); +@@ -336,7 +338,7 @@ START_TEST(test_log_basic) + qb_log_filter_ctl(t, QB_LOG_FILTER_CLEAR_ALL, + QB_LOG_FILTER_FILE, "*", LOG_TRACE); + qb_log_filter_ctl(t, QB_LOG_FILTER_ADD, +- QB_LOG_FILTER_FILE, __FILE__, LOG_DEBUG); ++ QB_LOG_FILTER_FILE, "fakefile.c,"__FILE__",otherfakefile", LOG_DEBUG); + /* + * make sure we can pass in a null filename or function name. + */ +-- +1.8.4.2 + diff --git a/SOURCES/bz1063415-corosync-crash-fixes.patch b/SOURCES/bz1063415-corosync-crash-fixes.patch new file mode 100644 index 0000000..4914902 --- /dev/null +++ b/SOURCES/bz1063415-corosync-crash-fixes.patch @@ -0,0 +1,29 @@ +From 6a2ff420e12211785683f3674fee968893144696 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Fri, 17 Jan 2014 11:22:24 -0600 +Subject: [PATCH] High: ipcs: Prevent ipc server use after free. + +The ipc server registers the bind socket to +the poll loop in order to be alerted to new +connection requests. Upon shutdown, the ipc server +does not remove this poll entry. This patch fixes +this use after free. +--- + lib/ipc_setup.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c +index 3c22e6f..fc3ce5b 100644 +--- a/lib/ipc_setup.c ++++ b/lib/ipc_setup.c +@@ -431,6 +431,7 @@ int32_t + qb_ipcs_us_withdraw(struct qb_ipcs_service * s) + { + qb_util_log(LOG_INFO, "withdrawing server sockets"); ++ s->poll_fns.dispatch_del(s->server_sock); + shutdown(s->server_sock, SHUT_RDWR); + close(s->server_sock); + return 0; +-- +1.8.4.2 + diff --git a/SOURCES/fixes-compile-time-make-test-issue.patch b/SOURCES/fixes-compile-time-make-test-issue.patch new file mode 100644 index 0000000..e60f94c --- /dev/null +++ b/SOURCES/fixes-compile-time-make-test-issue.patch @@ -0,0 +1,27 @@ +From 441ee1b952ce8cd6e7d9fa6189af3b5921a1ccc3 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Mon, 20 Jan 2014 16:59:52 -0600 +Subject: [PATCH] Low: tests: Fixes compile time issue with make check + +--- + tests/file_change_bytes.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/file_change_bytes.c b/tests/file_change_bytes.c +index 3a86f92..a725278 100644 +--- a/tests/file_change_bytes.c ++++ b/tests/file_change_bytes.c +@@ -51,8 +51,8 @@ int main(int argc, char *argv[]) + { + FILE *fi, *fo; + int i; +- char *input_file_name; +- char *output_file_name; ++ const char *input_file_name; ++ const char *output_file_name; + int no_bytes; + char *ep; + int ch; +-- +1.8.4.2 + diff --git a/SPECS/libqb.spec b/SPECS/libqb.spec index 2b498e2..73f8a99 100644 --- a/SPECS/libqb.spec +++ b/SPECS/libqb.spec @@ -1,6 +1,6 @@ Name: libqb Version: 0.16.0 -Release: 2%{?dist} +Release: 6%{?dist} Summary: An IPC library for high performance servers Group: System Environment/Libraries @@ -8,6 +8,9 @@ License: LGPLv2+ URL: http://www.libqb.org Source0: https://fedorahosted.org/releases/q/u/quarterback/%{name}-%{version}.tar.xz Patch0: bz1021597-set-SO_PASSCRED-sock-option.patch +Patch1: bz1018091-log-Filtering-by-function-and-file-must-match-ex.patch +Patch2: fixes-compile-time-make-test-issue.patch +Patch3: bz1063415-corosync-crash-fixes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libtool doxygen procps check-devel automake autoconf @@ -21,6 +24,9 @@ Initially these are IPC and poll. %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 # work-around for broken epoll in rawhide/f17 %build @@ -69,6 +75,25 @@ developing applications that use %{name}. %{_mandir}/man8/qb-blackbox.8.gz %changelog +* Mon Feb 10 2014 David Vossel - 0.16.0-6 +- Fixes use after free in ipc server + + Resolves: rhbz#1063415 + +* Fri Jan 24 2014 Daniel Mach - 0.16.0-5 +- Mass rebuild 2014-01-24 + +* Mon Jan 20 2014 David Vossel - 0.16.0-4 +- Require log filtering to match function and file exactly. + No substring matching. + +- Fixes complile time issue with 'make check' unit tests. + + Resolves: rhbz#1018091 + +* Fri Dec 27 2013 Daniel Mach - 0.16.0-3 +- Mass rebuild 2013-12-27 + * Thu Oct 30 2013 David Vossel - 0.16.0-2 Set SO_PASSCRED on listener socket