Compare commits

...

No commits in common. "imports/c8s/booth-1.0-199.2.ac1d34c.git.el8" and "c8" have entirely different histories.

7 changed files with 42 additions and 161 deletions

View File

@ -1 +0,0 @@
4813ede4a6bb517564a3b9f6fe523164a7362c5b SOURCES/booth-1.0-199-ac1d34c.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/booth-1.0-199-ac1d34c.tar.gz
SOURCES/booth-1.1.tar.gz

View File

@ -1,33 +0,0 @@
From 2f944ea46b1b39113a34ca586cd8e3cd8f0d1d70 Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Wed, 3 Jun 2020 15:04:56 +0200
Subject: [PATCH] build: Do not link with pcmk libraries
Patch 4205de05fe337d1b1127fae302e6e6c2f0613ccf introduced better way to
check for pacemaker headers but also usage of PCMK_LIBS when linking
boothd.
This is not needed, because boothd uses just crm/services.h header file
for inclusion of OCF return codes, so patch removes the use of PCMK_LIBS.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
---
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 8598725..4023791 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,7 @@ boothd_SOURCES += auth.c
endif
boothd_LDFLAGS = $(OS_DYFLAGS) -L./
-boothd_LDADD = -lm $(GLIB_LIBS) $(ZLIB_LIBS) $(PCMK_LIBS)
+boothd_LDADD = -lm $(GLIB_LIBS) $(ZLIB_LIBS)
boothd_CFLAGS = $(GLIB_CFLAGS) $(PCMK_CFLAGS)
if !LOGGING_LIBQB
--
2.18.2

View File

@ -1,57 +0,0 @@
From bb58699a47a7b9070d555490f980c33caa3066e9 Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Mon, 8 Jun 2020 15:38:06 +0200
Subject: [PATCH] pacemaker: Handle updated exit code of crm_ticket
crm_ticket included since Pacemaker version 2.0.0-rc2 doesn't return
EPERM (1) error code any longer when ticket is updated without using
--force. Instead new value CRM_EX_INSUFFICIENT_PRIV (4) is used.
This return value is used in the test_atomicity function which is
failing with new enough Pacemaker.
Solution is to check also for return code 4.
Also previously when unexpected code is returned, log contained full
return value as returned by system call. This is not very readable so
use only exit status (WEXITSTATUS) instead.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
---
src/pacemaker.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pacemaker.c b/src/pacemaker.c
index 7e3f9e6..1582fa8 100644
--- a/src/pacemaker.c
+++ b/src/pacemaker.c
@@ -59,6 +59,7 @@ enum atomic_ticket_supported atomicity = UNKNOWN;
* - the old version asks for "Y/N" via STDIN, and returns 0
* when reading "no";
* - the new version just reports an error without asking.
+ * Since 2.0.0-rc2 error code is changed from 1 (EPERM) to 4 (CRM_EX_INSUFFICIENT_PRIV)
*/
static void test_atomicity(void)
{
@@ -86,7 +87,8 @@ static void test_atomicity(void)
log_info("Old \"crm_ticket\" found, using non-atomic ticket updates.");
break;
- case 1:
+ case 1: /* Pacemaker < 2.0.0-rc2 - EPERM */
+ case 4: /* Pacemaker >= 2.0.0-rc2 - CRM_EX_INSUFFICIENT_PRIV */
atomicity = YES;
log_info("New \"crm_ticket\" found, using atomic ticket updates.");
break;
@@ -94,7 +96,7 @@ static void test_atomicity(void)
default:
log_error("Unexpected return value from \"crm_ticket\" (%d), "
"falling back to non-atomic ticket updates.",
- rv);
+ WEXITSTATUS(rv));
atomicity = NO;
}
--
2.18.2

View File

@ -1,30 +0,0 @@
From 35bf0b7b048d715f671eb68974fb6b4af6528c67 Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Mon, 4 Jul 2022 09:39:47 +0200
Subject: [PATCH] Revert "Refactor: main: substitute is_auth_req macro"
This reverts commit da79b8ba28ad4837a0fee13e5f8fb6f89fe0e24c.
authfile != authkey
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index b50a883..b4a174f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -364,7 +364,7 @@ static int setup_config(int type)
if (rv < 0)
goto out;
- if (is_auth_req()) {
+ if (booth_conf->authfile[0] != '\0') {
rv = read_authkey();
if (rv < 0)
goto out;
--
2.37.1

View File

@ -1,6 +1,6 @@
From 466246c2fa8ea1bcc06593fbf7b900d0665606b1 Mon Sep 17 00:00:00 2001
From 87c8545816cca03d19c2f3ef54031940f7e19d50 Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Tue, 26 Jul 2022 18:39:38 +0200
Date: Fri, 18 Nov 2022 11:57:46 +0100
Subject: [PATCH] config: Add enable-authfile option
This option enables (or disables) usage of authfile. Can be 'yes' or 'no'.
@ -31,28 +31,28 @@ Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/docs/boothd.8.txt b/docs/boothd.8.txt
index f58f27e..12f66f9 100644
index 0f3d2c1..c7a8413 100644
--- a/docs/boothd.8.txt
+++ b/docs/boothd.8.txt
@@ -230,6 +230,13 @@ will always bind and listen to both UDP and TCP ports.
parameter to a higher value. The time skew test is performed
only in concert with authentication.
+*'enable-authfile'*::
+'enable-authfile'::
+ Enables (or disables) usage of authfile. Can be 'yes' or 'no'.
+ Default is 'no'.
+ This is non-upstream option used to allow use of authfile without
+ breaking compatibility for clusters consisting of mixed
+ versions of booth.
+
*'site'*::
Defines a site Raft member with the given IP. Sites can
acquire tickets. The sites' IP should be managed by the cluster.
'debug'::
Specifies the debug output level. Alternative to
command line argument. Effective only for 'daemon'
diff --git a/src/config.c b/src/config.c
index 8e41553..b9df3e3 100644
index f0ca4aa..e1f25f0 100644
--- a/src/config.c
+++ b/src/config.c
@@ -729,6 +729,23 @@ no_value:
@@ -732,6 +732,23 @@ no_value:
booth_conf->maxtimeskew = atoi(val);
continue;
}
@ -102,5 +102,5 @@ index b4a174f..0fdb295 100644
if (rv < 0)
goto out;
--
2.37.1
2.27.0

View File

@ -22,22 +22,7 @@
%bcond_with html_man
%bcond_with glue
%bcond_with run_build_tests
# set following to the result of `git describe --abbrev=128 $commit`
# This will be used to fill booth_ver, booth_numcomm and booth_sha1.
# It is important to keep abbrev to get full length sha1! When updating source use
# `spectool -g booth.spec` to download source.
%global git_describe_str v1.0-199-gac1d34ce172678a8f5ba415e976cf2366d45e15e
# Set this to 1 when rebasing (changing git_describe_str) and increase otherwise
%global release 2
# Run shell script to parse git_describe str into version, numcomm and sha1 hash
%global booth_ver %(s=%{git_describe_str}; vver=${s%%%%-*}; echo ${vver:1})
%global booth_numcomm %(s=%{git_describe_str}; t=${s#*-}; echo ${t%%%%-*})
%global booth_sha1 %(s=%{git_describe_str}; t=${s##*-}; echo ${t:1})
%global booth_short_sha1 %(s=%{booth_sha1}; echo ${s:0:7})
%global booth_archive_name %{name}-%{booth_ver}-%{booth_numcomm}-%{booth_short_sha1}
%bcond_without include_unit_test
## User and group to use for nonprivileged services (should be in sync with pacemaker)
%global uname hacluster
@ -55,16 +40,13 @@
%global test_path %{_datadir}/booth/tests
Name: booth
Version: %{booth_ver}
Release: %{booth_numcomm}.%{release}.%{booth_short_sha1}.git%{?dist}
Version: 1.1
Release: 1%{?dist}
Summary: Ticket Manager for Multi-site Clusters
License: GPLv2+
Url: https://github.com/%{github_owner}/%{name}
Source0: https://github.com/%{github_owner}/%{name}/archive/%{booth_short_sha1}/%{booth_archive_name}.tar.gz
Patch0: 0001-build-Do-not-link-with-pcmk-libraries.patch
Patch1: 0002-pacemaker-Handle-updated-exit-code-of-crm_ticket.patch
Patch2: bz2111668-1-Revert-Refactor-main-substitute-is_auth_req-macro.patch
Patch3: bz2111668-2-config-Add-enable-authfile-option.patch
Source0: https://github.com/%{github_owner}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0: rhel-specific-0001-config-Add-enable-authfile-option.patch
# direct build process dependencies
BuildRequires: autoconf
@ -111,7 +93,9 @@ BuildRequires: perl-interpreter net-tools
Requires: %{name}-core%{?_isa}
Requires: %{name}-site
%files
# intentionally empty
%license COPYING
%dir %{_datadir}/pkgconfig
%{_datadir}/pkgconfig/booth.pc
%description
Booth manages tickets which authorize cluster sites located
@ -145,13 +129,13 @@ Support for running Booth, ticket manager for multi-site clusters,
as an arbitrator.
%post arbitrator
%systemd_post booth@.service booth-arbitrator.service
%systemd_post booth-arbitrator.service
%preun arbitrator
%systemd_preun booth@.service booth-arbitrator.service
%systemd_preun booth-arbitrator.service
%postun arbitrator
%systemd_postun_with_restart booth@.service booth-arbitrator.service
%systemd_postun_with_restart booth-arbitrator.service
%package site
Summary: Booth support for running as a full-fledged site
@ -181,7 +165,9 @@ Requires: %{name}-arbitrator = %{version}-%{release}
Requires: %{name}-site = %{version}-%{release}
Requires: gdb
Requires: %{__python3}
%if 0%{?with_include_unit_test}
Requires: python3-pexpect
%endif
# runtests.py suite (for perl and netstat)
Requires: perl-interpreter net-tools
@ -191,7 +177,7 @@ Automated tests for running Booth, ticket manager for multi-site clusters.
# BUILD #
%prep
%autosetup -n %{name}-%{booth_sha1} -S git_am
%autosetup -n %{name}-%{version} -S git_am
%build
./autogen.sh
@ -222,7 +208,11 @@ rm -rf %{buildroot}/%{_pkgdocdir}/COPYING
mkdir -p %{buildroot}/%{test_path}
# Copy tests from tarball
cp -a -t %{buildroot}/%{test_path} \
-- conf test unit-tests script/unit-test.py
-- conf test
%if 0%{?with_include_unit_test}
cp -a -t %{buildroot}/%{test_path} \
-- unit-tests script/unit-test.py
%endif
chmod +x %{buildroot}/%{test_path}/test/booth_path
chmod +x %{buildroot}/%{test_path}/test/live_test.sh
mkdir -p %{buildroot}/%{test_path}/src
@ -305,6 +295,18 @@ VERBOSE=1 make check
%{_usr}/lib/ocf/resource.d/booth/sharedrsc
%changelog
* Thu Nov 23 2023 Jan Friesse <jfriesse@redhat.com> - 1.1-1
- Resolves: RHEL-15265
- New upstream release (RHEL-15265)
- Upstream releases should now be released regularly, so convert spec
to use them instead of git snapshots (RHEL-15265)
* Mon Nov 21 2022 Jan Friesse <jfriesse@redhat.com> - 1.0-283.1.9d4029a.git
- Resolves: rhbz#2135865
- Update to current snapshot (commit 9d4029a) (rhbz#2135865)
* Wed Aug 03 2022 Jan Friesse <jfriesse@redhat.com> - 1.0-199.2.ac1d34c.git
- Resolves: rhbz#2111668