From a0aa814e3d474d32ccef16ea2b422292b97d5a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 9 Jul 2023 14:23:27 +0200 Subject: New d/p/0110-fix_malformed_messages.patch --- debian/changelog | 2 +- debian/patches/0110-fix_malformed_messages.patch | 66 ++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 debian/patches/0110-fix_malformed_messages.patch diff --git a/debian/changelog b/debian/changelog index ab18a5d..b13b409 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ ipmiutil (3.1.8-4+deb12u1) bookworm; urgency=medium - * + * New debian/patches/0110-fix_malformed_messages.patch (Closes: #1040349). -- Jörg Frings-Fürst Sun, 09 Jul 2023 14:09:16 +0200 diff --git a/debian/patches/0110-fix_malformed_messages.patch b/debian/patches/0110-fix_malformed_messages.patch new file mode 100644 index 0000000..e55bcb2 --- /dev/null +++ b/debian/patches/0110-fix_malformed_messages.patch @@ -0,0 +1,66 @@ +Description: do not abort if sensor command fails +Origin: upstream +Bug: https://github.com/arcress0/ipmiutil/issues/17 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040349 +Forwarded: no +Last-Update: 2023-07-09 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/util/isensor.c +=================================================================== +--- trunk.orig/util/isensor.c ++++ trunk/util/isensor.c +@@ -1330,13 +1330,14 @@ int GetSDR(int r_id, int *r_next, uchar + if (sresp < (thislen+2)) { + /* There are some SDRs that may report the wrong length, and + * return less bytes than they reported, so just truncate. */ ++ fprintf(stderr,"SDR record %x is malformed, length %d is less than minimum %d\n",r_id,sresp,thislen+2); + if (fdebug) printf("sdr[%x] off=%d, expected %d, got %d\n", + r_id,off,thislen+2,sresp); + if (sresp >= 2) thislen = sresp - 2; + else thislen = 0; + reclen = off + thislen; /* truncate, stop reading */ +- fprintf(stderr,"SDR record %x is malformed, length %d is less than minimum %d\n",r_id,sresp,thislen+2); +- rc = ERR_SDR_MALFORMED; ++ /* auto-corrected, so not a fatal error */ ++ // rc = ERR_SDR_MALFORMED; + } + /* successful */ + memcpy(&resp[off],&respchunk[2],thislen); +Index: trunk/doc/ipmiutil.spec +=================================================================== +--- trunk.orig/doc/ipmiutil.spec ++++ trunk/doc/ipmiutil.spec +@@ -210,6 +210,10 @@ rm -rf %{buildroot} + vardir=%{_var}/lib/%{name} + scr_dir=%{_datadir}/%{name} + ++if [ ! -f %{_datadir}/%{name}/ipmiutil.env ]; then ++ cp %{_datadir}/%{name}/ipmiutil.env.template %{_datadir}/%{name}/ipmiutil.env ++fi ++ + # Install right scripts/service files no matter install or upgrade + %if 0%{?req_systemd} + %service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service +@@ -217,9 +221,6 @@ scr_dir=%{_datadir}/%{name} + if [ -x /bin/systemctl ] && [ -d %{unit_dir} ]; then + # Replace if exists, append if not. + # Use # as the sed delimiter to prevent handling slash in the path. +- if [ ! -f %{_datadir}/%{name}/ipmiutil.env ]; then +- cp %{_datadir}/%{name}/ipmiutil.env.template %{_datadir}/%{name}/ipmiutil.env +- fi + grep -q 'IINITDIR' %{_datadir}/%{name}/ipmiutil.env \ + && sed -i 's#^IINITDIR=.*#IINITDIR=%{init_dir}#' %{_datadir}/%{name}/ipmiutil.env \ + || echo "IINITDIR=%{init_dir}" >> %{_datadir}/%{name}/ipmiutil.env +@@ -274,8 +275,9 @@ then + # Capture a snapshot of IPMI sensor data once now for later reuse. + sensorout=$vardir/sensor_out.txt + if [ ! -f $sensorout ]; then +- %{_bindir}/ipmiutil sensor -q >$sensorout || : +- if [ $? -ne 0 ]; then ++ IPMIret=1 ++ %{_bindir}/ipmiutil sensor -q >$sensorout && IPMIret=0 ++ if [ $IPMIret -ne 0 ]; then + # remove file if error, try again in ipmi_port on reboot. + rm -f $sensorout + fi diff --git a/debian/patches/series b/debian/patches/series index 6fce8b9..5cd4d69 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ #0100-out-of-bounds.patch +0110-fix_malformed_messages.patch 0105-typo.patch 0700-init.patch 0600-typo-man.patch -- cgit v1.2.3