commit 92a5b51f9d3b65675dad85400b1bfecd779e22da Author: MSVSphere Packaging Team Date: Fri Oct 25 19:16:27 2024 +0300 import sbd-1.5.2-1.el10.3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6902017 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sbd-cf5c2208bad2db2dff9b09624b89b05415c3bc11.tar.gz diff --git a/.sbd.metadata b/.sbd.metadata new file mode 100644 index 0000000..7aabdc0 --- /dev/null +++ b/.sbd.metadata @@ -0,0 +1 @@ +e8adcf4624bdebd17e112f3edc973b430c9c9e5c SOURCES/sbd-cf5c2208bad2db2dff9b09624b89b05415c3bc11.tar.gz diff --git a/SOURCES/0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch b/SOURCES/0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch new file mode 100644 index 0000000..3b0696a --- /dev/null +++ b/SOURCES/0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch @@ -0,0 +1,84 @@ +From 030d7edb179235b7df65ada3a79837b01e682a5b Mon Sep 17 00:00:00 2001 +From: Klaus Wenninger +Date: Thu, 21 Jul 2022 10:48:21 +0200 +Subject: [PATCH] Fix: query-watchdog: avoid issues on heap allocation failing + +coverity is moaning either due to slight code rearangement +or new version/settings. +--- + src/sbd-common.c | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/src/sbd-common.c b/src/sbd-common.c +index f3f226a..3abf75f 100644 +--- a/src/sbd-common.c ++++ b/src/sbd-common.c +@@ -385,8 +385,17 @@ watchdog_populate_list(void) + struct link_list_item *lli = + calloc(1, sizeof(struct link_list_item)); + ++ if (lli == NULL) { ++ break; ++ } + lli->dev_node = strdup(buf); + lli->link_name = strdup(entry_name); ++ if ((lli->dev_node == NULL) || (lli->link_name == NULL)) { ++ free(lli->dev_node); ++ free(lli->link_name); ++ free(lli); ++ break; ++ } + lli->next = link_list; + link_list = lli; + } +@@ -404,18 +413,27 @@ watchdog_populate_list(void) + if(!stat(entry_name, &statbuf) && S_ISCHR(statbuf.st_mode) && + is_watchdog(statbuf.st_rdev)) { + +- int wdfd = watchdog_init_fd(entry_name, -1); ++ int wdfd; + struct watchdog_list_item *wdg = + calloc(1, sizeof(struct watchdog_list_item)); + int len; + struct link_list_item *tmp_list = NULL; + ++ if (wdg == NULL) { ++ break; ++ } ++ + wdg->dev = statbuf.st_rdev; + wdg->dev_node = strdup(entry_name); ++ if (wdg->dev_node == NULL) { ++ free(wdg); ++ break; ++ } + wdg->next = watchdog_list; + watchdog_list = wdg; + watchdog_list_items++; + ++ wdfd = watchdog_init_fd(entry_name, -1); + if (wdfd >= 0) { + struct watchdog_info ident; + +@@ -450,11 +468,18 @@ watchdog_populate_list(void) + struct watchdog_list_item *dupe_wdg = + calloc(1, sizeof(struct watchdog_list_item)); + ++ if (dupe_wdg == NULL) { ++ break; ++ } + /* as long as we never purge watchdog_list + * there is no need to dupe strings + */ + *dupe_wdg = *wdg; + dupe_wdg->dev_node = strdup(tmp_list->link_name); ++ if (dupe_wdg->dev_node == NULL) { ++ free(dupe_wdg); ++ break; ++ } + dupe_wdg->next = watchdog_list; + watchdog_list = dupe_wdg; + watchdog_list_items++; +-- +2.39.0 + diff --git a/SOURCES/0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch b/SOURCES/0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch new file mode 100644 index 0000000..81cf444 --- /dev/null +++ b/SOURCES/0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch @@ -0,0 +1,56 @@ +From 48c9a11e5b4ace22011e51d4c5dcacaddf9bbc43 Mon Sep 17 00:00:00 2001 +From: Klaus Wenninger +Date: Fri, 3 Feb 2023 10:58:10 +0100 +Subject: [PATCH] Refactor: sbd-md: alloc/de-alloc reverse order + +Having de-allocation in the reverse order compared to +allocation seems to make gcc-12 static analysis of +dynamic-memory-management happy. +--- + src/sbd-md.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/sbd-md.c b/src/sbd-md.c +index 7a37522..2a237ad 100644 +--- a/src/sbd-md.c ++++ b/src/sbd-md.c +@@ -441,9 +441,9 @@ init_device(struct sbd_context *st) + } + } + +-out: free(s_node); ++out: free(s_mbox); ++ free(s_node); + free(s_header); +- free(s_mbox); + return(rc); + } + +@@ -556,9 +556,9 @@ slot_allocate(struct sbd_context *st, const char *name) + } + } + +-out: free(s_node); ++out: free(s_mbox); ++ free(s_node); + free(s_header); +- free(s_mbox); + return(rc); + } + +@@ -1279,11 +1279,10 @@ int servant_md(const char *diskname, int mode, const void* argp) + } + } + out: +- free(s_header); + free(s_node); + free(s_mbox); ++ free(s_header); + close_device(st); + exit(rc); + } + +- +-- +2.39.0 + diff --git a/SOURCES/0003-spec-convert-license-naming-to-SPDX.patch b/SOURCES/0003-spec-convert-license-naming-to-SPDX.patch new file mode 100644 index 0000000..5d3eddc --- /dev/null +++ b/SOURCES/0003-spec-convert-license-naming-to-SPDX.patch @@ -0,0 +1,34 @@ +From 0e4534ebdfe8d7a37beb0028e604e560a5674891 Mon Sep 17 00:00:00 2001 +From: Klaus Wenninger +Date: Fri, 3 Feb 2023 15:35:22 +0100 +Subject: [PATCH] spec: convert license naming to SPDX + +--- + sbd.spec | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sbd.spec b/sbd.spec +index e9ff7bc..b9e7f72 100644 +--- a/sbd.spec ++++ b/sbd.spec +@@ -49,7 +49,7 @@ + + Name: sbd + Summary: Storage-based death +-License: GPLv2+ ++License: GPL-2.0-or-later + Group: System Environment/Daemons + Version: 1.5.2 + Release: 99.%{buildnum}.%{shortcommit}.%{modified}git%{?dist} +@@ -95,7 +95,7 @@ Available rpmbuild rebuild options: + + %package tests + Summary: Storage-based death environment for regression tests +-License: GPLv2+ ++License: GPL-2.0-or-later + Group: System Environment/Daemons + + %description tests +-- +2.39.0 + diff --git a/SPECS/sbd.spec b/SPECS/sbd.spec new file mode 100644 index 0000000..4ed4d3c --- /dev/null +++ b/SPECS/sbd.spec @@ -0,0 +1,316 @@ +# +# spec file for package sbd +# +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 Lars Marowsky-Bree +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# +%global longcommit cf5c2208bad2db2dff9b09624b89b05415c3bc11 +%global shortcommit %(echo %{longcommit}|cut -c1-8) +%global modified %(echo %{longcommit}-|cut -f2 -d-) +%global github_owner Clusterlabs +%global buildnum 1 + +%ifarch s390x s390 +# minimum timeout on LPAR diag288 watchdog is 15s +%global watchdog_timeout_default 15 +%else +%global watchdog_timeout_default 5 +%endif + +# Be careful with sync_resource_startup_default +# being enabled. This configuration has +# to be in sync with configuration in pacemaker +# where it is called sbd_sync - assure by e.g. +# mutual rpm dependencies. +%bcond_without sync_resource_startup_default +# Syncing enabled per default will lead to +# syncing enabled on upgrade without adaption +# of the config. +# Setting can still be overruled via sysconfig. +# The setting in the config-template packaged +# will follow the default if below is is left +# empty. But it is possible to have the setting +# in the config-template deviate from the default +# by setting below to an explicit 'yes' or 'no'. +%global sync_resource_startup_sysconfig "" + +Name: sbd +Summary: Storage-based death +License: GPL-2.0-or-later +Version: 1.5.2 +Release: %{buildnum}%{?dist}.3 +Url: https://github.com/%{github_owner}/%{name} +Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz +Patch0: 0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch +Patch1: 0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch +Patch2: 0003-spec-convert-license-naming-to-SPDX.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libuuid-devel +BuildRequires: glib2-devel +BuildRequires: libaio-devel +BuildRequires: corosync-devel +BuildRequires: pacemaker-libs-devel +BuildRequires: libtool +BuildRequires: libuuid-devel +BuildRequires: libxml2-devel +BuildRequires: pkgconfig +BuildRequires: make +BuildRequires: systemd +Conflicts: fence-agents-sbd < 4.5.0 +Conflicts: pacemaker-libs < 2.1.0-6 + +%if 0%{?rhel} +ExclusiveArch: i686 x86_64 s390x aarch64 ppc64le +%endif + +%if %{defined systemd_requires} +%systemd_requires +%endif + +%description + +This package contains the storage-based death functionality. + +Available rpmbuild rebuild options: + --with(out) : sync_resource_startup_default + +%package tests +Summary: Storage-based death environment for regression tests +License: GPL-2.0-or-later + +%description tests +This package provides an environment + testscripts for +regression-testing sbd. + +########################################################### + +%prep +%autosetup -n %{name}-%{longcommit} -p1 + +########################################################### + +%build +./autogen.sh +export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror" +%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \ + --with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \ + --with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \ + --with-runstatedir=%{_rundir} +make %{?_smp_mflags} + +########################################################### + +%install + +make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install +rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith + +install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh +%if %{defined _unitdir} +install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service +install -D -m 0644 src/sbd_remote.service $RPM_BUILD_ROOT/%{_unitdir}/sbd_remote.service +%endif + +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig +install -m 644 src/sbd.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/sbd + +# Don't package static libs +find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f +find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f + +########################################################### + +%if %{defined _unitdir} +%post +%systemd_post sbd.service +%systemd_post sbd_remote.service +if [ $1 -ne 1 ] ; then + if systemctl --quiet is-enabled sbd.service 2>/dev/null + then + systemctl --quiet reenable sbd.service 2>/dev/null || : + fi + if systemctl --quiet is-enabled sbd_remote.service 2>/dev/null + then + systemctl --quiet reenable sbd_remote.service 2>/dev/null || : + fi +fi + +%preun +%systemd_preun sbd.service +%systemd_preun sbd_remote.service + +%postun +%systemd_postun sbd.service +%systemd_postun sbd_remote.service +%endif + +%files +########################################################### +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/sysconfig/sbd +%{_sbindir}/sbd +%{_datadir}/sbd +%{_datadir}/pkgconfig/sbd.pc +%exclude %{_datadir}/sbd/regressions.sh +%doc %{_mandir}/man8/sbd* +%if %{defined _unitdir} +%{_unitdir}/sbd.service +%{_unitdir}/sbd_remote.service +%endif +%doc COPYING + +%files tests +########################################################### +%defattr(-,root,root) +%dir %{_datadir}/sbd +%{_datadir}/sbd/regressions.sh +%{_libdir}/libsbdtestbed* + +%changelog +* Mon Jun 24 2024 Troy Dawson - 1.5.2-1.3 +- Bump release for June 2024 mass rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 1.5.2-1.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 1.5.2-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Feb 3 2023 Klaus Wenninger - 1.5.2-1 +- rebase to upstream v1.5.2 +- convert license naming to SPDX +- make static analysis happy with a few checks & rearanges with + dynamic-memory-management + +* Sat Jan 21 2023 Fedora Release Engineering - 1.5.1-2.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1.5.1-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jan 31 2022 Klaus Wenninger - 1.5.1-2 +- Having de-allocation in the reverse order compared to + allocation seems to make gcc-12 static analysis of + dynamic-memory-management happy. + +* Sat Jan 22 2022 Fedora Release Engineering - 1.5.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Nov 19 2021 Klaus Wenninger - 1.5.1-1 +- sync with upstream spec-file +- Rebase to upstream v1.5.1 +- added policy for rhel to gating + +* Fri Jul 23 2021 Fedora Release Engineering - 1.5.0-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jul 6 2021 Klaus Wenninger - 1.5.0-1 +- sync with upstream spec-file +- Rebase to upstream v1.5.0 +- added fix from upstream for build-regression +- added fix from upstream for handling leading space in devices + +* Wed Jan 27 2021 Fedora Release Engineering - 1.4.2-3.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Dec 7 2020 Klaus Wenninger - 1.4.2-3 +- this time really remove dist.depcheck from gating + +* Mon Dec 7 2020 Klaus Wenninger - 1.4.2-2 +- remove deprecated dist.depcheck from gating +- add tier0 to push_stable to have rawhide gated as well + +* Mon Dec 7 2020 Klaus Wenninger - 1.4.2-1 +- Rebase to upstream v1.4.2 +- Conflict with pacemaker that doesn't have pacemakerd-api +- Set default to not do startup/shutdown-syncing via pacemakerd-api + but enable in template-config + +* Wed Jul 29 2020 Fedora Release Engineering - 1.4.1-7.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu May 14 2020 Klaus Wenninger - 1.4.1-7 +- Rebuild against libqb2.0 (f33-build-side-23348) + +* Wed Mar 11 2020 Klaus Wenninger - 1.4.1-6 +- Rebuild because tagging the build failed + +* Thu Mar 5 2020 Klaus Wenninger - 1.4.1-5 +- Rebase to upstream v1.4.1 +- Make coverity happy with parameter passing in regressions.sh +- Add auto generated environment section to man-page +- Overhaul setting scheduler policy/priority +- Enable Fedora CI Gating + +* Thu Jan 30 2020 Fedora Release Engineering - 1.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 1 2019 Klaus Wenninger - 1.4.0-1 +- Rebase to upstream v1.4.0 +- Fail earlier on invalid servants (solves GCC9 build issue as well) + +* Wed Nov 21 2018 Klaus Wenninger - 1.3.1-1.git4927571 +- Rebased to commit 4927571f8e9b00db8242654b1329dfbd71dcfe99 +- Removed disabling of shared-disk-support + Resolves rhbz#1606301 + +* Sat Jul 14 2018 Fedora Release Engineering - 1.2.1-4.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sun Mar 18 2018 Iryna Shcherbina - 1.2.1-4.2 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 1.2.1-4.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 30 2018 Merlin Mathesius - 1.2.1-4 +- Patch to use correct C inline function semantics to fix FTBFS (BZ#1424417) + Cleanup spec file conditionals + +* Thu Aug 03 2017 Fedora Release Engineering - 1.2.1-3.4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.2.1-3.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.2.1-3.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.2.1-3.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 19 2016 Jan Pokorný - 1.2.1-3 +- Rebuilt for libpe_status soname bump arising from Pacemaker 1.1.14 + +* Thu Jul 02 2015 Ralf Corsépius - 1.2.1-2 +- Add dist-tag (RHBZ #1237187). + +* Fri Jun 19 2015 Fedora Release Engineering - 1.2.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Oct 30 2014 - 1.2.1-1 +- Correctly enable /proc/pid validation for sbd_lock_running() +- Improved integration with the el7 environment + +* Fri Aug 29 2014 - 1.2.1-0.2.8f912945.git +- Remove some additional SUSE-isms + +* Fri Aug 29 2014 - 1.2.1-0.1.8f912945.git +- Prepare for package review + Resolves: rhbz#1134245