diff --git a/.dlm.metadata b/.dlm.metadata new file mode 100644 index 0000000..5098f65 --- /dev/null +++ b/.dlm.metadata @@ -0,0 +1 @@ +a8fef90c11d7da2a9420eb19aab221952686881c SOURCES/dlm-4.1.1.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e73fad4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/dlm-4.1.1.tar.gz diff --git a/SOURCES/0001-dlm_controld-fix-printf-args-in-log-messages.patch b/SOURCES/0001-dlm_controld-fix-printf-args-in-log-messages.patch new file mode 100644 index 0000000..45aee1f --- /dev/null +++ b/SOURCES/0001-dlm_controld-fix-printf-args-in-log-messages.patch @@ -0,0 +1,48 @@ +From 4f6e9461edb571577eebb712e676eec4c7edd5ec Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Tue, 8 Feb 2022 09:54:06 -0600 +Subject: [PATCH 1/5] dlm_controld: fix printf args in log messages + +Fix log message arg types in two recent commits: + +dcc945a9d40b90a7b13d7f826f2726f35921f95b + "dlm_controld: use uint64_t for cluster ringid" + +b0222892f0b82ff680d4b3f9ac4250f47300d897 + "dlm_controld: add support for per nodeid configuration" +--- + dlm_controld/cpg.c | 2 +- + dlm_controld/node_config.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c +index f3365ee4cd77..b9f9a16b8ae0 100644 +--- a/dlm_controld/cpg.c ++++ b/dlm_controld/cpg.c +@@ -450,7 +450,7 @@ static int check_ringid_done(struct lockspace *ls) + but that's probably not guaranteed.) */ + + if (ls->cpg_ringid_wait) { +- log_group(ls, "check_ringid wait cluster %u cpg %llu:%llu", ++ log_group(ls, "check_ringid wait cluster %llu cpg %u:%llu", + (unsigned long long)cluster_ringid_seq, + ls->cpg_ringid.nodeid, + (unsigned long long)ls->cpg_ringid.seq); +diff --git a/dlm_controld/node_config.c b/dlm_controld/node_config.c +index fe794be72f22..9845e8988e8c 100644 +--- a/dlm_controld/node_config.c ++++ b/dlm_controld/node_config.c +@@ -58,8 +58,8 @@ int node_config_init(const char *path) + } + nc[nodeid].mark = mark; + +- log_debug("parsed node config id=%d mark=%" PRIu32, +- nodeid, mark); ++ log_debug("parsed node config id=%d mark=%llu", ++ nodeid, (unsigned long long)mark); + } + } + +-- +2.7.5 + diff --git a/SOURCES/0002-stonith_helper-Don-t-link-dlm_stonith-against-libxml.patch b/SOURCES/0002-stonith_helper-Don-t-link-dlm_stonith-against-libxml.patch new file mode 100644 index 0000000..6dbb187 --- /dev/null +++ b/SOURCES/0002-stonith_helper-Don-t-link-dlm_stonith-against-libxml.patch @@ -0,0 +1,36 @@ +From c745ac4ce06df71b13c5901aa2e6c3772f3661dd Mon Sep 17 00:00:00 2001 +From: Alexander Aring +Date: Thu, 2 Dec 2021 13:27:26 -0500 +Subject: [PATCH 2/5] stonith_helper: Don't link dlm_stonith against libxml2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Took it from the debian patches. There is no need to link against +libxml2 for the stonith_helper tool. + +Reported-by: Ferenc Wágner +--- + fence/Makefile | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/fence/Makefile b/fence/Makefile +index 2b080468eaa0..547f7ba946ff 100644 +--- a/fence/Makefile ++++ b/fence/Makefile +@@ -18,12 +18,10 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ + -fstack-clash-protection -Wl,-z,now + + CFLAGS += -fPIE -DPIE +-CFLAGS += `xml2-config --cflags` + CFLAGS += -I../include + CFLAGS += $(shell pkg-config --cflags pacemaker-fencing) + + LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie +-LDFLAGS += `xml2-config --libs` + LDFLAGS += -ldl + + all: $(BIN_TARGET) +-- +2.7.5 + diff --git a/SOURCES/0003-treewide-do-always-Wl-z-now-in-LDFLAGS.patch b/SOURCES/0003-treewide-do-always-Wl-z-now-in-LDFLAGS.patch new file mode 100644 index 0000000..f6bf80f --- /dev/null +++ b/SOURCES/0003-treewide-do-always-Wl-z-now-in-LDFLAGS.patch @@ -0,0 +1,106 @@ +From 681b54fd40b7a5e5c960bbd3e8aedca0fd4db575 Mon Sep 17 00:00:00 2001 +From: Alexander Aring +Date: Tue, 8 Feb 2022 14:42:53 -0500 +Subject: [PATCH 3/5] treewide: do always -Wl,-z,now in LDFLAGS + +This patch reverts commit 7bb5570a ("treewide: try to resolve symbols at +linking time") because the recommended way to avoid security related +issues is always to use -Wl,-z,now. + +This is solving the following annocheck failure: + +https://sourceware.org/annobin/annobin.html/Test-bind-now.html +--- + dlm_controld/Makefile | 6 +++--- + dlm_tool/Makefile | 4 ++-- + fence/Makefile | 4 ++-- + libdlm/Makefile | 7 +++---- + 4 files changed, 10 insertions(+), 11 deletions(-) + +diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile +index 8cfc97e6909a..a92fdebe2cba 100644 +--- a/dlm_controld/Makefile ++++ b/dlm_controld/Makefile +@@ -43,15 +43,15 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ + -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \ + -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \ + -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \ +- -fstack-clash-protection -Wl,-z,now ++ -fstack-clash-protection + + BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE + BIN_CFLAGS += -I../include -I../libdlm + LIB_CFLAGS += $(CFLAGS) -fPIC + +-BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,defs -pie ++BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -pie + BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum -luuid +-LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,defs -pie ++LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -pie + + PKG_CONFIG ?= pkg-config + ifeq ($(USE_SD_NOTIFY),yes) +diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile +index 7b42638c0e4a..1c3d61d5c860 100644 +--- a/dlm_tool/Makefile ++++ b/dlm_tool/Makefile +@@ -15,12 +15,12 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ + -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \ + -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \ + -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \ +- -fstack-clash-protection -Wl,-z,now ++ -fstack-clash-protection + + CFLAGS += -fPIE -DPIE + CFLAGS += -I../include -I../libdlm -I../dlm_controld + +-LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie ++LDFLAGS += -Wl,-z,relro -Wl,-z,now -pie + LDFLAGS += -L../libdlm -L../dlm_controld + LDFLAGS += -lpthread -ldlm -ldlmcontrol + +diff --git a/fence/Makefile b/fence/Makefile +index 547f7ba946ff..ee4dfb886d4c 100644 +--- a/fence/Makefile ++++ b/fence/Makefile +@@ -15,13 +15,13 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ + -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \ + -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \ + -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \ +- -fstack-clash-protection -Wl,-z,now ++ -fstack-clash-protection + + CFLAGS += -fPIE -DPIE + CFLAGS += -I../include + CFLAGS += $(shell pkg-config --cflags pacemaker-fencing) + +-LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie ++LDFLAGS += -Wl,-z,relro -Wl,-z,now -pie + LDFLAGS += -ldl + + all: $(BIN_TARGET) +diff --git a/libdlm/Makefile b/libdlm/Makefile +index 313c2a08f17e..5069ccf1f7f9 100644 +--- a/libdlm/Makefile ++++ b/libdlm/Makefile +@@ -78,14 +78,13 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ + -fexceptions \ + -fasynchronous-unwind-tables \ + -fdiagnostics-show-option \ +- -fPIC \ +- -Wl,-z,now ++ -fPIC + + LIB_CFLAGS += $(CFLAGS) -D_REENTRANT + LLT_CFLAGS += $(CFLAGS) + +-LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,defs +-LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,defs ++LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,now ++LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,now + + all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC) + +-- +2.7.5 + diff --git a/SPECS/dlm.spec b/SPECS/dlm.spec new file mode 100644 index 0000000..250195c --- /dev/null +++ b/SPECS/dlm.spec @@ -0,0 +1,268 @@ +Name: dlm +Version: 4.1.1 +Release: 2%{?dist} +License: GPLv2 and GPLv2+ and LGPLv2+ +# For a breakdown of the licensing, see README.license +Summary: dlm control daemon and tool +URL: https://pagure.io/dlm +BuildRequires: gcc +BuildRequires: glibc-kernheaders +BuildRequires: corosynclib-devel >= 3.1.0 +BuildRequires: pacemaker-libs-devel >= 1.1.7 +BuildRequires: libxml2-devel +BuildRequires: systemd-units +BuildRequires: systemd-devel +BuildRequires: make +Source0: https://releases.pagure.org/dlm/%{name}-%{version}.tar.gz + +Patch0: 0001-dlm_controld-fix-printf-args-in-log-messages.patch +Patch1: 0002-stonith_helper-Don-t-link-dlm_stonith-against-libxml.patch +Patch2: 0003-treewide-do-always-Wl-z-now-in-LDFLAGS.patch + + +%if 0%{?rhel} && 0%{?rhel} <= 7 +ExclusiveArch: i686 x86_64 +%endif + +Requires: %{name}-lib = %{version}-%{release} +Requires: corosync >= 3.1.0 +%{?fedora:Requires: kernel-modules-extra} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +Conflicts: cman + +%description +The kernel dlm requires a user daemon to control membership. + +%prep +%setup -q +%patch0 -p1 -b .backup0 +%patch1 -p1 -b .backup1 +%patch2 -p1 -b .backup2 + +%build +# upstream does not require configure +# upstream does not support _smp_mflags +CFLAGS=$RPM_OPT_FLAGS make +CFLAGS=$RPM_OPT_FLAGS make -C fence + +%install +rm -rf $RPM_BUILD_ROOT +make install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT +make -C fence install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT + +install -Dm 0644 init/dlm.service %{buildroot}%{_unitdir}/dlm.service +install -Dm 0644 init/dlm.sysconfig %{buildroot}/etc/sysconfig/dlm + +%post +%systemd_post dlm.service + +%preun +%systemd_preun dlm.service + +%postun +%systemd_postun_with_restart dlm.service + +%files +%doc README.license +%{_unitdir}/dlm.service +%{_sbindir}/dlm_controld +%{_sbindir}/dlm_tool +%{_sbindir}/dlm_stonith +%{_mandir}/man8/dlm* +%{_mandir}/man5/dlm* +%{_mandir}/man3/*dlm* +%config(noreplace) %{_sysconfdir}/sysconfig/dlm + +%package lib +Summary: Library for %{name} +Conflicts: clusterlib + +%description lib +The %{name}-lib package contains the libraries needed to use the dlm +from userland applications. + +%ldconfig_scriptlets lib + +%files lib +/usr/lib/udev/rules.d/*-dlm.rules +%{_libdir}/libdlm*.so.* + +%package devel +Summary: Development files for %{name} +Requires: %{name}-lib = %{version}-%{release} +Conflicts: clusterlib-devel + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%files devel +%{_libdir}/libdlm*.so +%{_includedir}/libdlm*.h +%{_libdir}/pkgconfig/*.pc + +%changelog +* Tue Feb 15 2022 David Teigland - 4.1.1-2 +- compiler warnings and makefile flags + +* Mon Nov 15 2021 David Teigland - 4.1.1-1 +- new upstream version + +* Wed Aug 25 2021 David Teigland - 4.0.9-7 +- fix pacemaker header + +* Mon Aug 09 2021 Mohan Boddu - 4.0.9-6 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Thu Apr 15 2021 Mohan Boddu - 4.0.9-5 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 4.0.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 4.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 4.0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 31 2019 David Teigland - 4.0.9-1 +- New upstream realease + +* Wed Jul 24 2019 Fedora Release Engineering - 4.0.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 4.0.6-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 4.0.6-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat Mar 24 2018 Richard W.M. Jones - 4.0.6-8 +- Fixes for glibc 2.27, required for riscv64. + +* Wed Feb 07 2018 Fedora Release Engineering - 4.0.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Oct 10 2017 Troy Dawson - 4.0.6-5 +- Cleanup spec file conditionals + +* Wed Aug 02 2017 Fedora Release Engineering - 4.0.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 4.0.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 4.0.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jun 10 2016 David Teigland - 4.0.6-2 +- try fixing broken libsystemd + +* Fri Jun 10 2016 David Teigland - 4.0.6-1 +- New upstream release + +* Tue Apr 26 2016 David Teigland - 4.0.5-1 +- New upstream release + +* Mon Feb 22 2016 David Teigland - 4.0.4-1 +- New upstream release dlm-4.0.4 + +* Wed Feb 03 2016 Fedora Release Engineering - 4.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 4.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Aug 16 2014 Fedora Release Engineering - 4.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 4.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 4.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Mar 06 2013 David Teigland - 4.0.1-1 +- New usptream release, fencing fixes + +* Wed Feb 13 2013 Fedora Release Engineering - 4.0.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 06 2012 David Teigland - 4.0.0-1 +- New upstream release, systemd fixes + +* Wed Sep 05 2012 Václav Pavlín - 3.99.5-7 +- Scriptlets replaced with new systemd macros (#850093) + +* Tue Aug 28 2012 David Teigland - 3.99.5-6 +- only fedora requires kernel-modules-extra + +* Thu Aug 16 2012 David Teigland - 3.99.5-5 +- dlm_controld: remove fence_all from cli + +* Thu Aug 16 2012 David Teigland - 3.99.5-4 +- dlm_stonith: include errno.h + +* Thu Aug 16 2012 David Teigland - 3.99.5-3 +- dlm_controld: fix uninitialized mem for fence_all config + +* Wed Jul 18 2012 Fedora Release Engineering - 3.99.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jun 21 2012 David Teigland - 3.99.5-1 +- New upstream release + +* Wed May 30 2012 David Teigland - 3.99.4-2 +- Limit rhel arches + +* Mon May 21 2012 David Teigland - 3.99.4-1 +- New upstream release + +* Mon May 14 2012 David Teigland - 3.99.3-1 +- New upstream release + +* Wed Apr 11 2012 Fabio M. Di Nitto - 3.99.2-1 +- New upstream release + +* Thu Mar 29 2012 Fabio M. Di Nitto - 3.99.1-4 +- Merge back from F17 + +* Wed Mar 21 2012 David Teigland - 3.99.1-3 +- Fix dlm_stonith linking + +* Wed Mar 21 2012 David Teigland - 3.99.1-2 +- Require pacemaker-libs-devel to build dlm_stonith + +* Wed Mar 21 2012 David Teigland - 3.99.1-1 +- Update to 3.99.1 + +* Fri Mar 16 2012 Fabio M. Di Nitto - 3.99.0-8 +- Rebuild against new corosync (soname change). + +* Thu Feb 16 2012 Fabio M. Di Nitto - 3.99.0-7 +- Update to upstream HEAD 2ad89c869git. +- Bump BuildRequires and Requires to new corosync + +* Mon Feb 13 2012 Fabio M. Di Nitto - 3.99.0-6 +- Fix init/systemd service to use /etc/sysconfig/dlm + +* Mon Feb 6 2012 Fabio M. Di Nitto - 3.99.0-5 +- Fix systemd service to recognize /etc/sysconfig/dlm_controld + +* Fri Feb 3 2012 Fabio M. Di Nitto - 3.99.0-4 +- Fix systemd service to modprobe dlm + +* Fri Feb 3 2012 Fabio M. Di Nitto - 3.99.0-3 +- Add patch to fix udev rules and make sure dlm_controld can find + its devices + +* Thu Feb 2 2012 Fabio M. Di Nitto - 3.99.0-2 +- Add Conflicts with clusterlib/cman as necessary + +* Tue Jan 24 2012 David Teigland - 3.99.0-1 +- initial package +