From 576167f497847a26f1f13ea07744c622d1c16ceae102ec2ac59fd97fd679fe51 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 5 Mar 2010 15:31:33 +0000 Subject: [PATCH] Accepting request 34171 from systemsmanagement:wbem Copy from systemsmanagement:wbem/ipmitool based on submit request 34171 from user coolo OBS-URL: https://build.opensuse.org/request/show/34171 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ipmitool?expand=0&rev=10 --- compile-fixes | 59 ++-- ekanalyzer_fix_wrong_type_comparison.patch | 36 +++ fix_file_permissions.patch | 48 ++++ fwum_enhance_output.patch | 39 +++ increase_possible_fw_file_size.patch | 168 +++++++++++ ipmitool-1.8.10-implicit-fortify-decl.patch | 6 + ipmitool-1.8.10.tar.bz2 | 3 - ipmitool-1.8.11.tar.bz2 | 3 + ipmitool.changes | 18 ++ ipmitool.spec | 96 ++----- lan_fix_return_value.patch | 11 + sdradd_close_file_handle.patch | 22 ++ several_more_compile_fixes.patch | 302 ++++++++++++++++++++ 13 files changed, 701 insertions(+), 110 deletions(-) create mode 100644 ekanalyzer_fix_wrong_type_comparison.patch create mode 100644 fix_file_permissions.patch create mode 100644 fwum_enhance_output.patch create mode 100644 increase_possible_fw_file_size.patch delete mode 100644 ipmitool-1.8.10.tar.bz2 create mode 100644 ipmitool-1.8.11.tar.bz2 create mode 100644 lan_fix_return_value.patch create mode 100644 sdradd_close_file_handle.patch create mode 100644 several_more_compile_fixes.patch diff --git a/compile-fixes b/compile-fixes index 66e15a5..70dd7f8 100644 --- a/compile-fixes +++ b/compile-fixes @@ -1,15 +1,19 @@ ---- ipmitool-1.8.10/lib/ipmi_chassis.c.orig 2008-07-09 22:14:42.000000000 +0200 -+++ ipmitool-1.8.10/lib/ipmi_chassis.c 2008-09-26 13:28:16.000000000 +0200 -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include - - #include - #include ---- ipmitool-1.8.10/lib/ipmi_ekanalyzer.c.orig 2008-06-10 23:07:39.000000000 +0200 -+++ ipmitool-1.8.10/lib/ipmi_ekanalyzer.c 2008-09-26 13:37:43.000000000 +0200 +Several compiler warning fixes + +These were in SUSE distris for quite some time and got +forwardported from 1.8.10 to 1.8.11. + + +--- + lib/ipmi_ekanalyzer.c | 24 ++++++++++++++---------- + lib/ipmi_fru.c | 3 ++- + lib/ipmi_hpmfwupg.c | 8 ++++---- + 3 files changed, 20 insertions(+), 15 deletions(-) + +Index: ipmitool-1.8.11/lib/ipmi_ekanalyzer.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_ekanalyzer.c ++++ ipmitool-1.8.11/lib/ipmi_ekanalyzer.c @@ -3025,9 +3025,10 @@ ipmi_ek_display_address_table_record( st for ( i = 0; i < entries; i++ ){ @@ -56,9 +60,11 @@ } } ---- ipmitool-1.8.10/lib/ipmi_fru.c.orig 2008-06-10 23:40:47.000000000 +0200 -+++ ipmitool-1.8.10/lib/ipmi_fru.c 2008-09-26 13:22:52.000000000 +0200 -@@ -1259,7 +1259,8 @@ static void ipmi_fru_picmg_ext_print(uin +Index: ipmitool-1.8.11/lib/ipmi_fru.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_fru.c ++++ ipmitool-1.8.11/lib/ipmi_fru.c +@@ -1840,7 +1840,8 @@ static void ipmi_fru_picmg_ext_print(uin for (i=0; i + +--- + lib/ipmi_ekanalyzer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: ipmitool-1.8.11/lib/ipmi_ekanalyzer.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_ekanalyzer.c ++++ ipmitool-1.8.11/lib/ipmi_ekanalyzer.c +@@ -2624,12 +2624,12 @@ ipmi_ek_display_board_info_area( FILE * + if ( !feof(input_file) ){ + unsigned int size_board = 0; + +- /*Bit 5:0 of Board Mfg type represent legnth*/ ++ /*Bit 5:0 of Board Mfg type represent length*/ + size_board = (len & 0x3f); + if (size_board > 0){ + if ( strncmp( board_type, "Custom", 6 ) == 0 ){ + #define NO_MORE_INFO_FIELD 0xc1 +- while ( !feof(input_file) && (board_length > 0) ){ ++ while ( !feof(input_file) && (*board_length > 0) ){ + if (len != NO_MORE_INFO_FIELD){ + printf("Additional Custom Mfg. length: 0x%02x\n", len); + if ( (size_board > 0) && (size_board < (*board_length)) ){ diff --git a/fix_file_permissions.patch b/fix_file_permissions.patch new file mode 100644 index 0000000..834d6a7 --- /dev/null +++ b/fix_file_permissions.patch @@ -0,0 +1,48 @@ +Fix security hole -> wrong file permission + +Reference: +https://bugzillafiles.novell.org/attachment.cgi?id=206754&t=hMTMCz2m9Q + +Signed-off-by: Thomas Renninger +Signed-off-by: Wilken Gottwalt + + +--- + lib/helper.c | 1 - + src/ipmievd.c | 3 +++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +Index: ipmitool-1.8.11/lib/helper.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/helper.c ++++ ipmitool-1.8.11/lib/helper.c +@@ -427,7 +427,6 @@ ipmi_start_daemon(struct ipmi_intf *intf + #endif + + chdir("/"); +- umask(0); + + for (fd=0; fd<64; fd++) { + if (fd != intf->fd) +Index: ipmitool-1.8.11/src/ipmievd.c +=================================================================== +--- ipmitool-1.8.11.orig/src/ipmievd.c ++++ ipmitool-1.8.11/src/ipmievd.c +@@ -687,6 +687,7 @@ ipmievd_main(struct ipmi_event_intf * ei + int i, rc; + int daemon = 1; + struct sigaction act; ++ mode_t oldumask; + + memset(pidfile, 0, 64); + sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum); +@@ -744,7 +745,9 @@ ipmievd_main(struct ipmi_event_intf * ei + } + } + ++ oldumask = umask(022); + fp = ipmi_open_file_write(pidfile); ++ umask(oldumask); + if (fp != NULL) { + fprintf(fp, "%d\n", (int)getpid()); + fclose(fp); diff --git a/fwum_enhance_output.patch b/fwum_enhance_output.patch new file mode 100644 index 0000000..4bbc907 --- /dev/null +++ b/fwum_enhance_output.patch @@ -0,0 +1,39 @@ +Be more verbose when detecting a board mismatch when trying to flash the firmware + +Signed-off-by: Thomas Renninger + +--- + lib/ipmi_fwum.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +Index: ipmitool-1.8.11/lib/ipmi_fwum.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_fwum.c ++++ ipmitool-1.8.11/lib/ipmi_fwum.c +@@ -1656,13 +1656,15 @@ tKFWUM_Status KfwumValidFirmwareForBoard + + if(boardInfo.iana != firmInfo.iana) + { +- printf("Board IANA does not match firmware IANA\n"); ++ printf("Board IANA [%u] does not match firmware IANA [%u]\n", ++ boardInfo.iana, firmInfo.iana); + status = KFWUM_STATUS_ERROR; + } + + if(boardInfo.boardId != firmInfo.boardId) + { +- printf("Board IANA does not match firmware IANA\n"); ++ printf("Error: Board ID [%u] does not match firmware board ID [%u]\n", ++ boardInfo.boardId, firmInfo.boardId); + status = KFWUM_STATUS_ERROR; + } + +@@ -1680,6 +1682,8 @@ static void KfwumOutputInfo(tKFWUM_Board + { + printf("Target Board Id : %u\n",boardInfo.boardId); + printf("Target IANA number : %u\n",boardInfo.iana); ++ printf("FW File Board Id : %u\n",firmInfo.boardId); ++ printf("FW File IANA number : %u\n",firmInfo.iana); + printf("File Size : %lu bytes\n",firmInfo.fileSize); + printf("Firmware Version : %d.%d%d SDR %d\n",firmInfo.versMajor, + firmInfo.versMinor, firmInfo.versSubMinor, firmInfo.sdrRev); diff --git a/increase_possible_fw_file_size.patch b/increase_possible_fw_file_size.patch new file mode 100644 index 0000000..bd9a931 --- /dev/null +++ b/increase_possible_fw_file_size.patch @@ -0,0 +1,168 @@ +Increase possible file size for FW upgrades and avoid segfaults if still too big + +Also close a file descriptor which gets opened, but never closed, compare with: +https://bugzilla.novell.com/show_bug.cgi?id=534909 + +Signed-off-by: Thomas Renninger + +--- + lib/ipmi_fwum.c | 86 ++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 47 insertions(+), 39 deletions(-) + +Index: ipmitool-1.8.11/lib/ipmi_fwum.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_fwum.c ++++ ipmitool-1.8.11/lib/ipmi_fwum.c +@@ -141,7 +141,8 @@ typedef struct sKFWUM_SaveFirmwareInfo + + extern int verbose; + static unsigned char fileName[512]; +-static unsigned char firmBuf[1024*512]; ++#define MAX_FW_FILE_SIZE 1024*512 ++static unsigned char firmBuf[MAX_FW_FILE_SIZE]; + static tKFWUM_SaveFirmwareInfo saveFirmwareInfo; + + static void KfwumOutputHelp(void); +@@ -508,6 +509,12 @@ static tKFWUM_Status KfwumSetupBuffersFr + tKFWUM_Status status = KFWUM_STATUS_OK; + FILE * pFileHandle; + ++ if(fileSize >= MAX_FW_FILE_SIZE) ++ { ++ printf("Error: Firmware file size exceeds %dK\n", MAX_FW_FILE_SIZE / 1024); ++ return KFWUM_STATUS_ERROR; ++ } ++ + pFileHandle = fopen((const char *)pFileName, "rb"); + + if(pFileHandle) +@@ -538,6 +545,7 @@ static tKFWUM_Status KfwumSetupBuffersFr + { + KfwumShowProgress((const unsigned char *)"Reading Firmware from File", 100, 100); + } ++ fclose(pFileHandle); + } + return(status); + } +@@ -986,9 +994,9 @@ static tKFWUM_Status KfwumManualRollback + return status; + } + +-#ifdef PRAGMA_PACK +-#pramga pack(1) +-#endif ++#ifdef PRAGMA_PACK ++#pramga pack(1) ++#endif + struct KfwumStartFirmwareDownloadReq{ + unsigned char lengthLSB; + unsigned char lengthMid; +@@ -996,20 +1004,20 @@ struct KfwumStartFirmwareDownloadReq{ + unsigned char paddingLSB; + unsigned char paddingMSB; + unsigned char useSequence; +-} ATTRIBUTE_PACKING; +-#ifdef PRAGMA_PACK +-#pramga pack(0) +-#endif +- +-#ifdef PRAGMA_PACK +-#pramga pack(1) +-#endif ++} ATTRIBUTE_PACKING; ++#ifdef PRAGMA_PACK ++#pramga pack(0) ++#endif ++ ++#ifdef PRAGMA_PACK ++#pramga pack(1) ++#endif + struct KfwumStartFirmwareDownloadResp { + unsigned char bank; +-} ATTRIBUTE_PACKING; +-#ifdef PRAGMA_PACK +-#pramga pack(0) +-#endif ++} ATTRIBUTE_PACKING; ++#ifdef PRAGMA_PACK ++#pramga pack(0) ++#endif + + static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf * intf, + unsigned long length,unsigned short padding) +@@ -1065,9 +1073,9 @@ static tKFWUM_Status KfwumStartFirmwareI + return status; + } + +-#ifdef PRAGMA_PACK +-#pramga pack(1) +-#endif ++#ifdef PRAGMA_PACK ++#pramga pack(1) ++#endif + struct KfwumSaveFirmwareAddressReq + { + unsigned char addressLSB; +@@ -1075,22 +1083,22 @@ struct KfwumSaveFirmwareAddressReq + unsigned char addressMSB; + unsigned char numBytes; + unsigned char txBuf[KFWUM_SMALL_BUFFER-KFWUM_OLD_CMD_OVERHEAD]; +-} ATTRIBUTE_PACKING; +-#ifdef PRAGMA_PACK +-#pramga pack(0) +-#endif +- +-#ifdef PRAGMA_PACK +-#pramga pack(1) +-#endif ++} ATTRIBUTE_PACKING; ++#ifdef PRAGMA_PACK ++#pramga pack(0) ++#endif ++ ++#ifdef PRAGMA_PACK ++#pramga pack(1) ++#endif + struct KfwumSaveFirmwareSequenceReq + { + unsigned char sequenceNumber; + unsigned char txBuf[KFWUM_BIG_BUFFER]; +-} ATTRIBUTE_PACKING; +-#ifdef PRAGMA_PACK +-#pramga pack(0) +-#endif ++} ATTRIBUTE_PACKING; ++#ifdef PRAGMA_PACK ++#pramga pack(0) ++#endif + + + #define FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT ((unsigned char)6) +@@ -1234,19 +1242,19 @@ static tKFWUM_Status KfwumSaveFirmwareIm + return status; + } + +-#ifdef PRAGMA_PACK +-#pramga pack(1) +-#endif ++#ifdef PRAGMA_PACK ++#pramga pack(1) ++#endif + struct KfwumFinishFirmwareDownloadReq{ + unsigned char versionMaj; + unsigned char versionMinSub; + unsigned char versionSdr; + unsigned char reserved; +-} ATTRIBUTE_PACKING; +-#ifdef PRAGMA_PACK +-#pramga pack(0) +-#endif +- ++} ATTRIBUTE_PACKING; ++#ifdef PRAGMA_PACK ++#pramga pack(0) ++#endif ++ + static tKFWUM_Status KfwumFinishFirmwareImage(struct ipmi_intf * intf, + tKFWUM_InFirmwareInfo firmInfo) + { diff --git a/ipmitool-1.8.10-implicit-fortify-decl.patch b/ipmitool-1.8.10-implicit-fortify-decl.patch index 4a70b2c..f9889ae 100644 --- a/ipmitool-1.8.10-implicit-fortify-decl.patch +++ b/ipmitool-1.8.10-implicit-fortify-decl.patch @@ -1,3 +1,9 @@ +More compiler warning fixes + +These were in SUSE distris for quite some time and got +forwardported from 1.8.10 to 1.8.11. + + Index: lib/ipmi_sdradd.c =================================================================== --- lib/ipmi_sdradd.c.orig 2007-07-11 16:27:46.000000000 +0200 diff --git a/ipmitool-1.8.10.tar.bz2 b/ipmitool-1.8.10.tar.bz2 deleted file mode 100644 index 7c3b327..0000000 --- a/ipmitool-1.8.10.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01e9b622d0a04159fb4072a63cfc8b23bc01b5afd2972287b437aafd3e4df5c9 -size 566266 diff --git a/ipmitool-1.8.11.tar.bz2 b/ipmitool-1.8.11.tar.bz2 new file mode 100644 index 0000000..00ad604 --- /dev/null +++ b/ipmitool-1.8.11.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df219019dc2216c3b7a894edd20286b2118aa636f9990c8405674ce84948eddd +size 584416 diff --git a/ipmitool.changes b/ipmitool.changes index b6a3fe1..071a604 100644 --- a/ipmitool.changes +++ b/ipmitool.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Thu Mar 4 01:59:27 CET 2010 - ro@suse.de + +- fix one more no-return-in-nonvoid-function issue in ipmievd.c + +------------------------------------------------------------------- +Thu Sep 17 17:15:02 CEST 2009 - trenn@suse.de + +- Fixed several compiler warnings (bnc#371131, bnc#480347, bnc#439490, + bnc#525831, bnc#534909) and quite some more. + +------------------------------------------------------------------- +Tue Sep 15 17:45:24 CEST 2009 - trenn@suse.de + +- Update to version 1.8.11 +- Fix segfault when doing firmware upgrades with too big FW files +- Be more verbose why a firmware update does not match + ------------------------------------------------------------------- Tue Oct 14 18:21:55 CEST 2008 - crrodriguez@suse.de diff --git a/ipmitool.spec b/ipmitool.spec index 37ea15a..234828b 100644 --- a/ipmitool.spec +++ b/ipmitool.spec @@ -1,7 +1,7 @@ # -# spec file for package ipmitool (Version 1.8.10) +# spec file for package ipmitool (Version 1.8.11) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,13 +22,20 @@ Name: ipmitool BuildRequires: openssl-devel readline-devel Url: http://ipmitool.sourceforge.net/ Summary: Utility for IPMI Control -Version: 1.8.10 -Release: 3 -License: BSD 3-Clause +Version: 1.8.11 +Release: 1 +License: BSD3c Group: System/Management Source: http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2 Patch: compile-fixes Patch1: ipmitool-1.8.10-implicit-fortify-decl.patch +Patch2: increase_possible_fw_file_size.patch +Patch3: fwum_enhance_output.patch +Patch4: sdradd_close_file_handle.patch +Patch5: ekanalyzer_fix_wrong_type_comparison.patch +Patch6: fix_file_permissions.patch +Patch7: lan_fix_return_value.patch +Patch8: several_more_compile_fixes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -53,6 +60,13 @@ and setting LAN configuration, and chassis power control. %setup -q %patch -p1 %patch1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build touch INSTALL NEWS @@ -78,75 +92,3 @@ rm -rf $RPM_BUILD_ROOT %doc %{_mandir}/man8/* %changelog -* Tue Oct 14 2008 crrodriguez@suse.de -- fix implicit-fortify-decl errors -* Fri Sep 26 2008 duwe@suse.de -- fix ugly code and sloppy programming found by RPMlint -* Fri Sep 12 2008 duwe@suse.de -- update to version 1.8.10 as requested in FATE#304431 - + remove fixes now in mainline -* Thu Jan 17 2008 duwe@suse.de -- Fix bugs 298222 and 144023 (arg checking and POH scaling) -* Thu Mar 08 2007 duwe@suse.de -- add new compile fixes -* Wed Mar 07 2007 duwe@suse.de -- update to 1.8.9, fixing ipmievd crashing. - This was requesten in Bug#246456 -* Fri Oct 13 2006 duwe@suse.de -- update to today's CVS state - * might fix SoL issues (Fate #30911) -* Tue Oct 10 2006 duwe@suse.de -- update to 1.8.8 mainly various fixes: - version 1.8.8 - * Fix segfaults in sensor data repository list - * Fix ipmievd to open interface before daemonizing - * Fix IPMIv1.5 authtype NONE to ignore supplied password - * Fix cipher suite display bug in lan print - * Fix typo in IPMIv2 SOL output when sending break - * Fix improper LUN handling with Tyan SOL - * Add LUN support to OpenIPMI interface - * Add support for Kontron OEM commands - * Update to Kontron Firmware Update command - version 1.8.7 - * Remove nuclear clause from license - * Add Sun OEM command for blades - * Increase argument size for raw commands in shell/exec - * Fix handling of LUNs for LAN interfaces - * Add IPMIv2 SOL loopback test - * Add support for IBM OEM SEL messages - * Disable file paranoia checks on read files by default - * Support IPMIv2 SOL on older Intel boxes - * Display message and exit if keepalive fails during SOL - * Add support for setting VLAN id and priority - * Add support for FreeBSD OpenIPMI-compatible driver - * Add support for IPMIv2 Firmware Firewall - * Fix gcc4 compile warnings - * Make ipmievd generate pidfile - * Add initscripts for ipmievd -* Mon May 29 2006 kukuk@suse.de -- Fix type conversion bug in ipmi_pef.c [#173658] -* Fri May 26 2006 schwab@suse.de -- Add readline-devel to BuildRequires to enable shell command. -- Fix use of channel_info bitfield. -- Fix byte swapping. -* Mon Feb 13 2006 kukuk@suse.de -- Update to ipmitool 1.8.6 [#134708,#131823] - - Fix memory corruption when sending encrypted SOL traffic - - Add keepalive timer to IPMIv2 SOL sessions - - Raise privilege level after creating IPMIv2 session - - Add support for settable SOL escape character with -e option - - Add support for Kg BMC key for IPMIv2 authentication with -k option - - Add support for Tyan IPMIv1.5 SOL with tsol command - - Add support for PICMG devices - - Add support for OEM SEL event parsing - - Add support for command bridging over lan and lanplus interfaces - - New 'chassis selftest' command - - Many bufxies and patches from contributors -* Wed Jan 25 2006 mls@suse.de -- converted neededforbuild to BuildRequires -* Sat Jan 21 2006 schwab@suse.de -- Don't strip binaries. -* Mon Sep 19 2005 kukuk@suse.de -- Fix missing return value -* Thu Aug 04 2005 kukuk@suse.de -- Initial release (FeatureID #165) diff --git a/lan_fix_return_value.patch b/lan_fix_return_value.patch new file mode 100644 index 0000000..fecf76b --- /dev/null +++ b/lan_fix_return_value.patch @@ -0,0 +1,11 @@ +--- ipmitool-1.8.11/src/plugins/lan/lan.c 2010/03/04 00:55:42 1.1 ++++ ipmitool-1.8.11/src/plugins/lan/lan.c 2010/03/04 00:56:39 +@@ -1071,7 +1071,7 @@ + msg = malloc(len); + if (msg == NULL) { + lprintf(LOG_ERR, "ipmitool: malloc failure"); +- return; ++ return msg; + } + memset(msg, 0, len); + diff --git a/sdradd_close_file_handle.patch b/sdradd_close_file_handle.patch new file mode 100644 index 0000000..b5b4c71 --- /dev/null +++ b/sdradd_close_file_handle.patch @@ -0,0 +1,22 @@ +Fix unclosed file handle in ipmi_sdradd.c + +References: +https://bugzilla.novell.com/show_bug.cgi?id=534909 + +Signed-off-by: Thomas Renninger +--- + lib/ipmi_sdradd.c | 1 + + 1 file changed, 1 insertion(+) + +Index: ipmitool-1.8.11/lib/ipmi_sdradd.c +=================================================================== +--- ipmitool-1.8.11.orig/lib/ipmi_sdradd.c ++++ ipmitool-1.8.11/lib/ipmi_sdradd.c +@@ -380,6 +380,7 @@ ipmi_sdr_read_records(const char *filena + queue->tail->next = sdrr; + queue->tail = sdrr; + } ++ close(fd); + return rc; + } + diff --git a/several_more_compile_fixes.patch b/several_more_compile_fixes.patch new file mode 100644 index 0000000..044e64a --- /dev/null +++ b/several_more_compile_fixes.patch @@ -0,0 +1,302 @@ +Fixes several compile warnings listed below + +ipmi_sdr.c: In function 'ipmi_sdr_print_sensor_full': +ipmi_sdr.c:1177: warning: implicit declaration of function 'ipmi_sensor_get_sensor_reading_factors' + +ipmi_chassis.c:1143: warning: unused variable 'i' +ipmi_chassis.c:717: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'long unsigned int' +ipmi_chassis.c:720: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'long unsigned int' +ipmi_chassis.c:724: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'long unsigned int' + +================================================================================ +--- ipmitool-1.8.11/lib/ipmi_chassis.c ++++ ipmitool-1.8.11/lib/ipmi_chassis.c +@@ -714,14 +714,14 @@ + + printf(" Boot Initiator Info :\n"); + printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f)); +- printf(" Session Id : %08Xh\n",session_id); ++ printf(" Session Id : %08lXh\n",session_id); + if(timestamp != 0) + { +- printf(" Timestamp : %08Xh, %s\n",timestamp,time_buf); ++ printf(" Timestamp : %08lXh, %s\n",timestamp,time_buf); + } + else + { +- printf(" Timestamp : %08Xh, undefined\n",timestamp); ++ printf(" Timestamp : %08lXh, undefined\n",timestamp); + } + + } +@@ -1140,8 +1140,6 @@ + memset(&flags[0], 0, sizeof(flags)); + token = strtok_r(argv[2] + 8, ",", &saveptr); + while (token != NULL) { +- int i; +- + if (strcmp(token, "help") == 0) { + optionError = 1; + break; +--- ipmitool-1.8.11/lib/ipmi_ekanalyzer.c ++++ ipmitool-1.8.11/lib/ipmi_ekanalyzer.c +@@ -395,7 +395,6 @@ + static int + ipmi_ek_get_file_type( char * argument ) + { +- int index_name=0; + int filetype = ERROR_STATUS; + + if( strlen (argument) > MIN_ARGUMENT ){ +@@ -1092,8 +1091,6 @@ + } + else{ + int num_file=0; +- int index_data = 0; +- int first_data = 1; + tboolean amc_file = FALSE; /*used to indicate the present of AMC file*/ + tboolean oc_file = FALSE; /*used to indicate the present of Carrier file*/ + +@@ -1139,7 +1136,6 @@ + struct ipmi_ek_multi_header * pcarrier_p2p; + int list = 0; + int match_pair = 0; +- tboolean match_result = FALSE; + + /*Create an empty list*/ + for ( list=0; listheader.len; + offset += sizeof(struct fru_picmgext_link_desc) + ) { +- /* to solve little endian /big endian problem */ ++ /* to solve little endian /big endian problem */ + unsigned long data; + struct fru_picmgext_link_desc * d; + +@@ -3419,7 +3415,7 @@ + + printf(" IPMB-0 Hub Descriptor Count: 0x%02x", record->data[offset++]); + if (record->data[offset] > 0){ +- for (offset; offset < record->header.len;){ ++ for (; offset < record->header.len;){ + unsigned char entry_count = 0; + printf(" IPMB-0 Hub Descriptor\n"); + printf("\tHardware Address: 0x%02x\n", record->data[offset++]); +@@ -3850,7 +3846,7 @@ + (feature > 1) & 1, + (feature&1)?"Source":"Receiver"); + printf("\tFamily: 0x%02x - AccLVL: 0x%02x\n", family, accuracy); +- printf("\tFRQ: %-9d - min: %-9d - max: %-9d\n", ++ printf("\tFRQ: %-9lu - min: %-9lu - max: %-9lu\n", + freq, min_freq, max_freq); + } + printf("\n"); +@@ -3902,9 +3898,9 @@ + else{ + int record_count = 0; + +- if ( verbose == LOG_DEBUG ){ +- printf( "start multi offset = 0x%02x\n", multi_offset ); +- } ++ if ( verbose == LOG_DEBUG ) ++ printf( "start multi offset = 0x%02lx\n", multi_offset ); ++ + /*the offset value is in multiple of 8 bytes.*/ + multi_offset = multi_offset * 8; + fseek ( input_file, multi_offset, SEEK_SET ); +--- ipmitool-1.8.11/lib/ipmi_fwum.c ++++ ipmitool-1.8.11/lib/ipmi_fwum.c +@@ -480,7 +480,7 @@ + + if(pFileHandle) + { +- if(fseek(pFileHandle, 0L , SEEK_END) == (unsigned int) NULL) ++ if(fseek(pFileHandle, 0L , SEEK_END) == 0) + { + *pFileSize = ftell(pFileHandle); + +@@ -1307,7 +1307,6 @@ + unsigned long lastAddress = 0; + unsigned char sequenceNumber = 0; + unsigned char retry = FWUM_MAX_UPLOAD_RETRY; +- unsigned char isLengthValid = 1; + + do + { +--- ipmitool-1.8.11/lib/ipmi_hpmfwupg.c ++++ ipmitool-1.8.11/lib/ipmi_hpmfwupg.c +@@ -1220,7 +1220,6 @@ + *****************************************************************************/ + int HpmfwupgTargetCheck(struct ipmi_intf * intf, int option) + { +- struct HpmfwupgUpgradeCtx fwupgCtx; + struct HpmfwupgGetTargetUpgCapabilitiesCtx targetCapCmd; + int rc = HPMFWUPG_SUCCESS; + int componentId = 0; +@@ -1363,7 +1362,6 @@ + int activate,int componentToUpload, int option) + { + int rc = HPMFWUPG_SUCCESS; +- struct HpmfwupgImageHeader imageHeader; + struct HpmfwupgUpgradeCtx fwupgCtx; + + /* +@@ -1847,8 +1845,6 @@ + unsigned char componentIdByte = 0x00; + VERSIONINFO *pVersionInfo; + +- struct HpmfwupgGetComponentPropertiesCtx getCompProp; +- + /* Save component ID on which the upload is done */ + componentIdByte = pActionRecord->components.ComponentBits.byte; + while ((componentIdByte>>=1)!=0) +@@ -2061,7 +2057,6 @@ + struct HpmfwupgInitiateUpgradeActionCtx initUpgActionCmd; + struct HpmfwupgUploadFirmwareBlockCtx uploadCmd; + struct HpmfwupgFinishFirmwareUploadCtx finishCmd; +- struct HpmfwupgGetComponentPropertiesCtx getCompProp; + VERSIONINFO *pVersionInfo; + + unsigned char* pData, *pDataInitial; +--- ipmitool-1.8.11/lib/ipmi_isol.c ++++ ipmitool-1.8.11/lib/ipmi_isol.c +@@ -413,7 +413,6 @@ + struct ipmi_rs * rsp; + struct ipmi_rq req; + uint8_t data[6]; +- struct isol_config_parameters params; + + memset(&req, 0, sizeof(req)); + req.msg.netfn = IPMI_NETFN_ISOL; +--- ipmitool-1.8.11/lib/ipmi_picmg.c ++++ ipmitool-1.8.11/lib/ipmi_picmg.c +@@ -395,11 +395,11 @@ + } + else if (d->type >= 0x06 && d->type <= 0xef) + { +- printf("Reserved\n",d->type); ++ printf("Reserved %d\n",d->type); + } + else if (d->type >= 0xf0 && d->type <= 0xfe) + { +- printf("OEM GUID Definition\n",d->type); ++ printf("OEM GUID Definition %d\n",d->type); + } + else + { +@@ -471,7 +471,6 @@ + struct ipmi_rq req; + + unsigned char msg_data[6]; +- struct fru_picmgext_link_desc* d; + + memset(&req, 0, sizeof(req)); + +@@ -762,7 +761,7 @@ + return -1; + } + +- printf("LED Color Capabilities: ", rsp->data[1] ); ++ printf("LED Color Capabilities: "); + for ( i=0 ; i<8 ; i++ ) { + if ( rsp->data[1] & (0x01 << i) ) { + printf("%s, ", led_color_str[ i ]); +@@ -945,7 +944,6 @@ + int + ipmi_picmg_set_power_level(struct ipmi_intf * intf, int argc, char ** argv) + { +- int i; + struct ipmi_rs * rsp; + struct ipmi_rq req; + +@@ -1020,7 +1018,6 @@ + int + ipmi_picmg_clk_get(struct ipmi_intf * intf, int argc, char ** argv) + { +- int i; + struct ipmi_rs * rsp; + struct ipmi_rq req; + +@@ -1073,7 +1070,7 @@ + printf(" - Index: %d\n", rsp->data[2]); + printf(" - Family: %d\n", rsp->data[3]); + printf(" - AccLVL: %d\n", rsp->data[4]); +- printf(" - Freq: %d\n", freq); ++ printf(" - Freq: %lu\n", freq); + } + + return 0; +@@ -1083,7 +1080,6 @@ + int + ipmi_picmg_clk_set(struct ipmi_intf * intf, int argc, char ** argv) + { +- int i; + struct ipmi_rs * rsp; + struct ipmi_rq req; + +@@ -1115,10 +1111,10 @@ + #if 1 + printf("## ID: %d\n", msg_data[1]); + printf("## index: %d\n", msg_data[2]); +-printf("## setting: 0x02x\n", msg_data[3]); ++printf("## setting: %0x02x\n", msg_data[3]); + printf("## family: %d\n", msg_data[4]); + printf("## acc: %d\n", msg_data[5]); +-printf("## freq: %d\n", freq ); ++printf("## freq: %lu\n", freq ); + printf("## res: %d\n", msg_data[10]); + #endif + +@@ -1528,15 +1524,10 @@ + else if (!strncmp(argv[0], "clk", 3)) { + if (argc > 1) { + if (!strncmp(argv[1], "get", 3)) { +- if (argc > 2) { +- unsigned char clk_id; +- unsigned char clk_res; +- ++ if (argc > 2) + rc = ipmi_picmg_clk_get(intf, argc-1, &(argv[2])); +- } + else { + printf("clk get []\n"); +- + return -1; + } + } +--- ipmitool-1.8.11/lib/ipmi_sdr.c ++++ ipmitool-1.8.11/lib/ipmi_sdr.c +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + #if HAVE_CONFIG_H + # include +--- ipmitool-1.8.11/lib/ipmi_sdradd.c ++++ ipmitool-1.8.11/lib/ipmi_sdradd.c +@@ -325,7 +325,6 @@ + static int + ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue) + { +- struct sdr_get_rs header; + int rc = 0; + int fd; + uint8_t binHdr[5]; +--- ipmitool-1.8.11/src/ipmievd.c ++++ ipmitool-1.8.11/src/ipmievd.c +@@ -665,6 +665,7 @@ + } + sleep(selwatch_timeout); + } ++ return 0; + } + /*************************************************************************/ +