From 59a0432830b0263a3f15c56caa16674b7724c7bd0d73026227b0c003da166b1e Mon Sep 17 00:00:00 2001 From: Antonio Teixeira Date: Mon, 20 May 2024 17:13:20 +0000 Subject: [PATCH] Accepting request 1174075 from home:ateixeira:branches:hardware - Update to version 2.4.2: * New features * redfishpower: cache host resolution lookups (#190) * redfishpower: support new --resolve-hosts option (#188) * redfishpower: support message timeout config (#186) * Fixes * redfishpower: increase default message timeout (#191) * redfishpower: output more detailed error messages (#183) - Changelog for 2.4.1 and 2.4.0: * Too many changes, see NEWS.md - Removed patches: * service-dynamic-user-autofiles.patch * service-dynamic-user-configure.patch - Refreshed patches: * Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch * harden_powerman.service.patch OBS-URL: https://build.opensuse.org/request/show/1174075 OBS-URL: https://build.opensuse.org/package/show/hardware/powerman?expand=0&rev=52 --- ...-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch | 12 +- harden_powerman.service.patch | 10 +- powerman-2.3.27.tar.gz | 3 - powerman-2.4.2.tar.gz | 3 + powerman.changes | 20 ++++ powerman.spec | 22 ++-- service-dynamic-user-autofiles.patch | 107 ------------------ service-dynamic-user-configure.patch | 91 --------------- 8 files changed, 48 insertions(+), 220 deletions(-) delete mode 100644 powerman-2.3.27.tar.gz create mode 100644 powerman-2.4.2.tar.gz delete mode 100644 service-dynamic-user-autofiles.patch delete mode 100644 service-dynamic-user-configure.patch diff --git a/Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch b/Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch index f822d74..abe6b39 100644 --- a/Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch +++ b/Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch @@ -8,13 +8,13 @@ References: Signed-off-by: Egbert Eich Signed-off-by: Egbert Eich --- - snmppower/snmppower.c | 4 ++-- + src/snmppower/snmppower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/snmppower/snmppower.c b/snmppower/snmppower.c -index 652b806..eb30dc4 100644 ---- a/snmppower/snmppower.c -+++ b/snmppower/snmppower.c -@@ -207,9 +207,9 @@ start_v3 (char **av, char *hostname, struct snmp_session **ssp) +Index: b/src/snmppower/snmppower.c +=================================================================== +--- a/src/snmppower/snmppower.c ++++ b/src/snmppower/snmppower.c +@@ -192,9 +192,9 @@ start_v3 (char **av, char *hostname, str session.securityNameLen = strlen (av[1]); session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV; diff --git a/harden_powerman.service.patch b/harden_powerman.service.patch index 7e729a1..547ee17 100644 --- a/harden_powerman.service.patch +++ b/harden_powerman.service.patch @@ -1,10 +1,10 @@ -Index: powerman-2.3.26/scripts/powerman.service.in +Index: b/etc/powerman.service.in =================================================================== ---- powerman-2.3.26.orig/scripts/powerman.service.in -+++ powerman-2.3.26/scripts/powerman.service.in +--- a/etc/powerman.service.in ++++ b/etc/powerman.service.in @@ -5,6 +5,17 @@ After=syslog.target network.target [Service] - Type=forking + Environment=SHELL=/bin/sh PrivateTmp=yes +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort @@ -19,4 +19,4 @@ Index: powerman-2.3.26/scripts/powerman.service.in +# end of automatic additions User=@RUN_AS_USER@ Group=@RUN_AS_GROUP@ - ExecStart=/usr/sbin/powermand + ExecStart=@X_SBINDIR@/powermand diff --git a/powerman-2.3.27.tar.gz b/powerman-2.3.27.tar.gz deleted file mode 100644 index 3ff6a14..0000000 --- a/powerman-2.3.27.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1575f0c2cc49ba14482582b9bbba19e95496434f95d52de6ad2412e66200d2d8 -size 720220 diff --git a/powerman-2.4.2.tar.gz b/powerman-2.4.2.tar.gz new file mode 100644 index 0000000..5502b10 --- /dev/null +++ b/powerman-2.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8465d1669745a72e3822fdc73f3e4a06737d8579a59190fef0b8aa259d7fc13f +size 789294 diff --git a/powerman.changes b/powerman.changes index 0fae1d7..429b754 100644 --- a/powerman.changes +++ b/powerman.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Tue May 14 19:04:31 UTC 2024 - Antonio Teixeira + +- Update to version 2.4.2: + * New features + * redfishpower: cache host resolution lookups (#190) + * redfishpower: support new --resolve-hosts option (#188) + * redfishpower: support message timeout config (#186) + * Fixes + * redfishpower: increase default message timeout (#191) + * redfishpower: output more detailed error messages (#183) +- Changelog for 2.4.1 and 2.4.0: + * Too many changes, see NEWS.md +- Removed patches: + * service-dynamic-user-autofiles.patch + * service-dynamic-user-configure.patch +- Refreshed patches: + * Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch + * harden_powerman.service.patch + ------------------------------------------------------------------- Thu Feb 29 14:48:34 UTC 2024 - Dominique Leuenberger diff --git a/powerman.spec b/powerman.spec index e17940e..e5e5110 100644 --- a/powerman.spec +++ b/powerman.spec @@ -1,7 +1,7 @@ # # spec file for package powerman # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,22 +31,23 @@ %endif Name: powerman -Version: 2.3.27 +Version: 2.4.2 Release: 0 Summary: Centralized Power Control for Clusters License: GPL-2.0-or-later Group: Productivity/Clustering/HA URL: https://github.com/chaos/powerman -Source0: https://github.com/chaos/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz -Patch1: service-dynamic-user-autofiles.patch -Patch2: service-dynamic-user-configure.patch -Patch3: harden_powerman.service.patch -Patch4: Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch +Source: https://github.com/chaos/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch1: harden_powerman.service.patch +Patch2: Replace-deprecated-usmHMACMD5AuthProtocol-Protocol-by-SNMP_DEFAULT_AUTH_PROTO.patch BuildRequires: automake +BuildRequires: bison BuildRequires: fdupes +BuildRequires: flex BuildRequires: ncurses-devel BuildRequires: pkg-config BuildRequires: tcpd-devel +BuildRequires: pkgconfig(jansson) BuildRequires: pkgconfig(libcurl) %{?have_sysuser:BuildRequires: sysuser-tools} %if 0%{?_with_snmppower} @@ -82,6 +83,8 @@ Header files, pkg-config file and man pages for developing applications using Po %prep %autosetup -p1 +# git is used to set package version in AC_INIT. That fails so we manually set the version. +sed -i "s;m4_esyscmd(\[git describe --always.*\]);\[%{version}\];" configure.ac %build %configure \ @@ -89,6 +92,7 @@ Header files, pkg-config file and man pages for developing applications using Po --with-httppower \ --with-user=%{powerman_u} \ --with-group=%{powerman_g} \ + --with-systemdsystemunitdir=%{_unitdir} \ %{?_with_snmppower:--with-snmppower} \ %{?_with_genders:--with-genders} \ %{?_with_tcp_wrappers:--with-tcp-wrappers} \ @@ -132,7 +136,8 @@ systemd-tmpfiles --create %{_tmpfilesdir}/powerman.conf %files %defattr(-,root,root) -%doc DISCLAIMER COPYING NEWS +%doc DISCLAIMER NEWS.md +%license COPYING %{_bindir}/* %{_mandir}/man?/*.* %exclude %{_mandir}/man3/*.* @@ -140,6 +145,7 @@ systemd-tmpfiles --create %{_tmpfilesdir}/powerman.conf %config %{_sysconfdir}/powerman/ %attr(0644,root,root) %{_unitdir}/%{name}.service %attr(0644,root,root) %{_tmpfilesdir}/powerman.conf +%ghost %{_rundir}/powerman %{?have_sysuser:%{_sysusersdir}/system-user-%{name}.conf} %files devel diff --git a/service-dynamic-user-autofiles.patch b/service-dynamic-user-autofiles.patch deleted file mode 100644 index e1a788a..0000000 --- a/service-dynamic-user-autofiles.patch +++ /dev/null @@ -1,107 +0,0 @@ -Index: powerman-2.3.26/scripts/powerman.service -=================================================================== ---- powerman-2.3.26.orig/scripts/powerman.service 2018-12-29 00:03:25.000000000 +0100 -+++ /dev/null 1970-01-01 00:00:00.000000000 +0000 -@@ -1,14 +0,0 @@ --[Unit] --Description=PowerMan --After=syslog.target network.target -- --[Service] --Type=forking --PrivateTmp=yes --User=daemon --Group=daemon --ExecStart=/usr/sbin/powermand --PIDFile=/var/run/powerman/powermand.pid -- --[Install] --WantedBy=multi-user.target -Index: powerman-2.3.26/scripts/powerman.service.in -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ powerman-2.3.26/scripts/powerman.service.in 2021-05-13 09:07:58.387942345 +0200 -@@ -0,0 +1,16 @@ -+[Unit] -+Description=PowerMan -+After=syslog.target network.target -+ -+[Service] -+Type=forking -+PrivateTmp=yes -+User=@RUN_AS_USER@ -+Group=@RUN_AS_GROUP@ -+ExecStart=/usr/sbin/powermand -+RuntimeDirectory=powerman -+RuntimeDirectoryMode=0755 -+PIDFile=/run/powerman/powermand.pid -+ -+[Install] -+WantedBy=multi-user.target -Index: powerman-2.3.26/configure.ac -=================================================================== ---- powerman-2.3.26.orig/configure.ac 2020-02-18 20:56:01.000000000 +0100 -+++ powerman-2.3.26/configure.ac 2021-05-13 09:07:58.387942345 +0200 -@@ -90,7 +90,7 @@ AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1, - # whether to install pkg-config file for API - AC_PKGCONFIG - --# what user to run daemon as -+# what user and group to run daemon as - AC_RUNAS - - ## -@@ -111,6 +111,7 @@ AC_CONFIG_FILES( \ - etc/Makefile \ - scripts/Makefile \ - scripts/powerman \ -+ scripts/powerman.service \ - scripts/tmpfiles.d/powerman.conf \ - heartbeat/Makefile \ - man/Makefile \ -Index: powerman-2.3.26/config/ac_runas.m4 -=================================================================== ---- powerman-2.3.26.orig/config/ac_runas.m4 2018-12-29 00:02:57.000000000 +0100 -+++ powerman-2.3.26/config/ac_runas.m4 2021-05-13 09:07:58.387942345 +0200 -@@ -1,6 +1,7 @@ - AC_DEFUN([AC_RUNAS], - [ - RUN_AS_USER="daemon" -+ RUN_AS_GROUP="daemon" - AC_MSG_CHECKING(user to run as) - AC_ARG_WITH(user, - AC_HELP_STRING([--with-user=username], [user for powerman daemon (daemon)]), -@@ -16,4 +17,20 @@ AC_DEFUN([AC_RUNAS], - [Powerman daemon user]) - AC_MSG_RESULT(${RUN_AS_USER}) - AC_SUBST(RUN_AS_USER) -+ -+ AC_MSG_CHECKING(group to run as) -+ AC_ARG_WITH(group, -+ AC_HELP_STRING([--with-group=groupname], [group for powerman daemon (daemon)]), -+ [ case "${withval}" in -+ yes|no) -+ ;; -+ *) -+ RUN_AS_GROUP="${withval}" -+ ;; -+ esac], -+ ) -+ AC_DEFINE_UNQUOTED(RUN_AS_GROUP, "${RUN_AS_GROUP}", -+ [Powerman daemon group]) -+ AC_MSG_RESULT(${RUN_AS_GROUP}) -+ AC_SUBST(RUN_AS_GROUP) - ]) -Index: powerman-2.3.26/config/systemd.m4 -=================================================================== ---- powerman-2.3.26.orig/config/systemd.m4 2020-02-18 20:56:01.000000000 +0100 -+++ powerman-2.3.26/config/systemd.m4 2021-05-13 09:27:58.838707064 +0200 -@@ -33,7 +33,7 @@ AC_DEFUN([RRA_WITH_SYSTEMD_UNITDIR], - [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], - [Directory for systemd service files])], - [], -- [with_systemdsystemunitdir=\${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) -+ [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) - AS_IF([test x"$with_systemdsystemunitdir" != xno], - [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) - AM_CONDITIONAL([HAVE_SYSTEMD], diff --git a/service-dynamic-user-configure.patch b/service-dynamic-user-configure.patch deleted file mode 100644 index 8c4be3f..0000000 --- a/service-dynamic-user-configure.patch +++ /dev/null @@ -1,91 +0,0 @@ -Index: powerman-2.3.26/configure -=================================================================== ---- powerman-2.3.26.orig/configure -+++ powerman-2.3.26/configure -@@ -633,6 +633,7 @@ ac_subst_vars='am__EXEEXT_FALSE - am__EXEEXT_TRUE - LTLIBOBJS - LIBOBJS -+RUN_AS_GROUP - RUN_AS_USER - pkgconfigdir - WITH_PKG_CONFIG_FALSE -@@ -820,6 +821,7 @@ with_systemdsystemunitdir - with_tcp_wrappers - with_pkgconfig_dir - with_user -+with_group - ' - ac_precious_vars='build_alias - host_alias -@@ -1503,6 +1505,7 @@ Optional Packages: - where to install pkg-config *.pc files - (EPREFIX/lib/pkgconfig) - --with-user=username user for powerman daemon (daemon) -+ --with-group=groupname group for powerman daemon (daemon) - - Some influential environment variables: - CC C compiler command -@@ -13865,7 +13868,7 @@ fi - if test "${with_systemdsystemunitdir+set}" = set; then : - withval=$with_systemdsystemunitdir; - else -- with_systemdsystemunitdir=\${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd) -+ with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) - fi - - if test x"$with_systemdsystemunitdir" != xno; then : -@@ -14307,9 +14310,10 @@ fi - - - --# what user to run daemon as -+# what user and group to run daemon as - - RUN_AS_USER="daemon" -+ RUN_AS_GROUP="daemon" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking user to run as" >&5 - $as_echo_n "checking user to run as... " >&6; } - -@@ -14332,12 +14336,32 @@ _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${RUN_AS_USER}" >&5 - $as_echo "${RUN_AS_USER}" >&6; } - -+ { $as_echo "$as_me:$LINENO: checking group to run as" >&5 -+$as_echo_n "checking group to run as... " >&6; } - -+# Check whether --with-group was given. -+if test "${with_group+set}" = set; then : -+ withval=$with_group; case "${withval}" in -+ yes|no) -+ ;; -+ *) -+ RUN_AS_GROUP="${withval}" -+ ;; -+ esac -+fi -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define RUN_AS_GROUP "${RUN_AS_GROUP}" -+_ACEOF -+ -+ { $as_echo "$as_me:$LINENO: result: ${RUN_AS_GROUP}" >&5 -+$as_echo "${RUN_AS_GROUP}" >&6; } - - ## - # Epilogue. - ## --ac_config_files="$ac_config_files Makefile examples/powerman_el72.spec libpowerman/Makefile libpowerman/libpowerman.pc liblsd/Makefile libcommon/Makefile powerman/Makefile powermand/Makefile httppower/Makefile redfishpower/Makefile snmppower/Makefile plmpower/Makefile etc/Makefile scripts/Makefile scripts/powerman scripts/tmpfiles.d/powerman.conf heartbeat/Makefile man/Makefile man/powerman.1 man/libpowerman.3 man/powerman.conf.5 man/powerman.dev.5 man/httppower.8 man/redfishpower.8 man/plmpower.8 man/powermand.8 man/vpcd.8 test/Makefile test/mcr.conf test/sierra.conf test/t07.conf test/t09.conf test/t10.conf test/t17.conf test/t18.conf test/t19.conf test/t20.conf test/t21.conf test/t22.conf test/t23.conf test/t24.conf test/t25.conf test/t26.conf test/t27.conf test/t28.conf test/t29.conf test/t30.conf test/t31.conf test/t32.conf test/t33.conf test/t34.conf test/t35.conf test/t36.conf test/t37.conf test/t38.conf test/t39.conf test/t40.conf test/t41.conf test/t42.conf test/t43.conf test/t44.conf test/t46.conf test/t47.conf test/t48.conf test/t49.conf test/t50.conf test/t51.conf test/t53.conf test/t54.conf test/t55.conf test/t60.conf test/t61.conf test/t62.conf test/t63.conf test/test.conf test/test4.conf" -+ac_config_files="$ac_config_files Makefile examples/powerman_el72.spec libpowerman/Makefile libpowerman/libpowerman.pc liblsd/Makefile libcommon/Makefile powerman/Makefile powermand/Makefile httppower/Makefile redfishpower/Makefile snmppower/Makefile plmpower/Makefile etc/Makefile scripts/Makefile scripts/powerman scripts/powerman.service scripts/tmpfiles.d/powerman.conf heartbeat/Makefile man/Makefile man/powerman.1 man/libpowerman.3 man/powerman.conf.5 man/powerman.dev.5 man/httppower.8 man/redfishpower.8 man/plmpower.8 man/powermand.8 man/vpcd.8 test/Makefile test/mcr.conf test/sierra.conf test/t07.conf test/t09.conf test/t10.conf test/t17.conf test/t18.conf test/t19.conf test/t20.conf test/t21.conf test/t22.conf test/t23.conf test/t24.conf test/t25.conf test/t26.conf test/t27.conf test/t28.conf test/t29.conf test/t30.conf test/t31.conf test/t32.conf test/t33.conf test/t34.conf test/t35.conf test/t36.conf test/t37.conf test/t38.conf test/t39.conf test/t40.conf test/t41.conf test/t42.conf test/t43.conf test/t44.conf test/t46.conf test/t47.conf test/t48.conf test/t49.conf test/t50.conf test/t51.conf test/t53.conf test/t54.conf test/t55.conf test/t60.conf test/t61.conf test/t62.conf test/t63.conf test/test.conf test/test4.conf" - - - cat >confcache <<\_ACEOF -@@ -15394,6 +15418,7 @@ do - "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; - "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; - "scripts/powerman") CONFIG_FILES="$CONFIG_FILES scripts/powerman" ;; -+ "scripts/powerman.service") CONFIG_FILES="$CONFIG_FILES scripts/powerman.service" ;; - "scripts/tmpfiles.d/powerman.conf") CONFIG_FILES="$CONFIG_FILES scripts/tmpfiles.d/powerman.conf" ;; - "heartbeat/Makefile") CONFIG_FILES="$CONFIG_FILES heartbeat/Makefile" ;; - "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;