Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ipmitool for openSUSE:Factory checked in at 2023-07-26 13:22:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ipmitool (Old) and /work/SRC/openSUSE:Factory/.ipmitool.new.15225 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ipmitool" Wed Jul 26 13:22:13 2023 rev:47 rq:1100666 version:1.8.19.13.gbe11d94 Changes: -------- --- /work/SRC/openSUSE:Factory/ipmitool/ipmitool.changes 2022-09-08 14:21:52.290422178 +0200 +++ /work/SRC/openSUSE:Factory/.ipmitool.new.15225/ipmitool.changes 2023-07-26 13:22:30.587505452 +0200 @@ -1,0 +2,22 @@ +Mon Jul 24 10:38:53 UTC 2023 - tr...@suse.de + +- Fix: ipmitool duplicates the timestamp (bsc#1213390) +A Fix-time-format-for-sel-list-v.patch +- Remove: Make-IANA-PEN-download-configurable (is mainline) +D 0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch +- Update to version 1.8.19.13.gbe11d94: + * configure.ac: allow disabling registry downloads + * lan: channel: Fix set alert on/off + * make: use correct docdir variable provided by autotools + * Do not require the IANA PEN registry file + * configure.ac: fix readline static build + * Update github actions for modern OSes + * Update macos target name in github actions + * delloem: Fix the unalign bug in arm64 + * lanplus: Realloc the msg if the payload_length gets updated + * fru print: Add area checksum verification + * fru: Add decoder for multirec system mgmt records + * Fix enterprise-numbers URL + * Update issue templates + +------------------------------------------------------------------- Old: ---- 0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch ipmitool-1.8.19.0.g19d7878.obscpio New: ---- Fix-time-format-for-sel-list-v.patch ipmitool-1.8.19.13.gbe11d94.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ipmitool.spec ++++++ --- /var/tmp/diff_new_pack.sToURQ/_old 2023-07-26 13:22:31.759512085 +0200 +++ /var/tmp/diff_new_pack.sToURQ/_new 2023-07-26 13:22:31.763512108 +0200 @@ -17,7 +17,7 @@ Name: ipmitool -Version: 1.8.19.0.g19d7878 +Version: 1.8.19.13.gbe11d94 Release: 0 Summary: Utility for IPMI Control License: BSD-3-Clause @@ -32,7 +32,7 @@ Patch3: 0003-Cleanup-and-compiler-issues-only-no-functional-chang.patch Patch4: 0004-Adjust-SUSE-paths.patch Patch5: 0005-HPM-x-compatibility-message-is-DEBUG-only.patch -Patch6: 0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch +Patch6: Fix-time-format-for-sel-list-v.patch BuildRequires: libtool BuildRequires: openssl-devel BuildRequires: readline-devel @@ -79,7 +79,8 @@ # file-security: enables more security checks on files %configure \ --enable-file-security \ - --enable-intf-usb + --enable-intf-usb \ + --enable-registry-download=no make %{?_smp_mflags} %install ++++++ Fix-time-format-for-sel-list-v.patch ++++++ From: Thomas Renninger <tr...@suse.com> Subject: Fix time format for sel list -v References: bsc#1213390 Patch-Mainline: Git-commit: d34a56908da3d85c4ddce1be1aab90941177b13b Git-repo: g...@github.com:watologo1/ipmitool.git.git The time for sel entries gets wrongly formatted: SEL Record ID : 3135 Record Type : 02 Timestamp : 18.07.2023 18.07.2023 Generator ID : 0044 This patch fixes this: SEL Record ID : 3135 Record Type : 02 Timestamp : 18.07.2023 11:26:24 CEST Generator ID : 0044 The first hunk for: `sel list -v` The snd hunk for: `sel get ID` Signed-off-by: <tr...@suse.com> diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c index 31c0eea..7d6d01f 100644 --- a/lib/ipmi_sel.c +++ b/lib/ipmi_sel.c @@ -2043,11 +2043,9 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor { printf(" Timestamp : "); if (evt->record_type < 0xc0) - printf("%s %s", ipmi_timestamp_date(evt->sel_type.standard_type.timestamp), - ipmi_timestamp_time(evt->sel_type.standard_type.timestamp)); + printf("%s", ipmi_timestamp_numeric(evt->sel_type.standard_type.timestamp)); else - printf("%s %s", ipmi_timestamp_date(evt->sel_type.oem_ts_type.timestamp), - ipmi_timestamp_time(evt->sel_type.oem_ts_type.timestamp)); + printf("%s", ipmi_timestamp_numeric(evt->sel_type.oem_ts_type.timestamp)); printf("\n"); } @@ -2133,8 +2131,7 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_ if (evt->record_type < 0xe0) { printf(" Timestamp : "); - printf("%s %s\n", ipmi_timestamp_date(evt->sel_type.standard_type.timestamp), - ipmi_timestamp_time(evt->sel_type.standard_type.timestamp)); + printf("%s\n", ipmi_timestamp_numeric(evt->sel_type.standard_type.timestamp)); } ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.sToURQ/_old 2023-07-26 13:22:31.835512515 +0200 +++ /var/tmp/diff_new_pack.sToURQ/_new 2023-07-26 13:22:31.839512538 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/ipmitool/ipmitool.git</param> - <param name="changesrevision">19d78782d795d0cf4ceefe655f616210c9143e62</param></service></servicedata> + <param name="changesrevision">be11d948f89b10be094e28d8a0a5e8fb532c7b60</param></service></servicedata> (No newline at EOF) ++++++ enterprise-numbers ++++++ ++++ 14387 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/ipmitool/enterprise-numbers ++++ and /work/SRC/openSUSE:Factory/.ipmitool.new.15225/enterprise-numbers ++++++ ipmitool-1.8.19.0.g19d7878.obscpio -> ipmitool-1.8.19.13.gbe11d94.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/.github/ISSUE_TEMPLATE/bug_report.md new/ipmitool-1.8.19.13.gbe11d94/.github/ISSUE_TEMPLATE/bug_report.md --- old/ipmitool-1.8.19.0.g19d7878/.github/ISSUE_TEMPLATE/bug_report.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ipmitool-1.8.19.13.gbe11d94/.github/ISSUE_TEMPLATE/bug_report.md 2023-01-12 11:51:20.000000000 +0100 @@ -0,0 +1,37 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: AlexanderAmelkin + +--- + +**Describe the bug** +A clear and concise description of what the bug is. +*Please **DO NOT** report ANYTHING about 1.8.18, it is outdated. Please first check your alleged bug with the latest code from the top of the master branch here.* + +**IPMITOOL Version** + +Make sure you're reporting a bug in the latest code taken from `master` branch here, NOT a bug +that you've found in some version that you've got from your OS vendor or any source other than this repository. + +```none +$ ipmitool -V +<output here> +``` + +**To Reproduce** +Steps to reproduce the behavior: +1. Using hardware/BMC '...' +2. Run `ipmitool ...` +3. Observe the abnormal reply: + ```none + abnormal output example + ``` + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/.github/workflows/ci.yml new/ipmitool-1.8.19.13.gbe11d94/.github/workflows/ci.yml --- old/ipmitool-1.8.19.0.g19d7878/.github/workflows/ci.yml 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/.github/workflows/ci.yml 2023-01-12 11:51:20.000000000 +0100 @@ -11,7 +11,7 @@ linux: strategy: matrix: - os: [ ubuntu-18.04, ubuntu-20.04 ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ] runs-on: ${{ matrix.os }} steps: - name: install dependencies @@ -53,10 +53,10 @@ - name: make distcheck run: make distcheck - macos-catalina: + macos: strategy: matrix: - os: [ macos-10.15, macos-11 ] + os: [ macos-10.15, macos-11, macos-12 ] runs-on: ${{ matrix.os }} steps: @@ -77,9 +77,11 @@ - name: make distcheck run: make distcheck - win-srv-2019: - - runs-on: windows-2019 + windows: + strategy: + matrix: + os: [ windows-2019, windows-2022 ] + runs-on: ${{ matrix.os }} steps: - name: install dependencies diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/INSTALL new/ipmitool-1.8.19.13.gbe11d94/INSTALL --- old/ipmitool-1.8.19.0.g19d7878/INSTALL 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/INSTALL 2023-01-12 11:51:20.000000000 +0100 @@ -18,11 +18,14 @@ project is tested automatically to build cleanly for the following 64-bit operating systems using GitHub Actions workflow: - - Ubuntu 16.04 Xenial Xerus - Ubuntu 18.04 Bionic Beaver - Ubuntu 20.04 Focal Fossa + - Ubuntu 22.04 Jammy Jellyfish - MacOS X 10.15 Catalina + - MacOS 11 Big Sur + - MacOS 12 Monterey - Microsoft Windows Server 2019 + - Microsoft Windows Server 2022 It is also known to build successfully on Ubuntu 14.04 and Fedora 31, but that is not automatically verified. @@ -41,8 +44,8 @@ $ sudo dnf install automake gcc git libtool make openssl-devel \ readline-devel wget - For MacOS X 10.15 with Xcode and homebrew installed, it is -recommended to do the following before building: + For MacOS with Xcode and homebrew installed, it is recommended to do the +following before building: $ brew install automake openssl libtool freeipmi wget $ export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" @@ -182,7 +185,7 @@ installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. - On MacOS X 10.5 and later systems, you can create libraries and + On MacOS and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/Makefile.am new/ipmitool-1.8.19.13.gbe11d94/Makefile.am --- old/ipmitool-1.8.19.0.g19d7878/Makefile.am 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/Makefile.am 2023-01-12 11:51:20.000000000 +0100 @@ -28,7 +28,7 @@ # LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, # EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -DOCDIR = $(datadir)/doc/$(PACKAGE) +DOCDIR = $(docdir) DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog EXTRA_DIST = $(DOCLIST) bootstrap @@ -41,7 +41,7 @@ $(distdir).tar.gz $(distdir).tar.bz2 SUBDIRS = lib src include doc contrib control -IANA_PEN = http://www.iana.org/assignments/enterprise-numbers +IANA_PEN = http://www.iana.org/assignments/enterprise-numbers.txt dist-hook: cp control/ipmitool.spec $(distdir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/configure.ac new/ipmitool-1.8.19.13.gbe11d94/configure.ac --- old/ipmitool-1.8.19.0.g19d7878/configure.ac 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/configure.ac 2023-01-12 11:51:20.000000000 +0100 @@ -18,8 +18,6 @@ AC_PROG_MAKE_SET AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm]) AC_CHECK_PROG([SED], [sed], [sed]) -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]) @@ -56,21 +54,33 @@ exec_prefix="$prefix" fi -if test "x$WGET" = "x"; then - if test "x$CURL" = "x"; then +dnl allow enabling/disabling the fetching of the IANA PEN registry +AC_ARG_ENABLE([registry-download], + [AC_HELP_STRING([--enable-registry-download], + [download/install the IANA PEN registry [default=yes]])], + [xenable_registry_download=$enableval], + [xenable_registry_download=yes]) + +AM_CONDITIONAL([DOWNLOAD], [false]) + +if test "x$xenable_registry_download" = "xyes"; then + AC_CHECK_PROG([WGET], [wget], [wget]) + AC_CHECK_PROG([CURL], [curl], [curl]) + + if test "x$WGET" = "x" && test "x$CURL" = "x"; then AC_MSG_WARN([** Neither wget nor curl could be found.]) AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !]) else - DOWNLOAD="$CURL --location --progress-bar" AM_CONDITIONAL([DOWNLOAD], [true]) + if test "x$WGET" != "x"; then + DOWNLOAD="$WGET -c -nd -O -" + else + DOWNLOAD="$CURL --location --progress-bar" + fi fi -else - DOWNLOAD="$WGET -c -nd -O -" - AM_CONDITIONAL([DOWNLOAD], [true]) fi -AC_MSG_WARN([** Download is:]) -AC_MSG_WARN($DOWNLOAD) +AC_MSG_WARN([** Download is: $DOWNLOAD]) AC_SUBST(DOWNLOAD, $DOWNLOAD) dnl @@ -624,7 +634,11 @@ dnl check for readline library to enable ipmi shell if test "x$xenable_ipmishell" = "xyes"; then - AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes]) + PKG_PROG_PKG_CONFIG + PKG_CHECK_MODULES([READLINE], [readline], + [LIBS="$LIBS $READLINE_LIBS" have_readline=yes], + [AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])] + ) if test "x$have_readline" != "xyes"; then AC_MSG_ERROR([** Unable to find readline required by ipmishell.]) xenable_ipmishell=no diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_channel.h new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_channel.h --- old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_channel.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_channel.h 2023-01-12 11:51:20.000000000 +0100 @@ -89,10 +89,16 @@ uint8_t aux_info[2]; }; -/* (22.23) Get Channel Access */ + +/* (22.22 / 22.23) Set/Get Channel Access */ +typedef enum { + ALERTING_ENABLED = 0, + ALERTING_DISABLED = (1 << 5) /* See Table 22 */ +} alerting_t; + struct channel_access_t { uint8_t access_mode; - uint8_t alerting; + alerting_t alerting; uint8_t channel; uint8_t per_message_auth; uint8_t privilege_limit; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_delloem.h new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_delloem.h --- old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_delloem.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_delloem.h 2023-01-12 11:51:20.000000000 +0100 @@ -343,10 +343,6 @@ uint16_t peakheadroom; } __attribute__ ((packed)) POWER_HEADROOM; -struct vFlashstr { - uint8_t val; - const char * str; -}; typedef struct ipmi_vFlash_extended_info { uint8_t vflashcompcode; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_fru.h new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_fru.h --- old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_fru.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_fru.h 2023-01-12 11:51:20.000000000 +0100 @@ -127,6 +127,7 @@ #ifdef HAVE_PRAGMA_PACK #pragma pack(1) #endif +/* See Table 16-1 of "IPMI FRU Information Storage Specification" */ struct fru_multirec_header { #define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00 #define FRU_RECORD_TYPE_DC_OUTPUT 0x01 @@ -136,6 +137,8 @@ #define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05 #define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0 uint8_t type; +#define FRU_RECORD_FORMAT_EOL_MASK 0x80 +#define FRU_RECORD_FORMAT_VER_MASK 0x0F uint8_t format; uint8_t len; uint8_t record_checksum; @@ -242,6 +245,43 @@ #endif #ifdef HAVE_PRAGMA_PACK +#pragma pack(push, 1) +#endif +/* + * In accordance with Table 18-7 of "IPMI Platform Management FRU Information + * Storage Definition v1.0" + */ +struct fru_multirec_mgmt { +#define FRU_MULTIREC_MGMT_SUBTYPE_MIN 0x01 +#define FRU_MULTIREC_MGMT_SUBTYPE_MAX 0x07 + uint8_t subtype; +#define FRU_MULTIREC_MGMT_SYSURL 0x01 +#define FRU_MULTIREC_MGMT_CMPURL 0x04 +#define FRU_MULTIREC_MGMT_URL_MINLEN 16 +#define FRU_MULTIREC_MGMT_URL_MAXLEN 256 + +#define FRU_MULTIREC_MGMT_SYSNAME 0x02 +#define FRU_MULTIREC_MGMT_CMPNAME 0x05 +#define FRU_MULTIREC_MGMT_NAME_MINLEN 8 +#define FRU_MULTIREC_MGMT_NAME_MAXLEN 64 + +#define FRU_MULTIREC_MGMT_SYSPINGADDR 0x03 +#define FRU_MULTIREC_MGMT_CMPPINGADDR 0x06 +#define FRU_MULTIREC_MGMT_PINGADDR_MINLEN 8 +#define FRU_MULTIREC_MGMT_PINGADDR_MAXLEN 64 + +#define FRU_MULTIREC_MGMT_UUID 0x07 +#define FRU_MULTIREC_MGMT_UUID_LEN 16 + +#define FRU_MULTIREC_MGMT_DATA_MAXLEN FRU_MULTIREC_MGMT_URL_MAXLEN + uint8_t data[]; +} ATTRIBUTE_PACKING; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack(pop) +#endif + +#ifdef HAVE_PRAGMA_PACK #pragma pack(1) #endif struct fru_multirec_oem_header { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_mc.h new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_mc.h --- old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_mc.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_mc.h 2023-01-12 11:51:20.000000000 +0100 @@ -211,6 +211,21 @@ parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode); +/** + * Convert a binary GUID/UUID to a canonical hex string form. + * If the version/encoding of the source data is unknown, + * dump the source data as a simple hex string. + * + * @param[out] str The string representation of GUID + * @param[in] data The source binary GUID data + * @param[in] mode The conversion mode, use GUID_AUTO for automatic detection + * + * @returns The parsed GUID structure + */ +parsed_guid_t +ipmi_guid2str(char *str, const void *data, ipmi_guid_mode_t mode); +#define GUID_STR_MAXLEN 36 /* 8+4+4+4+12 bytes plus the dashes */ + int _ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid); #ifdef HAVE_PRAGMA_PACK diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_strings.h new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_strings.h --- old/ipmitool-1.8.19.0.g19d7878/include/ipmitool/ipmi_strings.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/include/ipmitool/ipmi_strings.h 2023-01-12 11:51:20.000000000 +0100 @@ -55,7 +55,7 @@ extern const struct valstr ipmi_encryption_algorithms[]; extern const struct valstr ipmi_user_enable_status_vals[]; extern const struct valstr *ipmi_oem_info; -int ipmi_oem_info_init(); +void ipmi_oem_info_init(); void ipmi_oem_info_free(); extern const struct valstr picmg_frucontrol_vals[]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_delloem.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_delloem.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_delloem.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_delloem.c 2023-01-12 11:51:20.000000000 +0100 @@ -115,7 +115,7 @@ "shared with failover all loms" }; -const struct vFlashstr vFlash_completion_code_vals[] = { +const struct valstr vFlash_completion_code_vals[] = { {0x00, "SUCCESS"}, {0x01, "NO_SD_CARD"}, {0x63, "UNKNOWN_ERROR"}, @@ -232,8 +232,6 @@ /* vFlash Function prototypes */ static int ipmi_delloem_vFlash_main(struct ipmi_intf *intf, int argc, char **argv); -const char *get_vFlash_compcode_str(uint8_t vflashcompcode, - const struct vFlashstr *vs); static int ipmi_get_sd_card_info(struct ipmi_intf *intf); static int ipmi_delloem_vFlash_process(struct ipmi_intf *intf, int current_arg, char **argv); @@ -3757,28 +3755,6 @@ return rc; } /* - * Function Name: get_vFlash_compcode_str - * - * Description: This function maps the vFlash completion code - * to a string - * Input : vFlash completion code and static array of codes vs strings - * Output: - - * Return: returns the mapped string - */ -const char * -get_vFlash_compcode_str(uint8_t vflashcompcode, const struct vFlashstr *vs) -{ - static char un_str[32]; - int i; - for (i = 0; vs[i].str; i++) { - if (vs[i].val == vflashcompcode) - return vs[i].str; - } - memset(un_str, 0, 32); - snprintf(un_str, 32, "Unknown (0x%02X)", vflashcompcode); - return un_str; -} -/* * Function Name: ipmi_get_sd_card_info * * Description: This function prints the vFlash Extended SD card info @@ -3822,7 +3798,7 @@ return -1; } else if (sdcardinfoblock->vflashcompcode != 0x00) { lprintf(LOG_ERR, "Error in getting SD Card Extended Information (%s)", - get_vFlash_compcode_str(sdcardinfoblock->vflashcompcode, + val2str(sdcardinfoblock->vflashcompcode, vFlash_completion_code_vals)); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_fru.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_fru.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_fru.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_fru.c 2023-01-12 11:51:20.000000000 +0100 @@ -42,6 +42,7 @@ #include <ipmitool/ipmi_time.h> #include <stdbool.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <time.h> @@ -140,6 +141,50 @@ uint32_t offset, uint32_t length, uint8_t *frubuf); void free_fru_bloc(t_ipmi_fru_bloc *bloc); +/** + * Caclculate the simple FRU checksum as per IPMI FRU specification. + * Works both for the whole FRU image and for separate areas. + * + * @param[in] area Pointer to the start of checksummed area, + * the area must end with the checksum byte + * @param[in[ len Length of the checksummed area, including + * the trailing checksum byte + * @returns The calculated checksum byte + */ +static +uint8_t fru_calc_checksum(void *area, size_t len) +{ + uint8_t checksum = 0; + uint8_t * data = area; + size_t i; + + for (i = 0; i < len - 1; i++) + checksum += data[i]; + + return -checksum; +} + +/** + * Check if FRU checksum is valid. Works both on the + * whole FRU image and on separate areas. + * + * @param[in] area Pointer to the start of checksummed area, + * the area must end with the checksum byte + * @param[in[ len Length of the checksummed area, including + * the trailing checksum byte + * @returns The boolean state of checksum validity + * @retval true Checksum is valid + * @retval false Checsum in invalid + */ +static +bool fru_checksum_is_valid(void *area, size_t len) +{ + uint8_t * data = area; + + /* Checksum is valid when the stored checksum equals calculated */ + return data[len - 1] == fru_calc_checksum(area, len); +} + /* get_fru_area_str - Parse FRU area string from raw data * * @data: raw FRU data @@ -1047,6 +1092,12 @@ } } + /* Check area checksum */ + printf(" Chassis Area Checksum : %s\n", + fru_checksum_is_valid(fru_data, fru_len) + ? "OK" + : "INVALID"); + free_n(&fru_data); } @@ -1158,6 +1209,12 @@ break; } + /* Check area checksum */ + printf(" Board Area Checksum : %s\n", + fru_checksum_is_valid(fru_data, fru_len) + ? "OK" + : "INVALID"); + free_n(&fru_data); } @@ -1280,9 +1337,35 @@ break; } + /* Check area checksum */ + printf(" Product Area Checksum : %s\n", + fru_checksum_is_valid(fru_data, fru_len) + ? "OK" + : "INVALID"); + free_n(&fru_data); } +/** + * Take n bytes from src and convert them into hex doublets in dst + * + * The function is invoked from a place where the dst is known to + * have enough space to accomodate the hex string representation + * of a UUID. + * + * @param[out] dst The destination buffer (at least 33 bytes long) + * @param[in] src The source binary data + * @param[in] n The length of the source data, for compatibility + * with strncpy() on calls from fru_area_print_multirec() + */ +static +char * +uuidstrncpy(char *dst, const char *src, size_t n) +{ + (void)ipmi_guid2str(dst, src, GUID_AUTO); + return dst; +} + /* fru_area_print_multirec - Print FRU Multi Record Area * * @intf: ipmi interface @@ -1467,8 +1550,86 @@ } } break; + case FRU_RECORD_TYPE_MANAGEMENT_ACCESS: + { + struct fru_multirec_mgmt *mmh = + (struct fru_multirect_mgmt *) + &fru_data[sizeof(struct fru_multirec_header)]; + size_t datalen = h->len - sizeof(*mmh); + struct { + unsigned char *name; + size_t minlen; + size_t maxlen; + char * (*convert)(char *, const char *, size_t); + } subtypes[FRU_MULTIREC_MGMT_SUBTYPE_MAX + 1] = { + [FRU_MULTIREC_MGMT_SYSURL] = { + "System Management URL", + FRU_MULTIREC_MGMT_URL_MINLEN, + FRU_MULTIREC_MGMT_URL_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_SYSNAME] = { + "System Name", + FRU_MULTIREC_MGMT_NAME_MINLEN, + FRU_MULTIREC_MGMT_NAME_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_SYSPINGADDR] = { + "System Ping Address", + FRU_MULTIREC_MGMT_PINGADDR_MINLEN, + FRU_MULTIREC_MGMT_PINGADDR_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_CMPURL] = { + "Component Management URL", + FRU_MULTIREC_MGMT_URL_MINLEN, + FRU_MULTIREC_MGMT_URL_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_CMPNAME] = { + "Component Name", + FRU_MULTIREC_MGMT_NAME_MINLEN, + FRU_MULTIREC_MGMT_NAME_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_CMPPINGADDR] = { + "Component Ping Address", + FRU_MULTIREC_MGMT_PINGADDR_MINLEN, + FRU_MULTIREC_MGMT_PINGADDR_MAXLEN, + strncpy + }, + [FRU_MULTIREC_MGMT_UUID] = { + "System Unique ID", + FRU_MULTIREC_MGMT_UUID_LEN, + FRU_MULTIREC_MGMT_UUID_LEN, + uuidstrncpy + } + }; + unsigned char string[FRU_MULTIREC_MGMT_DATA_MAXLEN + 1] = { 0 }; + + if (mmh->subtype < FRU_MULTIREC_MGMT_SUBTYPE_MIN || + mmh->subtype > FRU_MULTIREC_MGMT_SUBTYPE_MAX) + { + lprintf(LOG_WARN, "Unsupported subtype 0x%02x found for " + "multi-record area management record\n", + mmh->subtype); + break; + } + + if (datalen < subtypes[mmh->subtype].minlen || + datalen > subtypes[mmh->subtype].maxlen) + { + lprintf(LOG_WARN, + "Wrong data length %zu, must be %zu < X < %zu\n", + datalen, + subtypes[mmh->subtype].minlen, + subtypes[mmh->subtype].maxlen); + } + subtypes[mmh->subtype].convert(string, mmh->data, datalen); + printf(" %-22s: %s\n", subtypes[mmh->subtype].name, string); + } } - } while (!(h->format & 0x80)); + } while (!(h->format & FRU_RECORD_FORMAT_EOL_MASK)); lprintf(LOG_DEBUG ,"Multi-Record area ends at: %i (%xh)", last_off, last_off); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_lanp.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_lanp.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_lanp.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_lanp.c 2023-01-12 11:51:20.000000000 +0100 @@ -1026,10 +1026,10 @@ channel); return (-1); } - if (enable != 0) { - channel_access.alerting = 1; + if (enable) { + channel_access.alerting = ALERTING_ENABLED; } else { - channel_access.alerting = 0; + channel_access.alerting = ALERTING_DISABLED; } /* non-volatile */ ccode = _ipmi_set_channel_access(intf, channel_access, 1, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_main.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_main.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_main.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_main.c 2023-01-12 11:51:20.000000000 +0100 @@ -853,10 +853,7 @@ } /* load the IANA PEN registry */ - if (ipmi_oem_info_init()) { - lprintf(LOG_ERR, "Failed to initialize the OEM info dictionary"); - goto out_free; - } + ipmi_oem_info_init(); /* run OEM setup if found */ if (oemtype && diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_mc.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_mc.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_mc.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_mc.c 2023-01-12 11:51:20.000000000 +0100 @@ -696,6 +696,27 @@ return parsed_guid; } +parsed_guid_t +ipmi_guid2str(char *str, const void *data, ipmi_guid_mode_t mode) +{ + parsed_guid_t guid; + guid = ipmi_parse_guid(data, mode); + + if (GUID_DUMP == guid.mode) { + sprintf(str, "%s", buf2str(data, sizeof(ipmi_guid_t))); + return guid; + } + + sprintf(str, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", + (int)guid.time_low, + (int)guid.time_mid, + (int)guid.time_hi_and_version, + (int)guid.clock_seq_and_rsvd, + (int)guid.node[0], (int)guid.node[1], (int)guid.node[2], + (int)guid.node[3], (int)guid.node[4], (int)guid.node[5]); + return guid; +} + /* ipmi_mc_print_guid - print-out given BMC GUID * * @param[in] intf - The IPMI interface to request GUID from @@ -740,24 +761,11 @@ printf("System GUID : "); - guid = ipmi_parse_guid(guid_data, guid_mode); - if (GUID_DUMP == guid.mode) { - size_t i; - for (i = 0; i < sizeof(guid_data); ++i) { - printf("%02X", guid_data[i]); - } - printf("\n"); - return 0; - } - - printf("%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n", - (int)guid.time_low, - (int)guid.time_mid, - (int)guid.time_hi_and_version, - guid.clock_seq_and_rsvd, - guid.node[0], guid.node[1], guid.node[2], - guid.node[3], guid.node[4], guid.node[5]); + char buf[GUID_STR_MAXLEN + 1]; + guid = ipmi_guid2str(buf, guid_data, guid_mode); + printf("%s\n", buf); + /* Print the GUID properties */ if (GUID_AUTO == guid_mode) { /* ipmi_parse_guid() returns only valid modes in guid.ver */ printf("GUID Encoding : %s", guid_mode_str[guid.mode]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_strings.c new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_strings.c --- old/ipmitool-1.8.19.0.g19d7878/lib/ipmi_strings.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/lib/ipmi_strings.c 2023-01-12 11:51:20.000000000 +0100 @@ -1719,39 +1719,30 @@ return rc; } -int ipmi_oem_info_init() +void ipmi_oem_info_init() { oem_valstr_list_t terminator = { { -1, NULL}, NULL }; /* Terminator */ oem_valstr_list_t *oemlist = &terminator; bool free_strings = true; - size_t count; - int rc = -4; + int count; lprintf(LOG_INFO, "Loading IANA PEN Registry..."); if (ipmi_oem_info) { lprintf(LOG_INFO, "IANA PEN Registry is already loaded"); - rc = 0; goto out; } - if (!(count = oem_info_list_load(&oemlist))) { - /* - * We can't identify OEMs without a loaded registry. - * Set the pointer to dummy and return. - */ - ipmi_oem_info = ipmi_oem_info_dummy; - goto out; + if ((count = oem_info_list_load(&oemlist)) < 1) { + lprintf(LOG_WARN, "Failed to load entries from IANA PEN Registry"); + count = 0; } /* In the array was allocated, don't free the strings at cleanup */ free_strings = !oem_info_init_from_list(oemlist, count); - rc = IPMI_CC_OK; - out: oem_info_list_free(&oemlist, free_strings); - return rc; } void ipmi_oem_info_free() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/src/plugins/lanplus/lanplus.c new/ipmitool-1.8.19.13.gbe11d94/src/plugins/lanplus/lanplus.c --- old/ipmitool-1.8.19.0.g19d7878/src/plugins/lanplus/lanplus.c 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/src/plugins/lanplus/lanplus.c 2023-01-12 11:51:20.000000000 +0100 @@ -1727,6 +1727,7 @@ */ if (session->v2_data.session_state == LANPLUS_STATE_ACTIVE) { + uint16_t old_payload_length = payload->payload_length; /* Payload len is adjusted as necessary by lanplus_encrypt_payload */ lanplus_encrypt_payload(session->v2_data.crypt_alg, /* input */ session->v2_data.k2, /* input */ @@ -1735,6 +1736,24 @@ msg + IPMI_LANPLUS_OFFSET_PAYLOAD, /* output */ &(payload->payload_length)); /* output */ + if (old_payload_length != payload->payload_length) + { + len = + IPMI_LANPLUS_OFFSET_PAYLOAD + + payload->payload_length + + IPMI_MAX_INTEGRITY_PAD_SIZE + + IPMI_LANPLUS_PAD_LENGTH_SIZE + + IPMI_LANPLUS_NEXT_HEADER_SIZE + + IPMI_MAX_AUTH_CODE_SIZE; + + uint8_t * new_msg = realloc(msg, len); + if (!new_msg) { + free(msg); + lprintf(LOG_ERR, "ipmitool: realloc failure"); + return; + } + msg = new_msg; + } } /* Now we know the payload length */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipmitool-1.8.19.0.g19d7878/src/plugins/lanplus/lanplus.h new/ipmitool-1.8.19.13.gbe11d94/src/plugins/lanplus/lanplus.h --- old/ipmitool-1.8.19.0.g19d7878/src/plugins/lanplus/lanplus.h 2022-09-01 20:42:31.000000000 +0200 +++ new/ipmitool-1.8.19.13.gbe11d94/src/plugins/lanplus/lanplus.h 2023-01-12 11:51:20.000000000 +0100 @@ -86,6 +86,8 @@ #define IPMI_LANPLUS_OFFSET_PAYLOAD_SIZE 0x0E #define IPMI_LANPLUS_OFFSET_PAYLOAD 0x10 +#define IPMI_LANPLUS_PAD_LENGTH_SIZE 1 +#define IPMI_LANPLUS_NEXT_HEADER_SIZE 1 #define IPMI_GET_CHANNEL_AUTH_CAP 0x38 ++++++ ipmitool.obsinfo ++++++ --- /var/tmp/diff_new_pack.sToURQ/_old 2023-07-26 13:22:32.283515051 +0200 +++ /var/tmp/diff_new_pack.sToURQ/_new 2023-07-26 13:22:32.291515096 +0200 @@ -1,5 +1,5 @@ name: ipmitool -version: 1.8.19.0.g19d7878 -mtime: 1662057751 -commit: 19d78782d795d0cf4ceefe655f616210c9143e62 +version: 1.8.19.13.gbe11d94 +mtime: 1673520680 +commit: be11d948f89b10be094e28d8a0a5e8fb532c7b60