import OL ledmon-1.1.0-2.el9_6.1

This commit is contained in:
eabdullin 2025-10-31 08:12:03 +00:00
parent 5c5c326f07
commit 36bf3eee9d
5 changed files with 88 additions and 40 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/ledmon-0.97.tar.gz
SOURCES/ledmon-1.1.0.tar.gz

View File

@ -1 +1 @@
0447a7e81a504d4a856f7934927f5a8b2be3c1ff SOURCES/ledmon-0.97.tar.gz
c248d42629df31f1e2ded05a660a487a2d5a1a70 SOURCES/ledmon-1.1.0.tar.gz

View File

@ -0,0 +1,32 @@
From 740a352626e2ed5d26389200f38323fde9bd84f1 Mon Sep 17 00:00:00 2001
From: Blazej Kucman <blazej.kucman@intel.com>
Date: Wed, 16 Apr 2025 12:26:38 +0200
Subject: [PATCH] utils: Fix string2ibpi function
string2ibpi does not compare strings correctly, the function uses strncmp,
which in case strings of different lengths, may return incorrect value
if substrings of given max length are identical. In this function whole
strings must be identical.
Fix is to change strncmp to strcmp.
Fixes intel/ledmon#259
Fixes: 94818457f615 ("Add struct for mapping ibpi statuses to strings. (#211)")
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
---
src/lib/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/utils.c b/src/lib/utils.c
index bad35eb4..2fe0f764 100644
--- a/src/lib/utils.c
+++ b/src/lib/utils.c
@@ -765,7 +765,7 @@ enum led_ibpi_pattern string2ibpi(const char *name)
if (!input_name)
continue;
- if (strncmp(input_name, name, strlen(input_name)) == 0)
+ if (strcmp(input_name, name) == 0)
return ipbi_names[i].ibpi;
}

View File

@ -1,26 +0,0 @@
From a82b0e4080254e68eb70a338f8f6f7e6a6dbc581 Mon Sep 17 00:00:00 2001
From: Jan Macku <jamacku@redhat.com>
Date: Tue, 2 Feb 2021 11:08:20 +0100
Subject: [PATCH] ledmon_format-truncation-flag
suggested by kdudka
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 8fd5e6b..b80e2b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AM_CPPFLAGS='-D_DEBUG -D_GNU_SOURCE -D_DEFAULT_SOURCE -DDMALLOC_DISABLE -DBUILD_
AC_DEFUN([AX_AM_CFLAGS_ADD],[AX_CHECK_COMPILE_FLAG($1, AM_CFLAGS="$AM_CFLAGS $1")])
AX_AM_CFLAGS_ADD([-Wformat -Werror=format-security])
AX_AM_CFLAGS_ADD([-Werror=format-overflow=2])
-AX_AM_CFLAGS_ADD([-Werror=format-truncation=1])
+dnl AX_AM_CFLAGS_ADD([-Werror=format-truncation=1])
AX_AM_CFLAGS_ADD([-Werror=shift-negative-value])
AX_AM_CFLAGS_ADD([-Werror=alloca])
AX_AM_CFLAGS_ADD([-Werror=missing-field-initializers])
--
2.29.2

View File

@ -1,17 +1,22 @@
Summary: Enclosure LED Utilities
Name: ledmon
Version: 0.97
Release: 1%{?dist}
Version: 1.1.0
Release: 2%{?dist}.1
License: GPLv2+
URL: https://github.com/intel/ledmon
Source0: https://github.com/intel/ledmon/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: ledmon_format-truncation-flag.patch
Patch: 0001-ledmon-1.1.0-utils-fix-string2ibpi-function.patch
BuildRequires: sg3_utils-devel
BuildRequires: pciutils-devel
BuildRequires: autoconf automake
BuildRequires: autoconf-archive
BuildRequires: gcc make
BuildRequires: libconfig-devel
BuildRequires: libtool
BuildRequires: pciutils-devel
BuildRequires: sg3_utils-devel
# Needed for pkgconfig usage.
BuildRequires: pkgconfig(systemd)
# Needed for the udev dependency.
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
@ -27,20 +32,39 @@ types of system: 2-LED system (Activity LED, Status LED) and 3-LED system
(Activity LED, Locate LED, Fail LED). User must have root privileges to
use this application.
%package libs
Summary: Runtime library files for %{name}
Requires: pciutils-libs
Requires: sg3_utils-libs
%description libs
The %{name}-libs package contains runtime libraries for applications
that use %{name}.
%package devel
Summary: Development files for %{name}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: pciutils-devel
Requires: sg3_utils-devel
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
# remove -Werror=format-truncation=1 in order to build package
%patch0 -p1
%autosetup -p1
autoreconf -fiv
%build
sh autogen.sh
%configure --enable-systemd=yes
make
%configure --enable-systemd=yes --enable-library --disable-static
%make_build
%install
%make_install SBIN_DIR=$RPM_BUILD_ROOT/%{_sbindir} MANDIR=$RPM_BUILD_ROOT%{_mandir}
# These files are not useful for install
find %{buildroot} -name '*.la' -delete
%post
%systemd_post ledmon.service
@ -57,7 +81,25 @@ make
%{_mandir}/*/*
%{_unitdir}/ledmon.service
%files libs
%{_libdir}/*.so.*
%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%changelog
* Mon Jun 09 2025 Jan Macku <jamacku@redhat.com> - 1.1.0-2.1
- Fix string2ibpi function (RHEL-104907)
* Tue Nov 12 2024 Jan Macku <jamacku@redhat.com> - 1.1.0-1
- update to 1.1.0
* Fri Apr 12 2024 Jan Macku <jamacku@redhat.com> - 1.0.0-1
- update to 1.0.0
- package shared ledmon library by Tony Asleson
* Wed May 17 2023 Jan Macku <jamacku@redhat.com> - 0.97-1
- update to 0.97 (#2159926)
- drop ipmi-avoid-error-messages-on-non-dell-platforms.patch