From c15c0c22878c47a6024ca05ed82c2ee21ccd2d81 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Tue, 18 Feb 2020 17:08:15 +0000 Subject: [PATCH 01/14] This release brings el7 in line with master/f32/el8 with 4.4.5. Due to changes in things, it will have a higher bodhi than normal. --- nagios.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nagios.spec b/nagios.spec index cae8324..a263780 100644 --- a/nagios.spec +++ b/nagios.spec @@ -1,9 +1,5 @@ %global _hardened_build 1 -# https://gcc.gnu.org/gcc-10/porting_to.html#common -# attempt to fix bugzilla 1793909 -%define _legacy_common_support 1 - Name: nagios Version: 4.4.5 Release: 3%{?dist} From c3f61646888f15cb911349d090df2442704ce771 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Tue, 18 Feb 2020 18:40:08 +0000 Subject: [PATCH 02/14] Fixes bz#1802242 --- nagios.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nagios.spec b/nagios.spec index a263780..061d2e8 100644 --- a/nagios.spec +++ b/nagios.spec @@ -2,7 +2,7 @@ Name: nagios Version: 4.4.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Host/service/network monitoring program @@ -483,6 +483,10 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Tue Feb 18 2020 Stephen Smoogen - 4.4.5-4 +- Fixes bz#1802242 + + * Tue Feb 18 2020 Stephen Smoogen - 4.4.5-3 - Add change to allow for problems found in mass rebuild and gcc10. - Fix BZ#1793909 From 44c74f14deadd58a28ca37d3cf28b5d84fa71452 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Fri, 28 Feb 2020 22:10:54 -0600 Subject: [PATCH 03/14] Remove parentheses from dependency declaration --- nagios.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nagios.spec b/nagios.spec index ad268d7..46bd17e 100644 --- a/nagios.spec +++ b/nagios.spec @@ -4,7 +4,7 @@ Name: nagios Version: 4.4.5 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Host/service/network monitoring program @@ -89,7 +89,7 @@ Requires: group(nagios) %if 0%{?with_selinux} # This ensures that the *-selinux package and all it’s dependencies are not pulled # into containers and other systems that do not use SELinux -Requires: (%{name}-selinux if selinux-policy-%{selinuxtype}) +Requires: %{name}-selinux if selinux-policy-%{selinuxtype} %endif # if with_selinux Requires(pre): group(nagios) @@ -474,6 +474,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Fri Feb 28 2020 Martin Jackson - 4.4.5-6 +- Change dep declaration for nagios-selinux + * Thu Feb 27 2020 Martin Jackson - 4.4.5-5 - Update selinux subpackage to fix BZ#1749156 - thanks for the patch vmojzis From aeef0be6e7f79ffcc20258d4fcd4feb86021e2f0 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Tue, 7 Apr 2020 11:51:47 -0500 Subject: [PATCH 04/14] Go back to known working build --- nagios.spec | 133 ++++++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/nagios.spec b/nagios.spec index 46bd17e..a263780 100644 --- a/nagios.spec +++ b/nagios.spec @@ -1,10 +1,8 @@ %global _hardened_build 1 -%global with_selinux 1 -%global selinuxtype targeted Name: nagios Version: 4.4.5 -Release: 6%{?dist} +Release: 3%{?dist} Summary: Host/service/network monitoring program @@ -23,9 +21,9 @@ Source10: printer.png Source11: router.png Source12: switch.png Source13: nagios.README.SELinux.rst -Source14: nagios.te -Source15: nagios.fc -Source16: nagios.if +Source14: nagios_epel7.te +Source15: nagios_epel.fc +Source16: nagios_epel6.te # Patch 0 should be a patch that we get from the maint git tree in # order to fix any items upstream wanted. @@ -86,12 +84,6 @@ Requires: nagios-common Requires: user(nagios) Requires: group(nagios) -%if 0%{?with_selinux} -# This ensures that the *-selinux package and all it’s dependencies are not pulled -# into containers and other systems that do not use SELinux -Requires: %{name}-selinux if selinux-policy-%{selinuxtype} -%endif # if with_selinux - Requires(pre): group(nagios) Requires(pre): user(nagios) %if 0%{?rhel} > 6 || 0%{?fedora} > 20 @@ -146,20 +138,17 @@ that you specify. This package provides include files that Nagios-related applications may compile against. -%if 0%{?with_selinux} -# SELinux subpackage +%if 0%{?rhel} > 5 %package selinux Summary: SELinux context for %{name} -Requires: %{name} = %{version}-%{release} -BuildArch: noarch -Requires: selinux-policy-%{selinuxtype} -Requires(post): selinux-policy-%{selinuxtype} -BuildRequires: checkpolicy, selinux-policy-devel -%{?selinux_requires} +Requires: %name = %version-%release +Requires(post): policycoreutils +Requires(postun): policycoreutils + %description selinux -SElinux security policy for %{name}. -%endif # if with_selinux +SElinux context for %{name}. +%endif %package contrib Summary: Eventhandlers contributed to nagios @@ -168,13 +157,6 @@ Requires: %name = %version-%release %description contrib Various contributed items used by plugins and other tools. -%if 0%{?with_selinux} -# SELinux contexts are saved so that only affected files can be -# relabeled after the policy module installation -%pre selinux -%selinux_relabel_pre -s %{selinuxtype} -%endif # if with_selinux - %prep %setup -q -n nagioscore-nagios-%{version} @@ -246,17 +228,19 @@ cp -f %{SOURCE5} UpgradeToVersion4.ReadMe cp -f %{SOURCE6} UpgradeToVersion4.sh echo >> html/stylesheets/common.css -%if 0%{?with_selinux} +%if 0%{?rhel} > 5 +## SELinux configs mkdir selinux -# Shipping the whole nagios policy (originally from selinux-policy-contrib) -# this policy module will override the production module -cp -p %{SOURCE14} selinux/ -cp -p %{SOURCE15} selinux/ -cp -p %{SOURCE16} selinux/ - -make -f %{_datadir}/selinux/devel/Makefile %{name}.pp -bzip2 -9 %{name}.pp -%endif # if with_selinux +install -pm 644 %{SOURCE13} README.SELinux.rst +%if 0%{?rhel} == 6 +cp -p %{SOURCE16} selinux/%{name}_epel.te +%else +cp -p %{SOURCE14} selinux/%{name}_epel.te +%endif +cp -p %{SOURCE15} selinux/%{name}_epel.fc +touch selinux/%{name}_epel.if +make -f %{_datadir}/selinux/devel/Makefile +%endif %install @@ -311,10 +295,10 @@ chmod 755 %{buildroot}%{_sbindir}/nagios install -d -m 0755 %{buildroot}%{_datadir}/nagios/html/docs %{__cp} -a Documentation/html/* %{buildroot}%{_datadir}/nagios/html/docs -%if 0%{?with_selinux} -install -pm 0644 %{SOURCE13} README.SELinux.rst -install -D -m 0644 %{name}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 -%endif # if with_selinux +%if 0%{?rhel} >5 +# Selinux configs +install -p -m 644 -D %{name}_epel.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/%{name}_epel.pp +%endif ### CONTRIB ITEMS TAKEN FROM UPSTREAM NAGIOS SPEC make install -C contrib DESTDIR="%{buildroot}" INSTALL_OPTS="" @@ -394,22 +378,49 @@ fi /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : %endif -%if 0%{?with_selinux} +%if 0%{?rhel} >5 %post selinux -%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 -%selinux_relabel_post -s %{selinuxtype} - +%if 0%{?el5}%{?el6} if [ "$1" -le "1" ]; then # First install + semodule -i %{_datadir}/selinux/packages/%{name}/%{name}_epel.pp 2>/dev/null || : + fixfiles -R %{name} restore || : + /sbin/service %{name} condrestart > /dev/null 2>&1 || : +fi +%else +if [ "$1" -le "1" ]; then # First install + semodule -i %{_datadir}/selinux/packages/%{name}/%{name}_epel.pp 2>/dev/null || : + fixfiles -R %{name} restore || : %systemd_postun_with_restart %{name}.service fi +%endif +%endif -%postun selinux -if [ $1 -eq 0 ]; then - %selinux_modules_uninstall -s %{selinuxtype} %{name} - %selinux_relabel_post -s %{selinuxtype} +%if 0%{?rhel} >5 +%preun selinux +%if 0%{?el6} +if [ "$1" -lt "1" ]; then # Final removal + semodule -r %{name}_epel 2>/dev/null || : + fixfiles -R %{name} restore || : + /sbin/service %{name} condrestart > /dev/null 2>&1 || : +fi +%else +if [ "$1" -lt "1" ]; then # Final removal + semodule -r %{name}_epel 2>/dev/null || : + fixfiles -R %{name} restore || : %systemd_postun_with_restart %{name}.service fi -%endif # if with_selinux +%endif +%endif + +%if 0%{?rhel} >5 +%postun selinux +if [ "$1" -ge "1" ]; then # Upgrade + # Replaces the module if it is already loaded + semodule -i %{_datadir}/selinux/packages/%{name}/%{name}_epel.pp 2>/dev/null || : + # no need to restart the daemon +fi +%endif + %files @@ -460,13 +471,11 @@ fi %{_includedir}/%{name} %attr(0644,root,root) %{_libdir}/%{name}/libnagios.a -%if 0%{?with_selinux} +%if 0%{?rhel} > 5 %files selinux %doc README.SELinux.rst -%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.* -%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name} -%endif # if with_selinux - +%{_datadir}/selinux/packages/%{name}/nagios_epel.pp +%endif %files contrib %doc contrib/README.contrib @@ -474,19 +483,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog -* Fri Feb 28 2020 Martin Jackson - 4.4.5-6 -- Change dep declaration for nagios-selinux - -* Thu Feb 27 2020 Martin Jackson - 4.4.5-5 -- Update selinux subpackage to fix BZ#1749156 - thanks for the patch vmojzis - -* Wed Feb 26 2020 Vit Mojzis - 4.4.5-4 -- Update nagios-selinux based on the DSP guidelines - * Tue Feb 18 2020 Stephen Smoogen - 4.4.5-3 - Add change to allow for problems found in mass rebuild and gcc10. - Fix BZ#1793909 -- Fixes bz#1802242 * Wed Jan 29 2020 Fedora Release Engineering - 4.4.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 25fa25f8b2b44117838164ee7d44ade1bad2d6b2 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Tue, 7 Apr 2020 11:53:46 -0500 Subject: [PATCH 05/14] Update to smooge's last 4.4.5 build --- nagios.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagios.spec b/nagios.spec index a263780..160e42d 100644 --- a/nagios.spec +++ b/nagios.spec @@ -2,7 +2,7 @@ Name: nagios Version: 4.4.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Host/service/network monitoring program From 0c7d8f6a213246a7805d4c8a7fd2bd24fde065b7 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Tue, 7 Apr 2020 12:01:52 -0500 Subject: [PATCH 06/14] Update dist tag --- nagios.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nagios.spec b/nagios.spec index 160e42d..326f59c 100644 --- a/nagios.spec +++ b/nagios.spec @@ -2,7 +2,7 @@ Name: nagios Version: 4.4.5 -Release: 4%{?dist} +Release: 7%{?dist} Summary: Host/service/network monitoring program @@ -483,6 +483,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Tue Apr 7 2020 Martin Jackson - 4.4.5-7 +- Revert to Smooge's last good build + * Tue Feb 18 2020 Stephen Smoogen - 4.4.5-3 - Add change to allow for problems found in mass rebuild and gcc10. - Fix BZ#1793909 From e1ca8bc374b049a625d21bfbbcf3234b68f24571 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sat, 20 Feb 2021 23:50:47 +0100 Subject: [PATCH 07/14] Update to 4.4.6 Fix for CVE-2020-13977 #BZ1849087 Some spec cleanup --- .gitignore | 1 + nagios-0003-Install-config-files-too.patch | 9 ++-- nagios-0009-fix-localstatedir-for-linux.patch | 2 +- nagios-0011-remove-rpmbuild.patch | 35 +++++++++++---- nagios-0015-Changelog.patch | 13 ++++++ nagios.spec | 45 ++++++++----------- sources | 2 +- 7 files changed, 65 insertions(+), 42 deletions(-) create mode 100644 nagios-0015-Changelog.patch diff --git a/.gitignore b/.gitignore index a1b2d77..3ac2d64 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ nagios-3.2.1.tar.gz /nagioscore-nagios-4.4.2.tar.gz /nagioscore-nagios-4.4.3.tar.gz /nagioscore-nagios-4.4.5.tar.gz +/nagioscore-nagios-4.4.6.tar.gz diff --git a/nagios-0003-Install-config-files-too.patch b/nagios-0003-Install-config-files-too.patch index 4bf4aa2..3194a02 100644 --- a/nagios-0003-Install-config-files-too.patch +++ b/nagios-0003-Install-config-files-too.patch @@ -1,7 +1,8 @@ -diff -up ./Makefile.in.install_config ./Makefile.in ---- ./Makefile.in.install_config 2017-04-19 19:11:47.783707415 -0400 -+++ ./Makefile.in 2017-04-19 19:11:47.785707384 -0400 -@@ -377,7 +377,7 @@ dox: +diff --git a/Makefile.in b/Makefile.in +index b992ab1e..ef2a797f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -439,7 +439,7 @@ dox: doxygen doxy.conf diff --git a/nagios-0009-fix-localstatedir-for-linux.patch b/nagios-0009-fix-localstatedir-for-linux.patch index 3c18043..070285f 100644 --- a/nagios-0009-fix-localstatedir-for-linux.patch +++ b/nagios-0009-fix-localstatedir-for-linux.patch @@ -264,9 +264,9 @@ diff -up ./startup/default-service.in.fix_localstatedir ./startup/default-servic ExecStop=@BIN_KILL@ -s TERM ${MAINPID} -ExecStopPost=@BIN_RM@ -f @localstatedir@/rw/nagios.cmd +ExecStopPost=@BIN_RM@ -f @localstatedir@/spool/nagios/cmd/nagios.cmd + ExecReload=@bindir@/nagios -v @sysconfdir@/nagios.cfg ExecReload=@BIN_KILL@ -s HUP ${MAINPID} - [Install] diff -up ./t-tap/Makefile.in.fix_localstatedir ./t-tap/Makefile.in --- ./t-tap/Makefile.in.fix_localstatedir 2019-01-16 14:24:14.944312569 -0600 +++ ./t-tap/Makefile.in 2019-01-16 14:24:42.359858604 -0600 diff --git a/nagios-0011-remove-rpmbuild.patch b/nagios-0011-remove-rpmbuild.patch index 88e0049..401cad0 100644 --- a/nagios-0011-remove-rpmbuild.patch +++ b/nagios-0011-remove-rpmbuild.patch @@ -1,12 +1,14 @@ -diff -up ./contrib/Makefile.in.remove_rpmbuild ./contrib/Makefile.in ---- ./contrib/Makefile.in.remove_rpmbuild 2019-08-29 18:23:14.113160181 +0000 -+++ ./contrib/Makefile.in 2019-08-29 18:24:20.509445391 +0000 -@@ -85,36 +85,3 @@ $(CGI_O): $(CGI_C) +diff --git a/contrib/Makefile.in b/contrib/Makefile.in +index 72e4d4a9..62415152 100644 +--- a/contrib/Makefile.in ++++ b/contrib/Makefile.in +@@ -84,52 +84,3 @@ $(CGI_O): $(CGI_C) + %.cgi : %.c $(CC) $(CFLAGS) $(LDFLAGS) $< $(CGI_O) -o $@ - +- -############################################################################## --# rpm making automation for CentOS/RHEL. +-# making similiar EPEL rpm for Fedora/RHEL/CentOS - -ifneq ("$(wildcard /etc/redhat-release)","") - @@ -25,16 +27,31 @@ diff -up ./contrib/Makefile.in.remove_rpmbuild ./contrib/Makefile.in - endif -endif - --rpm: +-# Create our own tarball and put ino rpmbuild/SOURCES +-localsrc-rpm: - # create nagios tar ball. - @(cd ..;rm -f nagios-@VERSION@) - @(cd ..;ln -s . nagios-@VERSION@) - @(cd ..;tar zhcf nagios-@VERSION@.tar.gz --exclude nagios-@VERSION@/nagios-@VERSION@.tar.gz --exclude nagios-@VERSION@/nagios-@VERSION@ --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .git* nagios-@VERSION@/) - @(cd ..;rm -f nagios-@VERSION@) - # build the rpm using rpmbuild from ./rmbuild as topdir -- @rm -rf rpmbuild && mkdir -p rpmbuild/SOURCES +- @rm -rf rpmbuild && mkdir -p ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - @cp ../nagios-@VERSION@.tar.gz rpmbuild/SOURCES/nagios-@VERSION@.tar.gz -- @rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" ../nagios.spec +- @cp epel-patches/* ./rpmbuild/SOURCES +- @rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" epel-nagios.spec +- @cp rpmbuild/RPMS/$(RPM_ARCH)/*.rpm . +- @cp rpmbuild/SRPMS/*.src.rpm . +- @ls -l *.rpm +- +-# tarball from https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-%{version}/nagios-%{version}.tar.gz +-rpm: init-epelrpm build-epelrpm - @mv rpmbuild/RPMS/$(RPM_ARCH)/*.rpm . - @ls -l *.rpm +-init-epelrpm: +- # build the rpm using rpmbuild from ./rmbuild as topdir +- @rm -rf ./rpmbuild && mkdir -p ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} +- @spectool -C ./rpmbuild/SOURCES -g epel-nagios.spec +- @cp epel-patches/* ./rpmbuild/SOURCES +-build-epelrpm: +- @rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" epel-nagios.spec -endif diff --git a/nagios-0015-Changelog.patch b/nagios-0015-Changelog.patch new file mode 100644 index 0000000..5ef3490 --- /dev/null +++ b/nagios-0015-Changelog.patch @@ -0,0 +1,13 @@ +diff --git a/Changelog b/Changelog +index a5fd04c6..51394645 100644 +--- a/Changelog ++++ b/Changelog +@@ -9,7 +9,7 @@ FIXES + * Fixed duplicate properties appearing in statusjson.cgi (#718) (Sebastian Wolf) + * Fixed NERD not building when enabled in ./configure (#723) (Sebastian Wolf) + * Fixed build process when using GCC 10 (#721) (Michael Orlitzky) +-* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-1408) (Thanks UraSec Team) (Sebastian Wolf) ++* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-13977) (Thanks UraSec Team) (Sebastian Wolf) + * When using systemd, configuration will be verified before reloading (#715) (tatref) + * Fixed HARD OK states triggering on the maximum check attempt (#757) (Sebastian Wolf) + diff --git a/nagios.spec b/nagios.spec index 326f59c..e5cd563 100644 --- a/nagios.spec +++ b/nagios.spec @@ -1,8 +1,8 @@ %global _hardened_build 1 Name: nagios -Version: 4.4.5 -Release: 7%{?dist} +Version: 4.4.6 +Release: 1%{?dist} Summary: Host/service/network monitoring program @@ -46,7 +46,9 @@ Patch11: nagios-0011-remove-rpmbuild.patch Patch12: nagios-0012-fix-spool.patch Patch13: nagios-0013-fix-plugin.patch Patch14: nagios-0014-fix-uidgid.patch +Patch15: %{name}-0015-Changelog.patch +BuildRequires: make BuildRequires: doxygen BuildRequires: gcc BuildRequires: gd-devel > 1.8 @@ -158,23 +160,7 @@ Requires: %name = %version-%release Various contributed items used by plugins and other tools. %prep -%setup -q -n nagioscore-nagios-%{version} - -# patch0 would go here -%patch1 -p1 -b .fix_el6_init -%patch2 -p1 -b .fix_httpd_conf_d -%patch3 -p0 -b .install_config -%patch4 -p1 -b .fix_path_to_cgi -%patch5 -p1 -b .fix_path_to_passwd -%patch6 -p1 -b .more_images - -#%patch8 -p1 -b .conf_d -%patch9 -p1 -b .fix_localstatedir -%patch10 -p1 -b .remove_3rdparty_links -%patch11 -p1 -b .remove_rpmbuild -%patch12 -p1 -b .fix_spool -%patch13 -p1 -b .fix_plugin -%patch14 -p1 -b .fix_uidgid +%autosetup -p1 -n nagioscore-nagios-%{version} install -p -m 0644 %{SOURCE10} %{SOURCE11} %{SOURCE12} html/images/logos/ @@ -213,13 +199,14 @@ install -p -m 0644 %{SOURCE10} %{SOURCE11} %{SOURCE12} html/images/logos/ --with-template-extinfo \ --enable-event-broker \ STRIP=/bin/true -make %{?_smp_mflags} all + +%make_build all ### Build our documentation -%{__make} dox +%make_build dox ### Apparently contrib does not obey configure ! -%{__make} %{?_smp_mflags} -C contrib +%make_build -C contrib sed -e "s|/usr/lib/|%{_libdir}/|" %{SOURCE2} > %{name}.htaccess @@ -244,9 +231,7 @@ make -f %{_datadir}/selinux/devel/Makefile %install -rm -rf $RPM_BUILD_ROOT - -make DESTDIR=%{buildroot} INIT_OPTS="" INSTALL_OPTS="" COMMAND_OPTS="" CGIDIR="%{_libdir}/%{name}/cgi-bin" CFGDIR="%{_sysconfdir}/%{name}" fullinstall +%make_install INIT_OPTS="" INSTALL_OPTS="" COMMAND_OPTS="" CGIDIR="%{_libdir}/%{name}/cgi-bin" CFGDIR="%{_sysconfdir}/%{name}" fullinstall # relocated to sbin (Fedora-specific) install -d -m 0755 %{buildroot}%{_bindir} @@ -301,7 +286,7 @@ install -p -m 644 -D %{name}_epel.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages %endif ### CONTRIB ITEMS TAKEN FROM UPSTREAM NAGIOS SPEC -make install -C contrib DESTDIR="%{buildroot}" INSTALL_OPTS="" +%make_install -C contrib INSTALL_OPTS="" install -p -m 644 contrib/eventhandlers/disable_active_service_checks %{buildroot}%{_libdir}/nagios/plugins/eventhandlers/ install -p -m 644 contrib/eventhandlers/disable_notifications %{buildroot}%{_libdir}/nagios/plugins/eventhandlers/ install -p -m 644 contrib/eventhandlers/enable_active_service_checks %{buildroot}%{_libdir}/nagios/plugins/eventhandlers/ @@ -428,8 +413,9 @@ fi %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/html %doc %{_datadir}/%{name}/html/docs -%doc Changelog INSTALLING LICENSE README.md UPGRADING UpgradeToVersion4.ReadMe UpgradeToVersion4.sh +%doc Changelog INSTALLING README.md UPGRADING UpgradeToVersion4.ReadMe UpgradeToVersion4.sh %doc internet.cfg +%license LICENSE %{_datadir}/%{name}/html/[^cd]* %{_datadir}/%{name}/html/contexthelp/ %{_datadir}/%{name}/html/d3/ @@ -483,6 +469,11 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Sat Feb 20 2021 Guido Aulisi - 4.4.6-1 +- Update to 4.4.6 +- Fix for CVE-2020-13977 #BZ1849087 +- Some spec cleanup + * Tue Apr 7 2020 Martin Jackson - 4.4.5-7 - Revert to Smooge's last good build diff --git a/sources b/sources index fa4ac42..8d9f3c3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nagioscore-nagios-4.4.5.tar.gz) = b2b4213dc9087c49a96506f514ec672476763e1ca928bf5de8494a0509b612a4a357989e719820328095489138375c9db292ac3c8129925c323220860e17bc49 +SHA512 (nagioscore-nagios-4.4.6.tar.gz) = db3a205f1675693301c059b0ecdc767cdc423923cff0729c5584a48e04fb18d6c119d51991dd24290a539eb8578b2cb82316275039b36827871bb028883b495f From 73928bd1faf43d2c64af0640b479c5e714fe2981 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Tue, 23 Feb 2021 21:01:12 +0100 Subject: [PATCH 08/14] Fix systemd unit file permissions #1676334 --- nagios.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nagios.spec b/nagios.spec index e5cd563..4c78293 100644 --- a/nagios.spec +++ b/nagios.spec @@ -2,7 +2,7 @@ Name: nagios Version: 4.4.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Host/service/network monitoring program @@ -271,6 +271,9 @@ install -D -m 0644 -p %{SOURCE8} %{buildroot}%{_tmpfilesdir}/%{name}.conf # Remove SystemV init-script rm -f %{buildroot}%{_initrddir}/nagios + +# Fix systemd unit file permissions #1676334 +chmod -x %{buildroot}%{_unitdir}/%{name}.service %endif # Fix permissions - FIXME remove this when unneeded @@ -469,6 +472,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Tue Feb 23 2021 Guido Aulisi - 4.4.6-2 +- Fix systemd unit file permissions #1676334 + * Sat Feb 20 2021 Guido Aulisi - 4.4.6-1 - Update to 4.4.6 - Fix for CVE-2020-13977 #BZ1849087 From 51381091a36e5eb6fc94f057759b1f530626f7a1 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sat, 27 Feb 2021 18:54:56 +0100 Subject: [PATCH 09/14] Require plugins needed for localhost monitoring (#1932297) Remove mistakenly readded patch for conf.d --- nagios.spec | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/nagios.spec b/nagios.spec index 4c78293..1f3233e 100644 --- a/nagios.spec +++ b/nagios.spec @@ -1,8 +1,10 @@ %global _hardened_build 1 +# Set bootstrap = 1 to build without depending on plugins for localhost monitoring +%global bootstrap 0 Name: nagios Version: 4.4.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Host/service/network monitoring program @@ -25,9 +27,6 @@ Source14: nagios_epel7.te Source15: nagios_epel.fc Source16: nagios_epel6.te -# Patch 0 should be a patch that we get from the maint git tree in -# order to fix any items upstream wanted. -#Patch0: nagios-0000-git201706.patch Patch1: nagios-0001-default-init.patch # Sent upstream Patch2: nagios-0002-Fix-installation-of-httpd-conf.d-config-file.patch @@ -35,8 +34,6 @@ Patch3: nagios-0003-Install-config-files-too.patch Patch4: nagios-0004-Fix-path-to-CGI-executables.patch Patch5: nagios-0005-Fixed-path-to-passwd-file-in-Apache-s-config-file.patch Patch6: nagios-0006-Added-several-images-to-the-sample-config-revb.patch -#Patch7: nagios-0007-Apache-2.4-configuration-fix-for-Fedora-18.patch -Patch8: nagios-0008-Add-cfg_dir-etc-nagios-conf.d-to-the-main-nagios-con.patch Patch9: nagios-0009-fix-localstatedir-for-linux.patch ## This has been requested for security groups not wanting to leak ## their nagios location. @@ -86,6 +83,17 @@ Requires: nagios-common Requires: user(nagios) Requires: group(nagios) +# This plugins are required for localhost monitoring +%if ! 0%{?bootstrap} +Requires: nagios-plugins-load +Requires: nagios-plugins-users +Requires: nagios-plugins-http +Requires: nagios-plugins-disk +Requires: nagios-plugins-ssh +Requires: nagios-plugins-swap +Requires: nagios-plugins-procs +%endif + Requires(pre): group(nagios) Requires(pre): user(nagios) %if 0%{?rhel} > 6 || 0%{?fedora} > 20 @@ -472,6 +480,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Sat Feb 27 2021 Guido Aulisi - 4.4.6-3 +- Require plugins needed for localhost monitoring (#1932297) + * Tue Feb 23 2021 Guido Aulisi - 4.4.6-2 - Fix systemd unit file permissions #1676334 From 3b1ca2b6978cc1458bfa0181da8f5f011239dd1b Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sun, 28 Feb 2021 11:13:59 +0100 Subject: [PATCH 10/14] Add missing require for nagios-plugins-ping --- nagios.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nagios.spec b/nagios.spec index 1f3233e..18e87b8 100644 --- a/nagios.spec +++ b/nagios.spec @@ -85,6 +85,7 @@ Requires: group(nagios) # This plugins are required for localhost monitoring %if ! 0%{?bootstrap} +Requires: nagios-plugins-ping Requires: nagios-plugins-load Requires: nagios-plugins-users Requires: nagios-plugins-http From bc9d664d9055052b7bf05b3b7473ec2209325649 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sun, 28 Feb 2021 11:14:49 +0100 Subject: [PATCH 11/14] Fix run path --- nagios.tmpfiles.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagios.tmpfiles.conf b/nagios.tmpfiles.conf index 907ca68..4bb5bc3 100644 --- a/nagios.tmpfiles.conf +++ b/nagios.tmpfiles.conf @@ -1 +1 @@ -D /var/run/nagios 0755 nagios nagios - +D /run/nagios 0755 nagios nagios - From 3d4cba9d9f7154373888ba086f8ec45c895eac61 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Wed, 3 Mar 2021 09:56:21 +0100 Subject: [PATCH 12/14] Bump and build --- nagios.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nagios.spec b/nagios.spec index 18e87b8..bb73d18 100644 --- a/nagios.spec +++ b/nagios.spec @@ -4,7 +4,7 @@ Name: nagios Version: 4.4.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Host/service/network monitoring program @@ -481,6 +481,10 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Wed Mar 03 2021 Guido Aulisi - 4.4.6-4 +- Add missing require for nagios-plugins-ping +- Fix run path + * Sat Feb 27 2021 Guido Aulisi - 4.4.6-3 - Require plugins needed for localhost monitoring (#1932297) From 540a2e5bbce93eff96cf4b86c322a5abbd72bbf6 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sun, 25 Dec 2022 17:36:56 +0100 Subject: [PATCH 13/14] Update to 4.4.9 --- .gitignore | 3 +++ nagios-0015-Changelog.patch | 13 ------------- nagios.spec | 9 ++++++--- sources | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 nagios-0015-Changelog.patch diff --git a/.gitignore b/.gitignore index 3ac2d64..90d2d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ nagios-3.2.1.tar.gz /nagioscore-nagios-4.4.3.tar.gz /nagioscore-nagios-4.4.5.tar.gz /nagioscore-nagios-4.4.6.tar.gz +/nagioscore-nagios-4.4.7.tar.gz +/nagioscore-nagios-4.4.8.tar.gz +/nagioscore-nagios-4.4.9.tar.gz diff --git a/nagios-0015-Changelog.patch b/nagios-0015-Changelog.patch deleted file mode 100644 index 5ef3490..0000000 --- a/nagios-0015-Changelog.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Changelog b/Changelog -index a5fd04c6..51394645 100644 ---- a/Changelog -+++ b/Changelog -@@ -9,7 +9,7 @@ FIXES - * Fixed duplicate properties appearing in statusjson.cgi (#718) (Sebastian Wolf) - * Fixed NERD not building when enabled in ./configure (#723) (Sebastian Wolf) - * Fixed build process when using GCC 10 (#721) (Michael Orlitzky) --* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-1408) (Thanks UraSec Team) (Sebastian Wolf) -+* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-13977) (Thanks UraSec Team) (Sebastian Wolf) - * When using systemd, configuration will be verified before reloading (#715) (tatref) - * Fixed HARD OK states triggering on the maximum check attempt (#757) (Sebastian Wolf) - diff --git a/nagios.spec b/nagios.spec index bb73d18..1797bf4 100644 --- a/nagios.spec +++ b/nagios.spec @@ -3,8 +3,8 @@ %global bootstrap 0 Name: nagios -Version: 4.4.6 -Release: 4%{?dist} +Version: 4.4.9 +Release: 1%{?dist} Summary: Host/service/network monitoring program @@ -43,7 +43,6 @@ Patch11: nagios-0011-remove-rpmbuild.patch Patch12: nagios-0012-fix-spool.patch Patch13: nagios-0013-fix-plugin.patch Patch14: nagios-0014-fix-uidgid.patch -Patch15: %{name}-0015-Changelog.patch BuildRequires: make BuildRequires: doxygen @@ -63,6 +62,7 @@ BuildRequires: perl(Test::HTML::Lint) %endif BuildRequires: perl(Test::More) BuildRequires: perl(Test::Simple) +BuildRequires: openssl-devel # For up-to-date config.sub and config.guess BuildRequires: libtool @@ -481,6 +481,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Sun Dec 25 2022 Guido Aulisi - 4.4.9-1 +- Update to 4.4.9 + * Wed Mar 03 2021 Guido Aulisi - 4.4.6-4 - Add missing require for nagios-plugins-ping - Fix run path diff --git a/sources b/sources index 8d9f3c3..c1b318a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nagioscore-nagios-4.4.6.tar.gz) = db3a205f1675693301c059b0ecdc767cdc423923cff0729c5584a48e04fb18d6c119d51991dd24290a539eb8578b2cb82316275039b36827871bb028883b495f +SHA512 (nagioscore-nagios-4.4.9.tar.gz) = bf9a18bc0fd51c037eb37cd98507df39514b0c8a956ea1d9ec6cc2d633696ed10b58395c36e23cc729ea1337c08d6b6e7a88900f249efdac2b25c9de6ad7001c From f84d64d33014ff09da0fd456885238cac3099fb7 Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sun, 10 Mar 2024 11:45:14 +0100 Subject: [PATCH 14/14] Update to 4.4.14 --- .gitignore | 1 + nagios-0011-remove-rpmbuild.patch | 2 +- nagios.spec | 5 ++++- sources | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 90d2d7d..cec2a8b 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ nagios-3.2.1.tar.gz /nagioscore-nagios-4.4.7.tar.gz /nagioscore-nagios-4.4.8.tar.gz /nagioscore-nagios-4.4.9.tar.gz +/nagioscore-nagios-4.4.14.tar.gz diff --git a/nagios-0011-remove-rpmbuild.patch b/nagios-0011-remove-rpmbuild.patch index 401cad0..4e4bc1d 100644 --- a/nagios-0011-remove-rpmbuild.patch +++ b/nagios-0011-remove-rpmbuild.patch @@ -8,7 +8,7 @@ index 72e4d4a9..62415152 100644 $(CC) $(CFLAGS) $(LDFLAGS) $< $(CGI_O) -o $@ - -############################################################################## --# making similiar EPEL rpm for Fedora/RHEL/CentOS +-# making similar EPEL rpm for Fedora/RHEL/CentOS - -ifneq ("$(wildcard /etc/redhat-release)","") - diff --git a/nagios.spec b/nagios.spec index 1797bf4..5fc535c 100644 --- a/nagios.spec +++ b/nagios.spec @@ -3,7 +3,7 @@ %global bootstrap 0 Name: nagios -Version: 4.4.9 +Version: 4.4.14 Release: 1%{?dist} Summary: Host/service/network monitoring program @@ -481,6 +481,9 @@ fi %{_libdir}/%{name}/cgi/ %changelog +* Sat Mar 09 2024 Guido Aulisi - 4.4.14-1 +- Update to 4.4.14 + * Sun Dec 25 2022 Guido Aulisi - 4.4.9-1 - Update to 4.4.9 diff --git a/sources b/sources index c1b318a..83ce37d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nagioscore-nagios-4.4.9.tar.gz) = bf9a18bc0fd51c037eb37cd98507df39514b0c8a956ea1d9ec6cc2d633696ed10b58395c36e23cc729ea1337c08d6b6e7a88900f249efdac2b25c9de6ad7001c +SHA512 (nagioscore-nagios-4.4.14.tar.gz) = 6dfe19887f035f3a3f6774a0f1c515902608934a75b08835fe9a5163812657547c97a20f3df42b89a34cad949eb4b587853b4131718c30703490b11fbee0d0ee