summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* configure.ac: allow disabling registry downloadsHEADmasterVincent Fazio2023-01-121-10/+20
| | | | | | | | Some environments require reproducible builds. Since the IANA PEN registry is constantly updating and there is no snapshot available, installing ipmitool via `make install` is not reproducible. Provide a configure mechanism to disable the registry download/install..
* lan: channel: Fix set alert on/offAlexander Amelkin2023-01-122-5/+11
| | | | | | | | | | | | | | | | | | From IPMI Spec, Chapter 22.22 Set Channel Access Command Table 22, Set Channel Access Command Byte#2, Bit#5 is "PEF Alerting Enable/Disable" And the bit value: 0b = enable PEF Alerting 1b = disable PEF Alerting on this channel In current code, alert "on" set Bit#5 to 1 and alert "off" set Bit#5 to 0, it's straightforward but just opposite of IPMI spec bit definition. Resolves ipmitool/ipmitool#247 Reported-by: Ryan Fang <Ryan.Fang@quantatw.com> Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* make: use correct docdir variable provided by autotoolsAlexander Kapshuna2023-01-111-1/+1
|
* Do not require the IANA PEN registry fileVincent Fazio2023-01-113-19/+7
| | | | | | | | | | | | | | | | | | | | | | | Previously, ipmitool would fail to run if the local copy of the IANA PEN registry could not be parsed. When the registry is not available the manufacturer will be "Unknown" but ipmitool will otherwise function so should not be considered fatal. Also, fix an issue with improperly handling the `oem_info_list_load` return value. Previously, in `ipmi_oem_info_init`, if `oem_info_list_load` returned a negative value due to the registry file not existing, an improper count would cause `oem_info_init_from_list` to aallocate a list that didn't encompass the full header/tail list. IANA PEN registry open failed: No such file or directory Allocating 3 entries [ 1] 16777214 | A Debug Assisting Company, Ltd. [ 0] 1048575 | Unspecified Now, use a signed int and ensure a valid count of loaded OEMs is used. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
* configure.ac: fix readline static buildFabrice Fontaine2023-01-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | Use pkg-config to retrieve readline dependencies such as ncurses to avoid the following static build when readline is built with ncurses support (which is raised since version 1.8.19 and https://github.com/ipmitool/ipmitool/commit/63dd71c39c9bf522ad3a785dd001737a285458eb): ** Unable to build Solaris 9 x86 IPMI interface support! checking for library containing readline... no configure: error: ** Unable to find readline required by ipmishell. [...] configure:15125: /tmp/instance-0/output-1/host/bin/armeb-buildroot-linux-musleabi-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -static -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static conftest.c -lreadline -lcrypto >&5 /tmp/instance-0/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/11.3.0/../../../../armeb-buildroot-linux-musleabi/bin/ld: /tmp/instance-0/output-1/host/armeb-buildroot-linux-musleabi/sysroot/usr/lib/libreadline.a(display.o): in function `_rl_move_cursor_relative': display.c:(.text+0x80fc): undefined reference to `tputs' Fixes: - http://autobuild.buildroot.org/results/dabc6a4f49d464c129ac6bc3710011678142fcbe Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Update github actions for modern OSesAlexander Amelkin2023-01-112-9/+14
| | | | | | Add Ubuntu 22.04, MacOS 12, Windows Server 2022 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Update macos target name in github actionsAlexander Amelkin2023-01-111-1/+1
| | | | | | | | The name `macos-catalina` was not correct as the script was actually executed bothe for catalina (macos-10.15) and big sur (macos-11). Renamed it to just `macos`. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* delloem: Fix the unalign bug in arm64SliderLu2023-01-092-30/+2
| | | | | | | | | For computers using the arm64 of the Apple chip, the link requires strict alignment of pointers in 32-bit form. Replace the struct vFlashstr to valstr. Replace the Function get_vFlash_compcode_str to val2str. Resolves ipmitool/ipmitool#332 Signed-off-by: SliderLu <314238828@qq.com>
* lanplus: Realloc the msg if the payload_length gets updatedTom Tung2023-01-052-0/+21
| | | | | | | | | | | | It's possible the payload_length gets updated in lanplus_encrypt_payload. If it's updated, the memory of msg should be updated. Tested: use ipmitool with lanplus with similar STR and there is no memory stomping issue. Resolved: ipmitool/ipmitool#351 Signed-off-by: Tom Tung <shes050117@gmail.com>
* fru print: Add area checksum verificationAlexander Amelkin2022-12-211-0/+62
| | | | | | | | Before this change, `ipmitool` would not detect any checksum errors in FRU areas when using 'fru print'. Now it will print whether the area checksum is OK or INVALID for Chassis, Board, and Product areas. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* fru: Add decoder for multirec system mgmt recordsAlexander Amelkin2022-12-064-18/+180
| | | | | | | | | | | * Add a decoder for System Management records in the Multirecord area * Refactor GUID/UUID decoding: Use the same code for `mc guid` and for `fru print` to decode the GUID and System Unique ID in System Management records in the Multirecord Area. * Fix some type errors in calls to printf/sprintf in GUID decoder Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Fix enterprise-numbers URLAlexander Amelkin2022-11-221-1/+1
| | | | | | | | | | | IANA has changed their URL scheme, and the content at the old URL for enterprise-numbers switched from text/plain to text/html. Fix Makefile.am to use the new URL Resolves ipmitool/ipmitool#377 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Update issue templatesAlexander Amelkin2022-09-141-0/+37
|
* Release Version 1.8.19IPMITOOL_1_8_19Alexander Amelkin2022-09-012-18/+253
| | | | Update ChangeLog, configure.ac to 1.8.19
* Cast type before the left shiftTom Tung2022-08-281-3/+3
| | | | | | | | | | | | | | | | Building ipmitool with UBSAN and I got: ``` ... xxx/ipmitool/include/ipmitool/helper.h:191:14: runtime error: left shift of 160 by 24 places cannot be represented in type 'int' #0 0x55bddaa56f11 in ipmi32toh xxx/ipmitool/include/ipmitool/helper.h:191:14 ``` Tested: with this, I tested ipmitool again and the issue disappeared. Resolved: ipmitool/ipmitool#352 Signed-off-by: Tom Tung <shes050117@gmail.com>
* sel: Fix the deasserted thresholds inequalityAndy Clegg2022-08-051-1/+13
| | | | | | | | | | | | | | | | | | | | | The choice of > or < when printing the threshold inequality currently only depends on whether it is an upper or lower threshold. This is correct when the event is asserted, but when the event is deasserted the inequality is reversed and therefore the current code can give confusing results, e.g.: ``` Temperature ps1_inlet_temp | Upper Non-critical going high | Deasserted | Reading 43.94 > Threshold 44.88 degrees C ``` This commit fixes that. See ipmitool/ipmitool#349 Signed-off-by: Andy Clegg <andyc@graphcore.ai>
* man: Update the text for -C optionAlexander Amelkin2022-03-311-4/+9
| | | | | | | | | | | | | The default cipher suite has been changed earlier in commit 7772254b62826b894ca629df8c597030a98f4f72, and the manual has been then updated by commit 50479484a2268d3c9d525ceed729c1faed7244b6, but it turned out that the description of the -C option was not affected by the update. Also, a typo was found as the cipher suites are listed in IPMI v2.0 specification Table 22-20, not 22-19 as stated in the manual. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis restart_cause: Add new causesAlexander Amelkin2022-03-093-36/+22
| | | | | | | | | Add 'soft reset' and 'power-up by RTC wakeup' causes from IPMI 2.0 spec. Resolves ipmitool/ipmitool#329 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* sel: Remove redundant "Reserve SEL"Bing-Hua Wang2022-02-071-20/+0
| | | | | | | | There is no need to reserve SEL when doing "sel list" and "sel get" since we don't do partial get in both commands, and we didn't even use the reservation ID returned by "Reserve SEL". Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
* zero initialize the recv structure on the stackPatrick Venture2022-02-051-1/+1
| | | Zero initialize the recv structure used by openipmi_read().
* zero initialize the recv structure on the stackPatrick Venture2022-02-051-1/+1
| | | This was caught via a sanitized build where the recv was used with stack data in some cases.
* ci: Add support for MacOS-11Alexander Amelkin2021-11-031-1/+4
| | | | | | | GitHub has made macos-11 virtual environment available. Enable it for ipmitool. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Remove ubuntu-16.04 supportAlexander Amelkin2021-11-031-1/+1
| | | | | | | GitHub has removed support for ubuntu 16.04 virtual environment since Sep 20, 2021. We just follow. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* sdr: Fix modifier unitjason637162021-11-031-1/+1
| | | | Previously instead of the modifier unit, the base unit was printed.
* Fix compile errorPatrick Huesmann2021-09-151-1/+1
| | | | Signed-off-by: Patrick Huesmann <info@patrick-huesmann.de>
* Refactor bridging level detection to dedicated functionPatrick Huesmann2021-09-154-32/+30
| | | | Signed-off-by: Patrick Huesmann <info@patrick-huesmann.de>
* Fix double bridge detection in get_max_(req|rsp)_data_size()Patrick Huesmann2021-09-151-4/+6
| | | | Signed-off-by: Patrick Huesmann <info@patrick-huesmann.de>
* ipmi_mc: Fix the IPM_DEV_FWREV1_MAJOR_MASKLei YU2021-07-141-1/+1
| | | | | | | | | | | The IPM_DEV_FWREV1_MAJOR_MASK was incorrectly defined as 0x3F. The spec indicates that the major firmware revision has 0~6 valid bits, so the mask shall be 0x7F. Tested: Verify a BMC that has a major version that is large than 0x3F, and ipmitool shows the correct major version. Signed-off-by: Lei YU <yulei.sh@bytedance.com>
* helper: Fix stderr file descriptorJosef Möllers2021-06-221-1/+1
| | | | The third file descriptor is STDERR_FILENO, not STDOUT_FILENO
* Fix codefactor-io / CodeFactor warningsThomas Renninger2021-06-221-3/+3
| | | | Use $(...) notation instead of legacy backticked `...`. (SC2006)
* Use /run instead of /var/runThomas Renninger2021-06-227-12/+12
| | | | | | In FHS 3.0, /var/run is replaced by /run: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html
* oem: Update product IDs for YADROAlexander Amelkin2021-06-181-2/+3
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* lan: Add processing of get/set specific CCsAlexander Amelkin2021-06-151-13/+32
| | | | | | | | Both 'Set/Get LAN Configuration Parameter' commands may return command-specific codes that weren't properly parsed and were reported as 'Unknown' before. This is fixed now. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* lan: Refactor pointer styleAlexander Amelkin2021-06-151-46/+46
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* doc: update lanplus doc to reflect default cipher suite changeThomas Abraham2021-06-061-3/+3
| | | | | | Modify the documentation to reflect commit 7772254b ("lanplus: Auto-select 'best' cipher suite available") which changed the default cipher suite for lanplus from 3 to 17
* ekanalyzer: Fix internal use area off-by-one bugAlexander Amelkin2021-05-211-0/+2
| | | | | | | | The length of internal use area printed by ekanalyzer didn't take in account the version byte. The data printed was also 1 byte longer than needed. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ekanalyzer frushow: Fix internal area size calcAlexander Amelkin2021-05-211-6/+42
| | | | | | | | | | | | | | When there was no chassis and board areas, the internal use are size was calculated incorrectly. Additionally, it is possible that the internal area is actually located after all other areas or that areas are arranged in a different order than their offsets in the header. All those cases weren't properly handled. Now that is fixed. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* sel: Fix "power supply inactive" flag offsetAlexander Amelkin2021-04-271-1/+1
| | | | | | | | | There was a wrong offset for the "Power Supply Inactive" flag, hence the trigger on this event type could not be set. Resolves ipmitool/ipmitool#280 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Add support for Ubuntu 20.04Alexander Amelkin2021-04-211-11/+3
| | | | | | | | - Add ubuntu-20.04 target - Disable building of Solaris-specific `bmc` interface on Ubuntu - Rename `ubuntu` matrix to `linux` Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Fix Ubuntu buildsAlexander Amelkin2021-04-211-0/+1
| | | | | | | | | | | GitHub machines sometimes aren't immediately updated after Ubuntu repos update. That leads to failed CI builds due to inability to install some packages. Add a call to `apt update` to update the package database before installing anything. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Fix compiler warningAlexander Amelkin2021-04-211-8/+24
| | | | | | | | | | Move #ifdef from the inside to the outside of assert()'s to get rid of this compiler warning: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive] Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Fix compiler warningAlexander Amelkin2021-04-212-4/+0
| | | | | | Drop some unused variables detected by the compiler Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Fix compiler warningAlexander Amelkin2021-04-213-17/+18
| | | | | | | | | | Refactor plugin ipmi_intf structure initialization for some plugins to stop the compiler complaining like this: warning: use of GNU old-style field designator extension [-Wgnu-designator] Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Update for GitHub Actions v2.274.2Bing-Hua Wang2021-04-081-2/+2
| | | | | | | | set-env and add-path have been removed since GitHub Actions v2.274.2. [1] Switch to Environment Files instead. [2] [1] https://github.blog/changelog/2020-11-09-github-actions-removing-set-env-and-add-path-commands-on-november-16/ [2] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#environment-files
* free: Fix implicit function declarationsBing-Hua Wang2021-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | GitHub Actions macOS environment now has Xcode 12.0.1. [1] Xcode 12 Clang enables -Werror=implicit-function-declaration by default [2] and breaks the ipmitool build on macOS. [3] [1] https://github.com/actions/virtual-environments/issues/1712 [2] https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes "Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on)." [3] https://github.com/ipmitool/ipmitool/pull/252/checks?check_run_id=1389463134 "checking for ld used by gcc... /Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld <snip> free.c:66:13: error: implicit declaration of function 'getuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (getuid() != 0) { ^ free.c:170:26: error: implicit declaration of function 'ipmi_get_oem' is invalid in C99 [-Werror,-Wimplicit-function-declaration] intf->manufacturer_id = ipmi_get_oem(intf);" ^ Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
* Use "#pragma once" for headersBing-Hua Wang2021-04-0862-253/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the header guard names in ipmitool duplicated with the ones in freeipmi. * ipmitool/ipmi_fru.h and freeipmi/fru/ipmi-fru.h both uses IPMI_FRU_H * ipmitool/ipmi_sdr.h and freeipmi/sdr/ipmi-sdr.h both uses IPMI_SDR_H * ipmitool/ipmi_sel.h and freeipmi/sel/ipmi-sel.h both uses IPMI_SEL_H This is problematic as including the 1st will prevent the 2nd from being included, leading to the loss of any declarations, inline definitions, or other "#includes" in the 2nd header. For example, including ipmitool/ipmi_sel.h and freeipmi/freeipmi.h fails to build. $ cat test.c #include <ipmitool/ipmi_sel.h> #include <freeipmi/freeipmi.h> $ gcc test.c -I${HOME}/src/oss/ipmitool/include In file included from /usr/include/freeipmi/freeipmi.h:90, from test.c:2: /usr/include/freeipmi/sdr/oem/ipmi-sdr-oem-intel-node-manager.h:48:44: error: unknown type name 'ipmi_sdr_ctx_t'; did you mean 'ipmi_fru_ctx_t'? 48 | int ipmi_sdr_oem_parse_intel_node_manager (ipmi_sdr_ctx_t ctx, | ^~~~~~~~~~~~~~ | ipmi_fru_ctx_t Remove header guards and use "#pragma once" instead. In this way, we don't have to do manual management to avoid name clashes. * src/plugins/lan/md5.h is left as is being an external header originally. * src/plugins/imb/imbapi.h is a convoluted header consisting of multiple header guards. Let's just add "#pragma once" and leave header guards as is for now. Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
* Remove unneeded execution bits from C source files and a header fileBing-Hua Wang2021-04-083-0/+0
| | | | Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
* Convert line endings to LFBing-Hua Wang2021-04-081-46/+46
| | | | | | | | | | | | The following commands is used on Linux to convert line endings to LF. git config core.autocrlf input git add --renormalize . git config --unset core.autocrlf It turns out there was only ipmi_kontronoem.h not using LF. Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
* Fixed compiler warning.Shitalkumar Gandhi2021-02-241-2/+2
| | | | | | | This patch has been added to fix "error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]" Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@seagate.com>
* RPM support: fixed broken build due to use of headers from kernelGilles Buloz2020-10-221-1/+1
| | | | | | | | | | | | | When building an RPM, --with-kerneldir is passed to ./configure. This adds the include path /lib/modules/<kversion>/build/include that may break the build but is not present when building with "make" so useless. For instance while building ipmi_sel.c with kernel 5.3.7-301.fc31.x86_64 : /lib/modules/5.3.7-301.fc31.x86_64/build/include/linux/stddef.h:11:2: error: expected identifier before numeric constant 11 | false = 0, | ^~~~~ Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>