control: tags -1 + patch pending fixed-upstream

Dear maintainer,

I've prepared an NMU for ipmitool (versioned as 1.8.19-7.1) and
uploaded it to DELAYED/5. Please feel free to tell me if I
should delay it longer.

Thanks,
Shengqi Chen

diff -Nru ipmitool-1.8.19/debian/changelog ipmitool-1.8.19/debian/changelog
--- ipmitool-1.8.19/debian/changelog    2023-12-17 19:29:04.000000000 +0800
+++ ipmitool-1.8.19/debian/changelog    2024-10-27 23:57:07.000000000 +0800
@@ -1,3 +1,18 @@
+ipmitool (1.8.19-7.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/patches: backport several important fixes from upstream
+    + fix a buffer overrun in `open` interface
+    + fix lan print fails on unsupported parameters (closes: #1061770)
+    + fix parameter passed to read temperature sensors
+    + fix using hex values when sending raw data (closes: #1082101)
+  * Some build tweaks:
+    + add patch to enable verbose output from libtool
+    + d/rules: run autoupdate before autoreconf
+  * d/control: bump std-ver to 4.7.0 (no changes required)
+
+ -- Shengqi Chen <[email protected]>  Sun, 27 Oct 2024 23:57:07 +0800
+
 ipmitool (1.8.19-7) unstable; urgency=medium
 
   * debian/watch, debian/copyright, debian.control:
diff -Nru ipmitool-1.8.19/debian/control ipmitool-1.8.19/debian/control
--- ipmitool-1.8.19/debian/control      2023-12-17 19:29:04.000000000 +0800
+++ ipmitool-1.8.19/debian/control      2024-10-18 16:55:55.000000000 +0800
@@ -9,7 +9,7 @@
  libfreeipmi-dev [!hurd-i386],
  libreadline-dev,
  libssl-dev
-Standards-Version: 4.6.2.0
+Standards-Version: 4.7.0
 Rules-Requires-Root: no
 Vcs-Git: git://git.jff.email/ipmitool.git
 Vcs-Browser: https://git.jff.email/cgit/ipmitool.git
diff -Nru ipmitool-1.8.19/debian/patches/0701-disable-libtool-silent.patch 
ipmitool-1.8.19/debian/patches/0701-disable-libtool-silent.patch
--- ipmitool-1.8.19/debian/patches/0701-disable-libtool-silent.patch    
1970-01-01 08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0701-disable-libtool-silent.patch    
2024-10-27 23:56:52.000000000 +0800
@@ -0,0 +1,35 @@
+Description: Enable verbose output of libtool and fix warning
+Author: Shengqi Chen <[email protected]>
+Forwarded: not-needed
+Last-Update: 2024-10-27
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/configure.ac
++++ b/configure.ac
+@@ -7,7 +7,7 @@
+ AC_CONFIG_COMMANDS_PRE([export prefix=$prefix])
+ AC_CANONICAL_SYSTEM
+ AM_INIT_AUTOMAKE([foreign])
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS([config.h])
+ AC_PREREQ(2.50)
+ AC_SUBST(ac_configure_args)
+ 
+@@ -21,7 +21,6 @@
+ AC_CHECK_PROG([WGET], [wget], [wget])
+ AC_CHECK_PROG([CURL], [curl], [curl])
+ 
+-AC_HEADER_STDC
+ AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
+ AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
+@@ -38,8 +37,7 @@
+ 
+ CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat 
-Wformat-nonliteral"
+ 
+-AM_PROG_LIBTOOL
+-LIBTOOL="$LIBTOOL --silent"
++LT_INIT
+ 
+ AC_SEARCH_LIBS([gethostbyname], [nsl])
+ AC_SEARCH_LIBS([getaddrinfo], [nsl])
diff -Nru ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch 
ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch
--- ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch        
1970-01-01 08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch        
2024-10-18 16:50:55.000000000 +0800
@@ -0,0 +1,35 @@
+From b4bc5c335159b1c272e06dba98e2916e3ecc0462 Mon Sep 17 00:00:00 2001
+From: Howitzer105mm <[email protected]>
+Date: Tue, 26 Mar 2024 11:28:16 +0000
+Subject: [PATCH] open: Eliminate buffer overrun (#24)
+
+clangd reports a buffer overrun issue in `open` interface.
+
+The sprintf() used to fill ipmi_devfs2 requires 17 bytes to store the
+null terminated string. The character buffer is only 16 bytes in
+length.
+
+Signed-off-by: Johnathan Mantey <[email protected]>
+Reviewed-on: https://codeberg.org/IPMITool/ipmitool/pulls/24
+Reviewed-by: Alexander Amelkin <[email protected]>
+Co-authored-by: Howitzer105mm <[email protected]>
+Co-committed-by: Howitzer105mm <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/b4bc5c335159b1c272e06dba98e2916e3ecc0462
+---
+ src/plugins/open/open.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/open/open.c b/src/plugins/open/open.c
+index 39c8ea2..88cb6c3 100644
+--- a/src/plugins/open/open.c
++++ b/src/plugins/open/open.c
+@@ -94,7 +94,7 @@ ipmi_openipmi_open(struct ipmi_intf *intf)
+ {
+       char ipmi_dev[16];
+       char ipmi_devfs[16];
+-      char ipmi_devfs2[16];
++      char ipmi_devfs2[17];
+       int devnum = 0;
+ 
+       devnum = intf->devnum;
diff -Nru 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
--- 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
     1970-01-01 08:00:00.000000000 +0800
+++ 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
     2024-10-18 16:51:51.000000000 +0800
@@ -0,0 +1,39 @@
+From 137aeb64cbb493d61d6945cac156aba5f0510780 Mon Sep 17 00:00:00 2001
+From: Miao Wang <[email protected]>
+Date: Sat, 10 Feb 2024 12:51:15 +0800
+Subject: [PATCH] lan: fix lan print fails on unsupported parameters
+
+After upgrading to ipmitool 1.8.19, ipmitool lan print can only print out
+`Set in Progress` and other parameters are missing on our servers. After
+bisecting, commit:
+
+  351dad24a26f lan: Add processing of get/set specific CCs
+
+is identified to be the source of the problem, where the function
+get_lan_param_select is expected to consider severial error codes it
+receives as empty response. It then constructs an empty response in `p`
+and assigns `p` to `rc` and the control flow falls through to the
+default case, which prints the error code in verbose mode and should
+return `rc` instead of `NULL`.
+
+Signed-off-by: Miao Wang <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/137aeb64cbb493d61d6945cac156aba5f0510780
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061770
+---
+ lib/ipmi_lanp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
+index fe0046f..26e7365 100644
+--- a/lib/ipmi_lanp.c
++++ b/lib/ipmi_lanp.c
+@@ -245,7 +245,7 @@ get_lan_param_select(struct ipmi_intf *intf, uint8_t chan, 
int param, int select
+                       specific_val2str(rsp->ccode,
+                                        get_lan_cc_vals,
+                                        completion_code_vals));
+-              return NULL;
++              return rc;
+       }
+ 
+       p->data = rsp->data + 1;
diff -Nru ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch 
ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch
--- ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch  
1970-01-01 08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch  
2024-10-18 16:52:09.000000000 +0800
@@ -0,0 +1,59 @@
+From ab5ce5baff097ebb6e2a17a171858be213ee68d3 Mon Sep 17 00:00:00 2001
+From: Thang Tran <[email protected]>
+Date: Tue, 11 Jul 2023 17:27:12 +0700
+Subject: [PATCH] dcmi: update parameters to read temperature sensors
+
+Issue:
+When the system has number of CPU temperature sensors more than 8,
+"ipmitool dcmi get_temp_reading" can not show all of sensors.
+
+Root cause:
+To request to read multiple sensors for each message, ipmitool has to
+send "Get Temperature Readings" command with the "Entity Instance" always
+0 and the "Entity Instance Start" as the offset. But the current code is
+sending "Entity Instance" is offset and "Entity Instance Start" always is
+0. It makes ipmitool only read 1 sensor each time. Besides that, the
+"Entity Instance Start" value starts from 1 (not 0), therefore, the
+initialization has to be set to 1.
+
+Solution:
+This commit corrects the order of parameters and the initialization of
+"Entity Instance Start" byte.
+
+Resolves ipmitool/ipmitool#3
+
+Tested:
+1. Update BMC software to support 24 CPU temperature sensors
+2. Request to read the temperature sensors
+$ipmitool dcmi get_temp_reading
+3. Display full 24 CPU temperature sensors.
+
+Signed-off-by: Thang Tran <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/ab5ce5baff097ebb6e2a17a171858be213ee68d3
+---
+ lib/ipmi_dcmi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
+index 8ed87a9..8cf6d66 100644
+--- a/lib/ipmi_dcmi.c
++++ b/lib/ipmi_dcmi.c
+@@ -1595,7 +1595,7 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
+                       continue;
+               }
+               /* Total number of available instances for the Entity ID */
+-              offset = 0;
++              offset = 1;
+               tota_inst = rsp->data[1];
+               while (tota_inst > 0) {
+                       get_inst = ((tota_inst / DCMI_MAX_BYTE_TEMP_READ_SIZE) ?
+@@ -1603,7 +1603,7 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
+                                   (tota_inst % DCMI_MAX_BYTE_TEMP_READ_SIZE));
+                       rsp = ipmi_dcmi_get_temp_readings(intf,
+                                                         
dcmi_temp_read_vals[i].val,
+-                                                        offset, 0);
++                                                        0, offset);
+                       if (chk_rsp(rsp)) {
+                               continue;
+                       }
diff -Nru ipmitool-1.8.19/debian/patches/0803-fix-sdr-hex-value.patch 
ipmitool-1.8.19/debian/patches/0803-fix-sdr-hex-value.patch
--- ipmitool-1.8.19/debian/patches/0803-fix-sdr-hex-value.patch 1970-01-01 
08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0803-fix-sdr-hex-value.patch 2024-10-27 
22:46:47.000000000 +0800
@@ -0,0 +1,77 @@
+From 202f7427e0a4d1f319fc4b914676cc2f08da6c6c Mon Sep 17 00:00:00 2001
+From: Alexander Amelkin <[email protected]>
+Date: Tue, 17 Sep 2024 15:15:45 +0300
+Subject: [PATCH] sdr: Refix 6e037d6bfbbb93b349c8ca331ebde03a (#41)
+
+A bug was introduced by commit 6e037d6bfbbb93b349c8ca331ebde03a837f76bf
+due to which the command `ipmitool sdr type` stopped accepting raw
+hex values for the type and would only accept strings.
+
+Fix that by partially reverting the troublesome commit.
+
+Additionally, apply the logic of that commit to calls of
+`strcasecmp()` in ipmi_sdr.c.
+
+Resolves https://codeberg.org/IPMITool/ipmitool/issues/41
+
+Signed-off-by: Alexander Amelkin <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/202f7427e0a4d1f319fc4b914676cc2f08da6c6c
+---
+ lib/ipmi_sdr.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c
+index abd4ee1..4732762 100644
+--- a/lib/ipmi_sdr.c
++++ b/lib/ipmi_sdr.c
+@@ -4570,8 +4570,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
+       uint8_t sensor_type = 0;
+ 
+       if (!type ||
+-          strcasecmp(type, "help") == 0 ||
+-          strcasecmp(type, "list") == 0) {
++          !strcasecmp(type, "help") ||
++          !strcasecmp(type, "list"))
++      {
+               printf("Sensor Types:\n");
+               for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
+                       printf("\t%-25s (0x%02x)   %-25s (0x%02x)\n",
+@@ -4581,7 +4582,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
+               return 0;
+       }
+ 
+-      if (!strcmp(type, "0x")) {
++      if (!strncmp(type, "0x", 2)) {
+               /* begins with 0x so let it be entered as raw hex value */
+               if (str2uchar(type, &sensor_type) != 0) {
+                       lprintf(LOG_ERR,
+@@ -4591,7 +4592,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
+               }
+       } else {
+               for (x = 1; x < SENSOR_TYPE_MAX; x++) {
+-                      if (strcasecmp(sensor_type_desc[x], type) == 0) {
++                      if (!strcasecmp(sensor_type_desc[x], type)) {
+                               sensor_type = x;
+                               break;
+                       }
+@@ -4638,8 +4639,8 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char 
*entitystr)
+       int rc = 0;
+ 
+       if (!entitystr ||
+-          strcasecmp(entitystr, "help") == 0 ||
+-          strcasecmp(entitystr, "list") == 0) {
++          !strcasecmp(entitystr, "help") ||
++          !strcasecmp(entitystr, "list")) {
+               print_valstr_2col(entity_id_vals, "Entity IDs", -1);
+               return 0;
+       }
+@@ -4654,7 +4655,7 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char 
*entitystr)
+ 
+                       /* now try string input */
+                       for (i = 0; entity_id_vals[i].str; i++) {
+-                              if (strcasecmp(entitystr, 
entity_id_vals[i].str) == 0) {
++                              if (!strcasecmp(entitystr, 
entity_id_vals[i].str)) {
+                                       entity.id = entity_id_vals[i].val;
+                                       entity.instance = 0x7f;
+                                       j=1;
diff -Nru ipmitool-1.8.19/debian/patches/series 
ipmitool-1.8.19/debian/patches/series
--- ipmitool-1.8.19/debian/patches/series       2023-12-17 19:29:04.000000000 
+0800
+++ ipmitool-1.8.19/debian/patches/series       2024-10-27 23:45:14.000000000 
+0800
@@ -1,8 +1,13 @@
 0105-sensor_reading.patch
 0620-manpage_typo.patch
 0700-build.patch
+0701-disable-libtool-silent.patch
 0100-fix_buf_overflow.patch
 0010-utf8.patch
 0110-unpdate_IANA_URL.patch
 0115-hurd_PATH_MAX.patch
 0625-manpage_wrong_time_set.patch
+0800-fix-buffer-overrun.patch
+0801-fix-lan-print-fails-on-unsupported-parameters.patch
+0802-fix-temp-read-parameters.patch
+0803-fix-sdr-hex-value.patch
diff -Nru ipmitool-1.8.19/debian/rules ipmitool-1.8.19/debian/rules
--- ipmitool-1.8.19/debian/rules        2023-12-17 19:29:04.000000000 +0800
+++ ipmitool-1.8.19/debian/rules        2024-10-27 23:46:22.000000000 +0800
@@ -32,6 +32,10 @@
 override_dh_installsystemd:
        dh_installsystemd --no-enable --name ipmievd
 
+override_dh_autoreconf:
+       autoupdate
+       dh_autoreconf
+
 override_dh_auto_configure:
        dh_auto_configure -- --prefix=/usr --with-kerneldir 
--mandir=/usr/share/man --enable-intf-dummy $(extra_config_opts)
 

Reply via email to