From 414eb68f454a5c53c1e8c1d96e49d4e81b30e386 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 02 2019 18:33:07 +0000 Subject: import libqb-1.0.1-7.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4854109 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libqb-1.0.1.tar.xz diff --git a/.libqb.metadata b/.libqb.metadata new file mode 100644 index 0000000..262bf91 --- /dev/null +++ b/.libqb.metadata @@ -0,0 +1 @@ +62830d34f14b1d86f68a05f398d2f7dbd8752f1c SOURCES/libqb-1.0.1.tar.xz diff --git a/SOURCES/bz1422454-ipc-detect-corrupt-shm-in-peek.patch b/SOURCES/bz1422454-ipc-detect-corrupt-shm-in-peek.patch new file mode 100644 index 0000000..362c93c --- /dev/null +++ b/SOURCES/bz1422454-ipc-detect-corrupt-shm-in-peek.patch @@ -0,0 +1,31 @@ +diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c +index 60b0ea1..3f401f0 100644 +--- a/lib/ringbuffer.c ++++ b/lib/ringbuffer.c +@@ -619,7 +619,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 c54fdc2..cdd85ec 100644 +--- a/tests/check_rb.c ++++ b/tests/check_rb.c +@@ -179,7 +179,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/SOURCES/bz1422573_1-dont-override-user-signals.patch b/SOURCES/bz1422573_1-dont-override-user-signals.patch new file mode 100644 index 0000000..4fb0b79 --- /dev/null +++ b/SOURCES/bz1422573_1-dont-override-user-signals.patch @@ -0,0 +1,20 @@ +commit e336b716cce83b3af414a1dcc4c2ef22c591d73f +Author: Christine Caulfield +Date: Fri Feb 24 16:36:35 2017 +0000 + + loop: Also set signals changed in qb_loop_signal_mod() back to SIG_DFL + + Signed-off-by: Christine Caulfield + +diff --git a/lib/loop_poll.c b/lib/loop_poll.c +index 386cae6..cd2474e 100644 +--- a/lib/loop_poll.c ++++ b/lib/loop_poll.c +@@ -723,6 +723,7 @@ qb_loop_signal_mod(qb_loop_t * lp, + sig->p = p; + + if (sig->signal != the_sig) { ++ signal(sig->signal, SIG_DFL); + sig->signal = the_sig; + _adjust_sigactions_(s); + } diff --git a/SOURCES/bz1422573_2-dont-override-user-signals.patch b/SOURCES/bz1422573_2-dont-override-user-signals.patch new file mode 100644 index 0000000..ec02090 --- /dev/null +++ b/SOURCES/bz1422573_2-dont-override-user-signals.patch @@ -0,0 +1,82 @@ +commit c751993c901805cc5cd02622c8672bbc7f8d6849 +Author: Christine Caulfield +Date: Fri Feb 24 16:23:43 2017 +0000 + + loop: don't override external signal handlers + + qb_loop_signal_add() used to set any signals it wasn't managing + back to SIG_DFL. This is unfriendly behaviour in a library. + + Signed-off-by: Christine Caulfield + Reviewed-by: Jan Pokorný + +diff --git a/lib/loop_poll.c b/lib/loop_poll.c +index 5c75748..386cae6 100644 +--- a/lib/loop_poll.c ++++ b/lib/loop_poll.c +@@ -643,8 +643,6 @@ _adjust_sigactions_(struct qb_signal_source *s) + if (needed) { + sigaddset(&s->signal_superset, i); + sigaction(i, &sa, NULL); +- } else { +- (void)signal(i, SIG_DFL); + } + } + } +@@ -775,6 +773,7 @@ qb_loop_signal_del(qb_loop_t * lp, qb_loop_signal_handle handle) + } + + qb_list_del(&sig->item.list); ++ signal(sig->signal, SIG_DFL); + free(sig); + _adjust_sigactions_(s); + return 0; +diff --git a/tests/check_loop.c b/tests/check_loop.c +index ff7f10a..0be5c21 100644 +--- a/tests/check_loop.c ++++ b/tests/check_loop.c +@@ -605,6 +605,36 @@ START_TEST(test_loop_sig_handling) + } + END_TEST + ++/* Globals for this test only */ ++static int our_signal_called = 0; ++static qb_loop_t *this_l; ++static void handle_nonqb_signal(int num) ++{ ++ our_signal_called = 1; ++ qb_loop_job_add(this_l, QB_LOOP_LOW, NULL, job_stop); ++} ++ ++START_TEST(test_loop_dont_override_other_signals) ++{ ++ qb_loop_signal_handle handle; ++ ++ this_l = qb_loop_create(); ++ fail_if(this_l == NULL); ++ ++ signal(SIGUSR1, handle_nonqb_signal); ++ ++ qb_loop_signal_add(this_l, QB_LOOP_HIGH, SIGINT, ++ this_l, sig_handler, &handle); ++ kill(getpid(), SIGUSR1); ++ qb_loop_run(this_l); ++ ++ ck_assert_int_eq(our_signal_called, 1); ++ ++ qb_loop_destroy(this_l); ++} ++END_TEST ++ ++ + START_TEST(test_loop_sig_only_get_one) + { + int res; +@@ -706,6 +736,7 @@ loop_signal_suite(void) + add_tcase(s, tc, test_loop_sig_handling, 10); + add_tcase(s, tc, test_loop_sig_only_get_one); + add_tcase(s, tc, test_loop_sig_delete); ++ add_tcase(s, tc, test_loop_dont_override_other_signals); + + return s; + } diff --git a/SOURCES/bz1446254-ipc-allow-fs-sockets.patch b/SOURCES/bz1446254-ipc-allow-fs-sockets.patch new file mode 100644 index 0000000..42b29c9 --- /dev/null +++ b/SOURCES/bz1446254-ipc-allow-fs-sockets.patch @@ -0,0 +1,393 @@ +diff -upr libqb-1.0.1.orig/configure.ac libqb-1.0.1/configure.ac +--- libqb-1.0.1.orig/configure.ac 2016-11-08 11:15:16.000000000 +0000 ++++ libqb-1.0.1/configure.ac 2017-05-15 10:47:39.042145452 +0100 +@@ -482,6 +482,11 @@ AC_ARG_WITH([socket-dir], + [ SOCKETDIR="$withval" ], + [ SOCKETDIR="$localstatedir/run" ]) + ++AC_ARG_WITH([force-sockets-config-file], ++ [AS_HELP_STRING([--with-force-sockets-config-file=FILE],[config file to force IPC to use filesystem sockets (Linux & Cygwin only) @<:@SYSCONFDIR/libqb/force-filesystem-sockets@:>@])], ++ [ FORCESOCKETSFILE="$withval" ], ++ [ FORCESOCKETSFILE="$sysconfdir/libqb/force-filesystem-sockets" ]) ++ + AC_SUBST(CP) + # *FLAGS handling goes here + +@@ -643,11 +648,14 @@ AM_CONDITIONAL([HAVE_DICT_WORDS], [test + # substitute what we need: + AC_SUBST([SOCKETDIR]) + AC_SUBST([LINT_FLAGS]) ++AC_SUBST([FORCESOCKETSFILE]) + + AC_DEFINE_UNQUOTED([SOCKETDIR], "$(eval echo ${SOCKETDIR})", [Socket directory]) + AC_DEFINE_UNQUOTED([LOCALSTATEDIR], "$(eval echo ${localstatedir})", [localstate directory]) + AC_DEFINE_UNQUOTED([PACKAGE_FEATURES], "${PACKAGE_FEATURES}", [quarterback built-in features]) + ++AC_DEFINE_UNQUOTED([FORCESOCKETSFILE], "$(eval echo ${FORCESOCKETSFILE})", [for sockets config file]) ++ + # version parsing (for qbconfig.h) + AC_DEFINE_UNQUOTED([QB_VER_MAJOR], + [$(echo "${VERSION}" \ +Only in libqb-1.0.1: configure.ac.orig +diff -upr libqb-1.0.1.orig/docs/mainpage.h libqb-1.0.1/docs/mainpage.h +--- libqb-1.0.1.orig/docs/mainpage.h 2016-11-08 10:10:23.000000000 +0000 ++++ libqb-1.0.1/docs/mainpage.h 2017-05-15 10:47:39.042145452 +0100 +@@ -101,6 +101,19 @@ + * a single one pushed throughout its lifecycle just with a single thread; + * anything else would likely warrant external synchronization enforcement. + * ++ * @par IPC sockets (Linux only) ++ * On Linux IPC, abstract (non-filesystem) sockets are used by default. If you ++ * need to override this (say in a net=host container) and use sockets that reside ++ * in the filesystem, then create a file called /etc/libqb/force-filesystem-sockets ++ * - this is the default name and can be changed at ./configure time. ++ * The file need contain no text, it's not a configuration file as such, just its ++ * presence will activate the feature. ++ * ++ * Note that this is a global option and read each time a new IPC connection ++ * (client or server) is created. So, to avoid having clients that cannot ++ * connect to running servers it is STRONGLY recommended to only create or remove ++ * this file prior to a system reboot or container restart. ++ * + * @par Client API + * @copydoc qbipcc.h + * @see qbipcc.h +Only in libqb-1.0.1/docs: mainpage.h.orig +diff -upr libqb-1.0.1.orig/lib/ipc_int.h libqb-1.0.1/lib/ipc_int.h +--- libqb-1.0.1.orig/lib/ipc_int.h 2016-02-22 16:01:51.000000000 +0000 ++++ libqb-1.0.1/lib/ipc_int.h 2017-05-15 10:47:39.042145452 +0100 +@@ -205,4 +205,6 @@ int32_t qb_ipcs_process_request(struct q + + int32_t qb_ipc_us_sock_error_is_disconnected(int err); + ++int use_filesystem_sockets(void); ++ + #endif /* QB_IPC_INT_H_DEFINED */ +diff -upr libqb-1.0.1.orig/lib/ipc_setup.c libqb-1.0.1/lib/ipc_setup.c +--- libqb-1.0.1.orig/lib/ipc_setup.c 2016-11-08 10:10:23.000000000 +0000 ++++ libqb-1.0.1/lib/ipc_setup.c 2017-05-15 10:47:39.042145452 +0100 +@@ -69,7 +69,6 @@ struct ipc_auth_data { + + }; + +- + static int32_t qb_ipcs_us_connection_acceptor(int fd, int revent, void *data); + + ssize_t +@@ -286,12 +285,13 @@ qb_ipcc_stream_sock_connect(const char * + address.sun_len = QB_SUN_LEN(&address); + #endif + +-#if defined(QB_LINUX) || defined(QB_CYGWIN) +- snprintf(address.sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name); +-#else +- snprintf(address.sun_path, sizeof(address.sun_path), "%s/%s", SOCKETDIR, +- socket_name); +-#endif ++ if (!use_filesystem_sockets()) { ++ snprintf(address.sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name); ++ } else { ++ snprintf(address.sun_path, sizeof(address.sun_path), "%s/%s", SOCKETDIR, ++ socket_name); ++ } ++ + if (connect(request_fd, (struct sockaddr *)&address, + QB_SUN_LEN(&address)) == -1) { + res = -errno; +@@ -535,10 +535,11 @@ qb_ipcs_us_publish(struct qb_ipcs_servic + #endif + + qb_util_log(LOG_INFO, "server name: %s", s->name); +-#if defined(QB_LINUX) || defined(QB_CYGWIN) +- snprintf(un_addr.sun_path + 1, UNIX_PATH_MAX - 1, "%s", s->name); +-#else +- { ++ ++ if (!use_filesystem_sockets()) { ++ snprintf(un_addr.sun_path + 1, UNIX_PATH_MAX - 1, "%s", s->name); ++ } ++ else { + struct stat stat_out; + res = stat(SOCKETDIR, &stat_out); + if (res == -1 || (res == 0 && !S_ISDIR(stat_out.st_mode))) { +@@ -552,7 +553,6 @@ qb_ipcs_us_publish(struct qb_ipcs_servic + s->name); + unlink(un_addr.sun_path); + } +-#endif + + res = bind(s->server_sock, (struct sockaddr *)&un_addr, + QB_SUN_LEN(&un_addr)); +@@ -561,15 +561,15 @@ qb_ipcs_us_publish(struct qb_ipcs_servic + qb_util_perror(LOG_ERR, "Could not bind AF_UNIX (%s)", + un_addr.sun_path); + goto error_close; +- } ++ } + + /* + * Allow everyone to write to the socket since the IPC layer handles + * security automatically + */ +-#if !defined(QB_LINUX) && !defined(QB_CYGWIN) +- res = chmod(un_addr.sun_path, S_IRWXU | S_IRWXG | S_IRWXO); +-#endif ++ if (use_filesystem_sockets()) { ++ res = chmod(un_addr.sun_path, S_IRWXU | S_IRWXG | S_IRWXO); ++ } + #ifdef SO_PASSCRED + setsockopt(s->server_sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); + #endif +@@ -593,6 +593,16 @@ qb_ipcs_us_withdraw(struct qb_ipcs_servi + qb_util_log(LOG_INFO, "withdrawing server sockets"); + (void)s->poll_fns.dispatch_del(s->server_sock); + shutdown(s->server_sock, SHUT_RDWR); ++ ++ if (use_filesystem_sockets()) { ++ struct sockaddr_un sockname; ++ socklen_t socklen = sizeof(sockname); ++ if ((getsockname(s->server_sock, (struct sockaddr *)&sockname, &socklen) == 0) && ++ sockname.sun_family == AF_UNIX) { ++ unlink(sockname.sun_path); ++ } ++ } ++ + close(s->server_sock); + s->server_sock = -1; + return 0; +diff -upr libqb-1.0.1.orig/lib/ipc_socket.c libqb-1.0.1/lib/ipc_socket.c +--- libqb-1.0.1.orig/lib/ipc_socket.c 2016-11-08 10:10:23.000000000 +0000 ++++ libqb-1.0.1/lib/ipc_socket.c 2017-05-15 10:47:39.043145455 +0100 +@@ -42,6 +42,26 @@ struct ipc_us_control { + }; + #define SHM_CONTROL_SIZE (3 * sizeof(struct ipc_us_control)) + ++int use_filesystem_sockets(void) ++{ ++ static int need_init = 1; ++ static int filesystem_sockets = 0; ++ ++ if (need_init) { ++ struct stat buf; ++ ++ need_init = 0; ++#if defined(QB_LINUX) || defined(QB_CYGWIN) ++ if (stat(FORCESOCKETSFILE, &buf) == 0) { ++ filesystem_sockets = 1; ++ } ++#else ++ filesystem_sockets = 1; ++#endif ++ } ++ return filesystem_sockets; ++} ++ + static void + set_sock_addr(struct sockaddr_un *address, const char *socket_name) + { +@@ -51,12 +71,12 @@ set_sock_addr(struct sockaddr_un *addres + address->sun_len = QB_SUN_LEN(address); + #endif + +-#if defined(QB_LINUX) || defined(QB_CYGWIN) +- snprintf(address->sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name); +-#else +- snprintf(address->sun_path, sizeof(address->sun_path), "%s/%s", SOCKETDIR, +- socket_name); +-#endif ++ if (!use_filesystem_sockets()) { ++ snprintf(address->sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name); ++ } else { ++ snprintf(address->sun_path, sizeof(address->sun_path), "%s/%s", SOCKETDIR, ++ socket_name); ++ } + } + + static int32_t +@@ -81,15 +101,16 @@ qb_ipc_dgram_sock_setup(const char *base + } + snprintf(sock_path, PATH_MAX, "%s-%s", base_name, service_name); + set_sock_addr(&local_address, sock_path); +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- res = unlink(local_address.sun_path); +-#endif ++ if (use_filesystem_sockets()) { ++ res = unlink(local_address.sun_path); ++ } + res = bind(request_fd, (struct sockaddr *)&local_address, + sizeof(local_address)); +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- chmod(local_address.sun_path, 0660); +- chown(local_address.sun_path, -1, gid); +-#endif ++ ++ if (use_filesystem_sockets()) { ++ chmod(local_address.sun_path, 0660); ++ chown(local_address.sun_path, -1, gid); ++ } + if (res < 0) { + goto error_connect; + } +@@ -316,36 +337,33 @@ _finish_connecting(struct qb_ipc_one_way + static void + qb_ipcc_us_disconnect(struct qb_ipcc_connection *c) + { +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- struct sockaddr_un un_addr; +- socklen_t un_addr_len = sizeof(struct sockaddr_un); +- char *base_name; +- char sock_name[PATH_MAX]; +- size_t length; +-#endif +- + munmap(c->request.u.us.shared_data, SHM_CONTROL_SIZE); + unlink(c->request.u.us.shared_file_name); + +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- if (getsockname(c->response.u.us.sock, (struct sockaddr *)&un_addr, &un_addr_len) == 0) { +- length = strlen(un_addr.sun_path); +- base_name = strndup(un_addr.sun_path,length-9); +- qb_util_log(LOG_DEBUG, "unlinking socket bound files with base_name=%s length=%d",base_name,length); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"request"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event-tx"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"response"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- } +-#endif ++ if (use_filesystem_sockets()) { ++ struct sockaddr_un un_addr; ++ socklen_t un_addr_len = sizeof(struct sockaddr_un); ++ char *base_name; ++ char sock_name[PATH_MAX]; ++ size_t length; ++ if (getsockname(c->response.u.us.sock, (struct sockaddr *)&un_addr, &un_addr_len) == 0) { ++ length = strlen(un_addr.sun_path); ++ base_name = strndup(un_addr.sun_path,length-9); ++ qb_util_log(LOG_DEBUG, "unlinking socket bound files with base_name=%s length=%d",base_name,length); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"request"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event-tx"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"response"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ } ++ } + qb_ipcc_us_sock_close(c->event.u.us.sock); + qb_ipcc_us_sock_close(c->request.u.us.sock); + qb_ipcc_us_sock_close(c->setup.u.us.sock); +@@ -451,11 +469,11 @@ retry_peek: + + if (errno != EAGAIN) { + final_rc = -errno; +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- if (errno == ECONNRESET || errno == EPIPE) { +- final_rc = -ENOTCONN; ++ if (use_filesystem_sockets()) { ++ if (errno == ECONNRESET || errno == EPIPE) { ++ final_rc = -ENOTCONN; ++ } + } +-#endif + goto cleanup_sigpipe; + } + +@@ -686,38 +704,36 @@ _sock_rm_from_mainloop(struct qb_ipcs_co + static void + qb_ipcs_us_disconnect(struct qb_ipcs_connection *c) + { +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- struct sockaddr_un un_addr; +- socklen_t un_addr_len = sizeof(struct sockaddr_un); +- char *base_name; +- char sock_name[PATH_MAX]; +- size_t length; +-#endif + qb_enter(); + + if (c->state == QB_IPCS_CONNECTION_ESTABLISHED || + c->state == QB_IPCS_CONNECTION_ACTIVE) { + _sock_rm_from_mainloop(c); + +-#if !(defined(QB_LINUX) || defined(QB_CYGWIN)) +- if (getsockname(c->response.u.us.sock, (struct sockaddr *)&un_addr, &un_addr_len) == 0) { +- length = strlen(un_addr.sun_path); +- base_name = strndup(un_addr.sun_path,length-8); +- qb_util_log(LOG_DEBUG, "unlinking socket bound files with base_name=%s length=%d",base_name,length); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"request"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event-tx"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); +- snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"response"); +- qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); +- unlink(sock_name); ++ if (use_filesystem_sockets()) { ++ struct sockaddr_un un_addr; ++ socklen_t un_addr_len = sizeof(struct sockaddr_un); ++ char *base_name; ++ char sock_name[PATH_MAX]; ++ size_t length; ++ if (getsockname(c->response.u.us.sock, (struct sockaddr *)&un_addr, &un_addr_len) == 0) { ++ length = strlen(un_addr.sun_path); ++ base_name = strndup(un_addr.sun_path,length-8); ++ qb_util_log(LOG_DEBUG, "unlinking socket bound files with base_name=%s length=%d",base_name,length); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"request"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"event-tx"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ snprintf(sock_name,PATH_MAX,"%s-%s",base_name,"response"); ++ qb_util_log(LOG_DEBUG, "unlink sock_name=%s",sock_name); ++ unlink(sock_name); ++ } + } +-#endif + qb_ipcc_us_sock_close(c->setup.u.us.sock); + qb_ipcc_us_sock_close(c->request.u.us.sock); + qb_ipcc_us_sock_close(c->event.u.us.sock); +Only in libqb-1.0.1/lib: ipc_socket.c.orig +diff -upr libqb-1.0.1.orig/tests/check_ipc.c libqb-1.0.1/tests/check_ipc.c +--- libqb-1.0.1.orig/tests/check_ipc.c 2016-11-08 11:15:16.000000000 +0000 ++++ libqb-1.0.1/tests/check_ipc.c 2017-05-15 10:47:39.043145455 +0100 +@@ -1417,10 +1417,17 @@ END_TEST + #ifdef HAVE_FAILURE_INJECTION + START_TEST(test_ipcc_truncate_when_unlink_fails_shm) + { ++ char sock_file[PATH_MAX]; + qb_enter(); +- _fi_unlink_inject_failure = QB_TRUE; + ipc_type = QB_IPC_SHM; + set_ipc_name(__func__); ++ ++ sprintf(sock_file, "%s/%s", SOCKETDIR, ipc_name); ++ /* If there's an old socket left from a previous run this test will fail ++ unexpectedly, so try to remove it first */ ++ unlink(sock_file); ++ ++ _fi_unlink_inject_failure = QB_TRUE; + test_ipc_server_fail(); + _fi_unlink_inject_failure = QB_FALSE; + qb_leave(); +Only in libqb-1.0.1/tests: check_ipc.c.orig diff --git a/SOURCES/bz1473695-dont-crash-on-shm-truncate.patch b/SOURCES/bz1473695-dont-crash-on-shm-truncate.patch new file mode 100644 index 0000000..97cef8e --- /dev/null +++ b/SOURCES/bz1473695-dont-crash-on-shm-truncate.patch @@ -0,0 +1,185 @@ +diff --git a/include/qb/qbipcs.h b/include/qb/qbipcs.h +index 55c0f81..7b4daa7 100644 +--- a/include/qb/qbipcs.h ++++ b/include/qb/qbipcs.h +@@ -142,6 +142,10 @@ typedef void (*qb_ipcs_connection_created_fn) (qb_ipcs_connection_t *c); + * successfully created. + * @note if you return anything but 0 this function will be + * repeativily called (until 0 is returned). ++ * ++ * With SHM connections libqb will briefly trap SIGBUS during the ++ * disconnect process to guard against server crashes if the mapped ++ * file is truncated. The signal will be restored afterwards. + */ + typedef int32_t (*qb_ipcs_connection_closed_fn) (qb_ipcs_connection_t *c); + +diff --git a/lib/ipc_int.h b/lib/ipc_int.h +index 67fc444..9cd06cf 100644 +--- a/lib/ipc_int.h ++++ b/lib/ipc_int.h +@@ -92,6 +92,7 @@ struct qb_ipcc_connection { + char name[NAME_MAX]; + int32_t needs_sock_for_poll; + gid_t egid; ++ pid_t server_pid; + struct qb_ipc_one_way setup; + struct qb_ipc_one_way request; + struct qb_ipc_one_way response; +diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c +index 57d755b..0e16964 100644 +--- a/lib/ipc_setup.c ++++ b/lib/ipc_setup.c +@@ -494,6 +494,7 @@ qb_ipcc_us_setup_connect(struct qb_ipcc_connection *c, + + qb_ipc_auth_creds(data); + c->egid = data->ugp.gid; ++ c->server_pid = data->ugp.pid; + + destroy_ipc_auth_data(data); + return r->hdr.error; +diff --git a/lib/ipc_shm.c b/lib/ipc_shm.c +index 699f4e4..9f237b6 100644 +--- a/lib/ipc_shm.c ++++ b/lib/ipc_shm.c +@@ -20,6 +20,8 @@ + */ + #include "os_base.h" + #include ++#include ++#include + + #include "ipc_int.h" + #include "util_int.h" +@@ -36,9 +38,12 @@ + static void + qb_ipcc_shm_disconnect(struct qb_ipcc_connection *c) + { +- void (*rb_destructor)(struct qb_ringbuffer_s *) = c->is_connected +- ? qb_rb_close +- : qb_rb_force_close; ++ void (*rb_destructor)(struct qb_ringbuffer_s *); ++ ++ rb_destructor = qb_rb_close; ++ if (!c->is_connected && (!c->server_pid || (kill(c->server_pid, 0) == -1 && errno == ESRCH))) { ++ rb_destructor = qb_rb_force_close; ++ } + + qb_ipcc_us_sock_close(c->setup.u.us.sock); + +@@ -215,18 +220,30 @@ return_error: + * service functions + * -------------------------------------------------------- + */ ++static jmp_buf sigbus_jmpbuf; ++static void catch_sigbus(int signal) ++{ ++ longjmp(sigbus_jmpbuf, 1); ++} + + static void + qb_ipcs_shm_disconnect(struct qb_ipcs_connection *c) + { +- if (c->state == QB_IPCS_CONNECTION_ESTABLISHED || +- c->state == QB_IPCS_CONNECTION_ACTIVE) { +- if (c->setup.u.us.sock > 0) { +- (void)c->service->poll_fns.dispatch_del(c->setup.u.us.sock); +- qb_ipcc_us_sock_close(c->setup.u.us.sock); +- c->setup.u.us.sock = -1; +- } ++ struct sigaction sa; ++ struct sigaction old_sa; ++ ++ /* Don't die if the client has truncated the SHM under us */ ++ memset(&old_sa, 0, sizeof(old_sa)); ++ memset(&sa, 0, sizeof(sa)); ++ sa.sa_handler = catch_sigbus; ++ sigemptyset(&sa.sa_mask); ++ sa.sa_flags = 0; ++ sigaction(SIGBUS, &sa, &old_sa); ++ ++ if (setjmp(sigbus_jmpbuf) == 1) { ++ goto end_disconnect; + } ++ + if (c->state == QB_IPCS_CONNECTION_SHUTTING_DOWN || + c->state == QB_IPCS_CONNECTION_ACTIVE) { + if (c->response.u.shm.rb) { +@@ -239,6 +256,17 @@ qb_ipcs_shm_disconnect(struct qb_ipcs_connection *c) + qb_rb_close(qb_rb_lastref_and_ret(&c->request.u.shm.rb)); + } + } ++ ++ if (c->state == QB_IPCS_CONNECTION_ESTABLISHED || ++ c->state == QB_IPCS_CONNECTION_ACTIVE) { ++ if (c->setup.u.us.sock > 0) { ++ (void)c->service->poll_fns.dispatch_del(c->setup.u.us.sock); ++ qb_ipcc_us_sock_close(c->setup.u.us.sock); ++ c->setup.u.us.sock = -1; ++ } ++ } ++end_disconnect: ++ sigaction(SIGBUS, &old_sa, NULL); + } + + static int32_t +diff --git a/tests/check_ipc.c b/tests/check_ipc.c +index f8af2c5..46c3b40 100644 +--- a/tests/check_ipc.c ++++ b/tests/check_ipc.c +@@ -444,18 +444,30 @@ run_ipc_server(void) + static int32_t + run_function_in_new_process(void (*run_ipc_server_fn)(void)) + { +- pid_t pid = fork (); ++ pid_t pid1 = fork (); ++ pid_t pid2; + +- if (pid == -1) { ++ if (pid1 == -1) { + fprintf (stderr, "Can't fork\n"); + return -1; + } + +- if (pid == 0) { +- run_ipc_server_fn(); +- exit(0); ++ /* Double-fork so the servers can be reaped in a timely manner */ ++ if (pid1 == 0) { ++ pid2 = fork(); ++ if (pid2 == -1) { ++ fprintf (stderr, "Can't fork twice\n"); ++ exit(0); ++ } ++ if (pid2 == 0) { ++ run_ipc_server_fn(); ++ exit(0); ++ } else { ++ waitpid(pid2, NULL, 0); ++ exit(0); ++ } + } +- return pid; ++ return pid1; + } + + static void +--- a/lib/loop_poll.cg 2018-04-20 11:23:05.255007538 +0100 ++++ b/lib/loop_poll.c 2018-04-20 11:23:36.000113203 +0100 +@@ -723,7 +723,7 @@ qb_loop_signal_mod(qb_loop_t * lp, + sig->p = p; + + if (sig->signal != the_sig) { +- signal(sig->signal, SIG_DFL); ++ (void)signal(sig->signal, SIG_DFL); + sig->signal = the_sig; + _adjust_sigactions_(s); + } +@@ -774,7 +774,7 @@ qb_loop_signal_del(qb_loop_t * lp, qb_lo + } + + qb_list_del(&sig->item.list); +- signal(sig->signal, SIG_DFL); ++ (void)signal(sig->signal, SIG_DFL); + free(sig); + _adjust_sigactions_(s); + return 0; diff --git a/SPECS/libqb.spec b/SPECS/libqb.spec new file mode 100644 index 0000000..54eb2c6 --- /dev/null +++ b/SPECS/libqb.spec @@ -0,0 +1,559 @@ +Name: libqb +Version: 1.0.1 +Release: 7%{?dist} +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 + +Patch1: bz1422454-ipc-detect-corrupt-shm-in-peek.patch +Patch2: bz1446254-ipc-allow-fs-sockets.patch +#Patch3: bz1459276-dont-truncate-in-client.patch +Patch4: bz1422573_1-dont-override-user-signals.patch +Patch5: bz1422573_2-dont-override-user-signals.patch +Patch6: bz1473695-dont-crash-on-shm-truncate.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: libtool doxygen procps check-devel automake autoconf + +#Requires: + +%description +libqb provides high performance client server reusable features. +Initially these are IPC and poll. + +%prep +%setup -q +%patch1 -p1 -b .bz1422454-ipc-detect-corrupt-shm-in-peek +%patch2 -p1 -b .bz1446254-ipc-allow-fs-sockets +#%patch3 -p1 -b .bz1459276-dont-truncate-in-client.patch +%patch4 -p1 -b .bz1422573_1-dont-override-user-signals.patch +%patch5 -p1 -b .bz1422573_2-dont-override-user-signals.patch +%patch6 -p1 -b .bz1473695-dont-crash-on-shm-truncate.patch + +# work-around for broken epoll in rawhide/f17 +%build +./autogen.sh +%configure --disable-static +make %{?_smp_mflags} + +%check +make check + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' +rm -rf $RPM_BUILD_ROOT/%{_docdir}/* + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_sbindir}/qb-blackbox +%{_libdir}/libqb.so.* + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} pkgconfig + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%files devel +%defattr(-,root,root,-) +%doc COPYING README.markdown +%{_includedir}/qb/ +%{_libdir}/libqb.so +%{_libdir}/pkgconfig/libqb.pc +%{_mandir}/man3/qb*3* +%{_mandir}/man8/qb-blackbox.8.gz + +%changelog + +* Fri Apr 20 2018 Christine Caulfield - 1.0.1-7 + Prevent crashes when client truncates SHM segment + I've reverted the patch for 1459276 which is no longer needed as this + is a proper fix. + Resolves: rhbz#1473695 + +* Fri Nov 03 2017 Christine Caulfield - 1.0.1-6 + Don't override external signal handlers + Resolves: rhbz#1422573 + +* Tue Jun 27 2017 Christine Caulfield - 1.0.1-5 + Put backpatch 189ca28 as it's not the culprit + + Don't truncate IPC files in the client as it can cause servers to crash. + I've also had to (for this release) disable one of the tests as it checks + for truncated files. + Resolves: rhbz#1459276 + +* Wed Jun 20 2017 Christine Caulfield - 1.0.1-4 + Revert git patch 189ca28 which caused problems with pacemaker CIB + closing down. + Resolves: rhbz#1459276 + +* Mon May 15 2017 Christine Caulfield - 1.0.1-3 + Allow IPC system to use filesystem sockets instead of abstract + sockets if a configuration file exists. + Resolves: rhbz#1446254 + +* Tue Jan 31 2017 Christine Caulfield - 1.0.1-2 + Detect IPC Shared memory corruption in peek as well as read. Prevents + the mainloop from spinning if multithreaded IPC (which is currently + not supported) is attempted without locking. + Resolves: rhbz#1422454 + +* Tue Jan 31 2017 Christine Caulfield - 1.0.1-1 + * Rebase to 1.0.1 + Resolves: rhbz#1392835 + +* Tue Dec 06 2016 Christine Caulfield - 1.0-2 + * Don't overwrite valid logging tags, breaks facility names on PPC64LE + Resolves: rhbz#1387165 + +* Thu Apr 21 2016 Christine Caulfield - 1.0-1 + Rebase to 1.0 + Resolves bz#1299968 + +* Mon Nov 2 2015 Christine Caulfield - 0.17.1-2.1 + Increase size of the buffer where we make the socket name to allow for longer PIDs + Resolves bz#1114852 + +* Thu Apr 16 2015 David Vossel - 0.17.1-2 + Fixes assert encountered in libqb's mainloop implementation. + + Resolves: rhbz#1211375 + +* Thu Mar 05 2015 David Vossel - 0.17.1-1.1 + Fix bug that prevents ipc server from working in pid with realtime priority. + + Resolves: rhbz#1198718 + +* Tue Aug 26 2014 David Vossel - 0.17.1-1 + Fix: ipcs: Correctly allocate receive buffer size + Fix: ipc_socket: Signalhandler must be resetted to Default, use only cleanup_sigpipe to return from qb_ipc_dgram_sock_setup. + Fix: trie: allow modifying the trie map during the notify callback + Fix: fix invalid option when run 'ipcclient -h' + Fix: epoll: don't miss poll events under high load + Fix: ipc_shm: fix error handling in qb_ipcs_shm_connect() + Fix: ringbuffer: fix size in qb_rb_create_from_file() + Fix: ringbuffer: fix qb_rb_open_2() debug format string + Fix: trie: fixes regression caused by ref count refactoring + Fix: ipcc: Properly timeout during recv when timeout value is provided + + Resolves: rhbz#1110043 + Resolves: rhbz#975903 + +* 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 + + Resolves: rhbz#1021597 + +* Thu Jul 25 2013 David Vossel - 0.16.0-1 + Rebase to v0.16.0 release + +* Thu Jul 24 2013 David Vossel - 0.15.0-2 + sync spec file with v0.15.0 release + +* Thu Jul 24 2013 David Vossel - 0.15.0-1 + Rebase to release v0.15.0 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.14.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jan 17 2013 Angus Salkeld - 0.14.4-1 +LOG: prevent the last char of the blackbox message from getting lost. +Example: make the blackbox example more practical. +Add the processing which remove notifier at skiplist_destroy function +Add the processing which remove hash node and notifier at hashtable_destroy function +Unify to QB_TRUE/QB_FALSE a boolean value +Document the default prefix in INSTALL +Unify the list processing with qb_list function +Add travis link to the readme. +Fix return code which is an error occurred at pthread function +TEST: add a progam to compare the speed of vsnprintf and qb_vsnprintf_serialize +LOG: add a test for a padded hex int. +Fedora's splint has a strange syntax error, don't fail on it. +LOG: fix truncation in some messages that get padded. +Fix the blackbox formatter when specifing the string len/precision +Fix strlcpy and strlcat functions +IPC: don't over log on disconnect +Make sure we don't use the format string whilst it is getting changed. +ptrie: deref the current node in trie_iter_free() +LOG: fix the format comparison to avoid generating multiple entries. +LOG: set the return code when calloc fails +IPC: call poll if we are mid message and get EAGAIN +Remove extra ";" +IPC: set the error more correctly when qb_sys_mmap_file_open() fails. +Make sure that mmap'ed files smaller than a page size are written to. +example/test: check for error in qb_ipc_run() +example: check for error in qb_ipc_run() +TEST: fix typo s/,/; in check_ipc.c + +* Mon Oct 29 2012 Angus Salkeld - 0.14.3-2 +Fix test code highlighted by new check version +Remove the call to autogen.sh - not needed anymore. + +* Mon Oct 29 2012 Angus Salkeld - 0.14.3-1 +IPC: Pass the timeout to poll() if the recv function returns EAGAIN +LOG: make the format comparison safe and sane +LOG: don't break on empty callsites, just ignore them +LOG: use the array callback to register new callsites +array: add a mechanism to get a callback when a bin is allocated +Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE. +Make sure atomic's are initialized (for non-gcc atomic). + +* Wed Sep 12 2012 Angus Salkeld - 0.14.2-2 +Fix a crash in ptrie if you iterate over the map in the deleted notifier. + +* Mon Sep 10 2012 Angus Salkeld - 0.14.2-1 +Get libqb building on cygwin. +ipc_us: slightly more robust cmsg handling +ipc_us: on Linux, set SO_PASSCRED on the sending socket too +ipc_us: clear request unused fields +TEST: Include writing and reading the blackbox in the log_long_msg test +LOG: fix qb_vsnprintf_deserialize() +blackbox: fix 64-bit big-endian issues +Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris +Define unix path max for openbsd +Only turn on ipc_needs_response_ack=yes for solaris +Some improvements to kqueue usage. +kqueue: drop log message to trace. +Fix splint warning +openbsd requires netinet/in.h before arpa/inet.h +Avoid strcpy() use strlcpy() instead. +Fix kqueue complile warnings +openbsd doesn't have EBADMSG +openbsd has a different UNIX_PATH_MAX +LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize() +TEST: increase timeout to 6 secs as the recv timeout is 5 secs +TEST: get the logic right - grrr. +Turn off attribute_section on netbsd +Some missing pshared semaphore checks +Cleanup the checks for pshared semaphores +Add a config check for pthread_mutexattr_setpshared +Remove uses of timersub and use qb_util_stopwatch +RB: change the #error to ENOTSUP if no usable shared process sem +LOOP-KQUEUE: fix reference before assignment. +build: fix libqb.pc creation and make maintainer-clean +LOG: Make sure the semaphores are initialized. +build: remove bashism in cc support check +Catch disconnected sockets on Solaris +Don't free rb->shared_hdr in qb_rb_create_from_file() +Check error return of qb_ipcs_uc_recv_and_auth() +Fix removal of automatically installed doc files when building rpms +Add the mailing list to the travis email notifications. +Work around debian not setting the arch path in splint. +Remove color-tests and parallel-tests automake options. +Add travis continuous integration config +LOG: Invoke custom log filter function if tag changes +tests/rbwriter: don't ignore write failure +ipcs: avoid use-after-free for size-0 || disconnect-request + +* Wed Jul 18 2012 Angus Salkeld - 0.14.1-1 +RB: set the new read pointer after clearing the header (#839605). +RB: improve the debug print outs +RB: be more explicit about the word alignment +RB: cleanup the macros for wrapping the index +RB: use sem_getvalue as a tie breaker when read_pt == write_pt +RB: if read or peek don't get the message then re-post to the semaphore +RB: convert the rb_peek() status into a recv like status. +RB: use internal reclaim function +IPC: use calloc instead of malloc to fix valgrind warnings +Upgrade the doxygen config. +Fix a valgrind error. + +* Sun Jun 24 2012 Angus Salkeld - 0.14.0-1 +LOG: fix threaded logging. +Add user control of the permissions that are set on the shared mem files +LOG: Restrict string trucation during serialization to when a precision is specified +LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN +LOG: Observe field widths when serializing string arguments +RB: use the same mechanism in reclaim as read/peek to detect end-of-ring +Add needs_response_ack option to ./check +RB: fix wrong sem_flg IPC_NOWAIT option +TESTS: fix warning about unused functions +Remove D_FORTIFY_SOURCE from check. +Open shared mem file in /dev/shm only for linux +Don't use msg_flags on solaris (recvmsg). +Turn off attribute_section on solaris +ipc example: add -e (events) option +IPC: if the server returns EAGAIN or ETIMEOUT the check the connection +LOG: make it possible to fsync() on each file log. +IPC: make sure that the created callback happens before dispatches +LOG: fix the printing of %p in the blackbox +IPC: On bsd's use the notifier for responses +IPC: interpret ECONNRESET and EPIPE as ENOTCONN +cleanup some warnings +config: use newer AC_COMPILE_IFELSE() +blackbox: fix %p formatting +LOG: put all fields in the blackbox (added priority and tags) +example: make the priority uint8_t +Remove strerror out of check_funcs +RB: fix compiler warning. +Add replacement function stpcpy +Add missing AC_TYPE_UINT16_T to configure.ac +Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P +Add stpcpy strcasecmp to the check_funcs +Move some conditional defines into code (from the configure script) +Remove some unused configure checks +Remove message queues +Check for union semun properly +Blackbox: provide more space for log messages when reading from the blackbox. +Add the blackbox reader manpage to the spec file +Enable error logging for the blackbox reader +RB: Read the file size into an initialized variable of the correct size +Add a tool to dump the blackbox. +RB: to be safer save the read and write pointers at the top of the blackbox +avoid unwarranted use of strncpy: use memcpy instead +blackbox: fix the print_from_file() +RB: add an option to not use any semaphores +LOG: tweak the blackbox format string +LOG: accept NULL strings into the blackbox +LOG: protect close and reload from calling log +Add benchmark option (-b) to examples/ipcclient +TEST: make rbreader/writer more like the other benchmarking apps +IPC: log the connection description in all logs +TEST: re-organise the ipc test suites +IPC: only modify the dispatch if we get EAGAIN +Correctly display timestamp in blackbox + +* Thu May 10 2012 Angus Salkeld - 0.13.0-1 +- Remove unneccessary __attribute__ ((aligned(8))) from internal headers +- IPC: add a new function to get (and alloc) the extended stats. +- Revert "Add the event queue length to the connection stats." +- IPC: cleanup better on a failed client connect. +- IPC(soc): be more consistent with control struct size +- IPC: kill a compiler warning +- IPC(soc): pass in the correct size into munmap() +- TEST: Use /bin/sh not /bin/bash +- TEST: check for lost shared mem on bsd too +- rb: cleanup the semaphores +- Fix some small issues in ./check +- Cleanup the .gitignore files +- configure.ac tweaks +- Remove HZ and use sysconf instead. +- SUN_LEN() macro is present if __EXTENSIONS__ is defined on Illumos +- PF_UNIX is a POSIX standard name +- Test for log facility names +- IPC: drop log message to debug. +- IPC: fix retrying of partial recv's and sends. +- IPC: initialize enough shared mem for all 3 one way connections. +- IPC: keep retrying to recv the socket message if partially recv'ed (part 2) +- IPC: keep retrying to recv the socket message if partially recv'ed +- IPC: handle the server shutdown better +- IPC: handle a connection disconnect from the server better +- IPC: make it possible to send events in the connected callback. +- Add the event queue length to the connection stats. +- IPC: add a is_connected client side function. +- Fix typo in ./check +- docs: clarify the need to use request/response headers +- Remove unused local variable +- IPC: change the socket recv function to read the response header. +- Add some special commands into the ipc example +- TEST: improve the tracing in the ipc tests. +- Make "make (s)rpm" work more reliably +- TEST: add a test to confirm we get the events we send. +- TEST: reuse send_and_check for events. +- IPC: make it possible for a root client to talk to a non-root server. +- Run ./Lindent in the examples directory +- Add some debug code to the ipcclient example +- IPC: make sure ipc (socket) clients can connect to a server running as root. +- IPC: allow qb to bump the max_message_size +- IPC: check for a sane minimum max_message_size +- add rpl_sem.h loop_poll_int.h to noinst_headers +- Handle errors more consistently +- call recv_ready on socket types +- Handle a recv of size 0 +- make bsd shm path better by default. +- Fix kqueue on freebsd. +- Get the example socket includes right. +- Fix kqueue compiling. +- POLL: seperate out the poll/epoll and add kqueue +- Test existence of getpeer* functions +- Add inet header to tcpclient example +- Don't link with setpshared if unavailable +- NetBSD doesn't have semun defined +- Use MADV_NOSYNC only on systems where available +- Use SCHED_BATCH only on platforms where available +- Fix a bug introduced by the bsd patch. +- Cleanup the selection of semaphores to use +- Fix some leaks in the logging. +- Try and improve the portability on bsd variants. + +* Sun Mar 11 2012 Angus Salkeld - 0.11.1-1 +- configue libqb to not use epoll as it seems broken (#800865) +- LOOP: remove some old timerfd code. +- TEST: add a test to check the order of the jobs +- LOOP: when new jobs are added they are added to the head instead of the tail. +- LOG: Now the array is self locking we can make the lookup array dynamic +- Add locking to the array when growing. +- IPC: make the _request_q_len_get() function more obvious. +- IPC: fix multiple receives from qb_ipc_us_recv() +- IPC: make sure that the wrong union member is not written to. +- TIMER: check for null timer handle + +Wed Mar 7 2012 Angus Salkeld - 0.11.0-1 +- ARRAY: cleanup the pointer sizeof() +- LOG: turn off __attribute__(section) for powerpc (not working) +- TESTS: move the util tests into "slow-tests" (i.e. optional) +- TEST: make the test_priority the same type as in the callsite +- LOG: make the log arrays manually grow-able since we need to lock the calls. +- RB: fix test failure on ppc +- RB: change the name of the size to word_size to be more clear +- TEST: add some more signal tests. +- LOOP: fix deletion of signal handlers when they are pending +- LOOP: signal handlers were always added as high priority. +- TEST: deal with mac's limited sed +- check: add debugging to the configure options and remove unused options +- TEST: properly clear the filters +- LOG: expose the mechanism to get a dynamic callsite. +- Revert part of my COARSE grained timer commit +- Remove timerfd usage and go back to timelist. +- UTIL: if possible use COARSE resolution clocks - they are much faster. +- ARRAY: save memory (in the bins array) and allow holes in the array +- LOOP: add qb_loop_timer_is_running() +- LOOP: allow stop() and run() to be called with NULL loop instance. +- LOOP: fix doxygen parameter comment +- LOG: add stdout target +- LOOP: add a function to delete jobs +- LOG: remove debug printf's +- LOG: remove an old/incorrect doxygen comment. +- LOG: add a hostname %H format specifier. +- LOG: Add qb_log_filter_fn_set() + +* Tue Feb 14 2012 Angus Salkeld - 0.10.1-1 +- Fix "make distcheck" add include path to AM_CPPFLAGS +- Bump the version to 0.10.1 +- clang: Remove unused code +- TEST: make the ipc failure test closer to corosync's case. +- RB: add a debug message if trying to read a message of the wrong size +- IPC: split up the recv into chuncks of 2 seconds. (#788742) +- Be more consistent with the internal logs. +- LOOP: make it possible to pass in NULL as the default loop instance +- RB: use the proper struct not the typedef in the implementation. +- RB: Fix potential mem leak +- Don't mix enums (QB_TRUE/TRUE) +- use random() not rand() +- Remove dead code +- set umask before calling mkstemp() +- Use safer versions of string functions (strcpy -> strlcpy) +- Increase the coverity aggressiveness +- TEST: make the loop ratelimit test more forgiving. + +* Tue Feb 07 2012 Angus Salkeld - 0.10.0-1 +- LOOP: handle errors from the poll function +- LOOP: make the item type applicable to jobs too. +- LOOP: fix the todo calculations. +- TEST: check for a single job causing a cpu spin +- LOOP: prevent jobs from consuming too much cpu. +- Get coverity to ignore this warning. +- Change example code to use fgets instead of gets +- LOG: pass the result of qb_log_thread_start() back to the user +- Fix some issues found by clang +- Add clang-analyzer check +- Add a split timer to the stopwatch. +- IPC: merge common code into new function +- IPC: better handle a disconnect been called from within connection_created() +- IPC: fix scary typo +- IPC: fix server error handling + +* Mon Feb 06 2012 Angus Salkeld - 0.9.0-2 +- Fix a spin in the mainloop when a timer or poll gets removed + When in the job queue (#787196). + +* Fri Jan 27 2012 Angus Salkeld - 0.9.0-1 +- Rebased to 0.9.0 + +* Tue Jan 10 2012 Angus Salkeld - 0.8.1-2 +- fix qb_timespec_add_ms() + +* Thu Jan 5 2012 Angus Salkeld - 0.8.1-1 +- Rebased to 0.8.1 (#771914) + +* Wed Nov 17 2011 Angus Salkeld - 0.7.0-1 +- Rebased to 0.7.0 (#754610) + +* Thu Sep 1 2011 Angus Salkeld - 0.6.0-2 +- LOG: fix the default syslog filter + +* Tue Aug 30 2011 Angus Salkeld - 0.6.0-1 +- Rebased to 0.6.0 which includes (#734457): +- Add a stop watch +- LOG: serialize the va_list, don't snprintf +- LOG: change active list into array access +- atomic: fix qb_atomic_pointer macros +- LOG: allow the thread priority to be set. +- Fix splint warning on ubuntu 11.04 + +* Mon Jul 18 2011 Angus Salkeld - 0.5.1-1 +- Rebased to 0.5.1 which includes: +- LOOP: make the return more consistent in qb_loop_timer_expire_time_get() +- LOG: add string.h to qblog.h +- Add a qb_strerror_r wrapper. +- don't let an invalid time stamp provoke a NULL dereference +- LOG: move priority check up to prevent unnecessary format. +- rename README to README.markdown + +* Wed Jun 8 2011 Angus Salkeld - 0.5.0-1 +- Rebased to 0.5.0 which includes: +- new logging API +- support for sparc +- coverity fixes + +* Tue Feb 8 2011 Angus Salkeld - 0.4.1-2 +- SPEC: improve devel files section +- SPEC: remove global variables + +* Mon Jan 31 2011 Angus Salkeld - 0.4.1-1 +- SPEC: add procps to BuildRequire +- SPEC: remove automake and autoconf from BuildRequire +- SPEC: remove call to ./autogen.sh +- SPEC: update to new upstream version 0.4.1 +- LOOP: check read() return value +- DOCS: add missing @param on new timeout argument +- BUILD: only set -g and -O options if explicitly requested. +- BUILD: Remove unneccessary check for library "dl" +- BUILD: improve the release build system + +* Fri Jan 14 2011 Angus Salkeld - 0.4.0-2 +- remove "." from Summary +- Add "check-devel to BuildRequires +- Add "make check" to check section +- Changed a buildroot to RPM_BUILD_ROOT +- Document alphatag, numcomm and dirty variables. + +* Sun Jan 09 2011 Angus Salkeld - 0.4.0-1 +- Initial release