import CS libqb-2.0.8-1.el9

This commit is contained in:
eabdullin 2024-03-28 10:49:07 +00:00
parent 0dbd1841c2
commit 7407fa5c4d
5 changed files with 9 additions and 103 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/libqb-2.0.6.tar.xz SOURCES/libqb-2.0.8.tar.xz

View File

@ -1 +1 @@
a2983bcaf2d5d7faf780db9c964a149eeb5715c0 SOURCES/libqb-2.0.6.tar.xz d15cae54508d05c4bf909724f442492a3788363f SOURCES/libqb-2.0.8.tar.xz

View File

@ -1,46 +0,0 @@
commit 5594d377ac73d37c06bbad1798e87a65f9a12e07
Author: Chrissie Caulfield <ccaulfie@redhat.com>
Date: Fri Nov 25 07:38:20 2022 +0000
ipc: Retry receiving credentials if the the message is short (#476)
ipc: Retry receiving credentials if the the message is short
rhbz#2111711 refers
diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c
index 0ef9bb6..0de7115 100644
--- a/lib/ipc_setup.c
+++ b/lib/ipc_setup.c
@@ -473,11 +473,15 @@ qb_ipcc_us_setup_connect(struct qb_ipcc_connection *c,
return 0;
}
+#define AUTH_RECV_MAX_RETRIES 10
+#define AUTH_RECV_SLEEP_TIME_US 100
+
/* Called from ipcc_connect_continue() when async connect socket is active */
int qb_ipcc_setup_connect_continue(struct qb_ipcc_connection *c, struct qb_ipc_connection_response *r)
{
struct ipc_auth_data *data;
int32_t res;
+ int retry_count = 0;
#ifdef QB_LINUX
int off = 0;
#endif
@@ -486,8 +490,14 @@ int qb_ipcc_setup_connect_continue(struct qb_ipcc_connection *c, struct qb_ipc_c
qb_ipcc_us_sock_close(c->setup.u.us.sock);
return -ENOMEM;
}
-
+retry:
res = qb_ipc_us_recv_msghdr(data);
+ if (res == -EAGAIN && ++retry_count < AUTH_RECV_MAX_RETRIES) {
+ struct timespec ts = {0, AUTH_RECV_SLEEP_TIME_US*QB_TIME_NS_IN_USEC};
+ struct timespec ts_left = {0, 0};
+ nanosleep(&ts, &ts_left);
+ goto retry;
+ }
#ifdef QB_LINUX
setsockopt(c->setup.u.us.sock, SOL_SOCKET, SO_PASSCRED, &off,

View File

@ -1,51 +0,0 @@
commit 1bbaa929b77113532785c408dd1b41cd0521ffc8
Author: Chrissie Caulfield <ccaulfie@redhat.com>
Date: Thu Jul 20 07:19:01 2023 +0100
log: fix potential overflow with long log messages (#490)
qb_vsnprintf_serialize was called with 'max_size' as the
limiting number for the length of the formatted log
message. But the buffer also needs to contain the
log header (given by 'actual_size'), so we now pass
't->max_line_length' as the maximum length of the
formatted log message to limit space to the actual
bytes left
Also added error checks to the blackbox calls at
the end of the test, as these now provide a proper
test that the BB is functioning. Before they were
masking failures.
diff --git a/lib/log_blackbox.c b/lib/log_blackbox.c
index 3e30504..8519a48 100644
--- a/lib/log_blackbox.c
+++ b/lib/log_blackbox.c
@@ -110,8 +110,8 @@ _blackbox_vlogger(int32_t target,
chunk += sizeof(uint32_t);
/* log message */
- msg_len = qb_vsnprintf_serialize(chunk, max_size, cs->format, ap);
- if (msg_len >= max_size) {
+ msg_len = qb_vsnprintf_serialize(chunk, t->max_line_length, cs->format, ap);
+ if (msg_len >= t->max_line_length) {
chunk = msg_len_pt + sizeof(uint32_t); /* Reset */
/* Leave this at QB_LOG_MAX_LEN so as not to overflow the blackbox */
diff --git a/tests/check_log.c b/tests/check_log.c
index 039a4bb..e5abf40 100644
--- a/tests/check_log.c
+++ b/tests/check_log.c
@@ -832,8 +832,10 @@ START_TEST(test_log_long_msg)
qb_log(LOG_INFO, "Message %d %d - %s", lpc, lpc%600, buffer);
}
- qb_log_blackbox_write_to_file("blackbox.dump");
- qb_log_blackbox_print_from_file("blackbox.dump");
+ rc = qb_log_blackbox_write_to_file("blackbox.dump");
+ ck_assert_int_gt(rc, 0);
+ rc = qb_log_blackbox_print_from_file("blackbox.dump");
+ ck_assert_int_le(rc, 0);
unlink("blackbox.dump");
qb_log_fini();
}

View File

@ -2,16 +2,15 @@
%bcond_without testsrpm %bcond_without testsrpm
Name: libqb Name: libqb
Version: 2.0.6 Version: 2.0.8
Release: 4%{?dist} Release: 1%{?dist}
Summary: Library providing high performance logging, tracing, ipc, and poll Summary: Library providing high performance logging, tracing, ipc, and poll
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/ClusterLabs/libqb URL: https://github.com/ClusterLabs/libqb
Source0: https://github.com/ClusterLabs/libqb/releases/download/v%{version}/%{name}-%{version}.tar.xz Source0: https://github.com/ClusterLabs/libqb/releases/download/v%{version}/%{name}-%{version}.tar.xz
Patch0: bz2149647-connretry-recv.patch #Patch0: bz2149647-connretry-recv.patch
Patch1: bz2236171-fix-bb-overflow.patch
BuildRequires: autoconf automake libtool BuildRequires: autoconf automake libtool
BuildRequires: check-devel BuildRequires: check-devel
@ -105,6 +104,10 @@ This package contains a program to create nicely-formatted man pages from Doxyge
%changelog %changelog
* Wed Oct 4 2023 Christine Caulfield <ccaulfie@redhat.com> 2.0.8-1
- Rebase to 2.0.8
Resolves: rhbz#2223950
* Fri Sep 8 2023 Christine Caulfield <ccaulfie@redhat.com> 2.0.6-4 * Fri Sep 8 2023 Christine Caulfield <ccaulfie@redhat.com> 2.0.6-4
- bump rpm version for rhel-exception build - bump rpm version for rhel-exception build
Resolves: rhbz#2230712 Resolves: rhbz#2230712