summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2024-11-14 15:08:48 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2024-11-14 15:08:48 +0100
commita0ef7483cccfcab42e635d72c9a537cf6a778893 (patch)
tree5f4b98f575ad0d150b6ac73765a22b6fab679bdb
parent686fa8c1c7328b9e20df2cdbb97b5d7cd30d70ba (diff)
parent8ebf7ba18b07deaae1ddd83f9943acd3413e8eb2 (diff)
-rw-r--r--debian/changelog32
-rw-r--r--debian/control2
-rw-r--r--debian/patches/0701-disable-libtool-silent.patch35
-rw-r--r--debian/patches/0800-fix-buffer-overrun.patch35
-rw-r--r--debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch39
-rw-r--r--debian/patches/0802-fix-temp-read-parameters.patch59
-rw-r--r--debian/patches/0803-fix-sdr-hex-value.patch77
-rw-r--r--debian/patches/series7
-rwxr-xr-xdebian/rules4
9 files changed, 268 insertions, 22 deletions
diff --git a/debian/changelog b/debian/changelog
index 3b76f72..e3b4b01 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,23 +1,17 @@
-ipmitool (1.8.19-8) UNRELEASED; urgency=medium
+ipmitool (1.8.19-7.1) unstable; urgency=medium
- * Add new enterprise-numbers.txt handling:
- - Add new debian/anacron/ipmitool_enterprise.
- - Remove debian/ipmitool_enterprise.txt
- - debian/control:
- + Add Depends weg, anacron.
- - debian/ipmitool.install:
- + Remove debian/ipmitool_enterprise.txt.
- + Add debian/anacron/ipmitool_enterprise.
- - debian/ipmitool.postinst:
- + Add download ipmitool_enterprise.txt.
- * New debian/patches/0120-Fix_Unsupported_Parameter_lookup.patch:
- - Fix error response from Unsupported Parameter lookup (Closes: #1061770).
- * New debian/patches/0125-Do_not_require_IANA_PEN_registry_file.patch:
- - Do not require the IANA PEN registry file (Closes: #1040186).
- * New debian/ipmitool.lintian-overrides:
- - Add Override for groff-message and missing-systemd-timer-for-cron-script.
-
- -- Jörg Frings-Fürst <debian@jff.email> Fri, 05 Jul 2024 19:23:38 +0200
+ * 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 <harry-chen@outlook.com> Sun, 27 Oct 2024 23:57:07 +0800
ipmitool (1.8.19-7) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index adca4df..1ebb036 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
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 --git a/debian/patches/0701-disable-libtool-silent.patch b/debian/patches/0701-disable-libtool-silent.patch
new file mode 100644
index 0000000..804bfcd
--- /dev/null
+++ b/debian/patches/0701-disable-libtool-silent.patch
@@ -0,0 +1,35 @@
+Description: Enable verbose output of libtool and fix warning
+Author: Shengqi Chen <harry-chen@outlook.com>
+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 --git a/debian/patches/0800-fix-buffer-overrun.patch b/debian/patches/0800-fix-buffer-overrun.patch
new file mode 100644
index 0000000..295e08a
--- /dev/null
+++ b/debian/patches/0800-fix-buffer-overrun.patch
@@ -0,0 +1,35 @@
+From b4bc5c335159b1c272e06dba98e2916e3ecc0462 Mon Sep 17 00:00:00 2001
+From: Howitzer105mm <howitzer105mm@noreply.codeberg.org>
+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 <johnathanx.mantey@intel.com>
+Reviewed-on: https://codeberg.org/IPMITool/ipmitool/pulls/24
+Reviewed-by: Alexander Amelkin <alexander@amelkin.msk.ru>
+Co-authored-by: Howitzer105mm <howitzer105mm@noreply.codeberg.org>
+Co-committed-by: Howitzer105mm <howitzer105mm@noreply.codeberg.org>
+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 --git a/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch b/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
new file mode 100644
index 0000000..d38ccff
--- /dev/null
+++ b/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
@@ -0,0 +1,39 @@
+From 137aeb64cbb493d61d6945cac156aba5f0510780 Mon Sep 17 00:00:00 2001
+From: Miao Wang <shankerwangmiao@gmail.com>
+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 <shankerwangmiao@gmail.com>
+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 --git a/debian/patches/0802-fix-temp-read-parameters.patch b/debian/patches/0802-fix-temp-read-parameters.patch
new file mode 100644
index 0000000..1672d25
--- /dev/null
+++ b/debian/patches/0802-fix-temp-read-parameters.patch
@@ -0,0 +1,59 @@
+From ab5ce5baff097ebb6e2a17a171858be213ee68d3 Mon Sep 17 00:00:00 2001
+From: Thang Tran <thuutran@amperecomputing.com>
+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 <thuutran@amperecomputing.com>
+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 --git a/debian/patches/0803-fix-sdr-hex-value.patch b/debian/patches/0803-fix-sdr-hex-value.patch
new file mode 100644
index 0000000..3bb263d
--- /dev/null
+++ b/debian/patches/0803-fix-sdr-hex-value.patch
@@ -0,0 +1,77 @@
+From 202f7427e0a4d1f319fc4b914676cc2f08da6c6c Mon Sep 17 00:00:00 2001
+From: Alexander Amelkin <alexander@amelkin.msk.ru>
+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 <alexander@amelkin.msk.ru>
+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 --git a/debian/patches/series b/debian/patches/series
index 12d8ff7..98065ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,10 +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
-0120-Fix_Unsupported_Parameter_lookup.patch
-0125-Do_not_require_IANA_PEN_registry_file.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 --git a/debian/rules b/debian/rules
index 13b5700..a3c08c5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,6 +32,10 @@ override_dh_auto_install:
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)