summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-07-14 09:53:51 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-07-14 09:53:51 +0200
commit754ac9a0b015700ef0018f32e42e7966376c1120 (patch)
tree9ab2798b566c948416bd2afdeca8bfa27872c79c /debian/patches
parenta75ccaa9a52b79788eea5fccfe6c3fc3dfc5a81d (diff)
parent60f02d83d524a2d08a556fce1cb182ff8533de82 (diff)
Merge branch 'release/debian/3.1.9-2'debian/3.1.9-2
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0110-fix_malformed_messages.patch66
-rw-r--r--debian/patches/series1
2 files changed, 67 insertions, 0 deletions
diff --git a/debian/patches/0110-fix_malformed_messages.patch b/debian/patches/0110-fix_malformed_messages.patch
new file mode 100644
index 0000000..d9c744a
--- /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
+@@ -1332,13 +1332,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 c8614ec..b8ba109 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+0110-fix_malformed_messages.patch
0105-typo.patch
0700-init.patch
0600-typo-man.patch