summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fru: Fix crashes on 6-bit ASCII stringsbugfix/fix-6bit-asciiAlexander Amelkin2020-09-151-2/+2
| | | | | | | | | Fix calculation of the buffer size for decoded 6-bit ASCII strings. Previously the program could allocate too a short buffer that caused buffer overflows and segmentation fault crashes on certain FRU contents. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Refix 6e037d6bfbbb93b349c8ca331ebde03a837f76bfAlexander Amelkin2020-08-073-9/+16
| | | | | | | | | Restore using strncmp() for "options=" and similar substrings. Resolves ipmitool/ipmitool#223 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* oem: Add product ID for YADRO VEGMANAlexander Amelkin2020-07-231-0/+1
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* configure.ac: add '--location' for curl to follow locationYpnose2020-07-211-1/+1
|
* configure.ac: replace '-#' by '--progress-bar' with curlYpnose2020-07-211-1/+1
|
* log: refix 16f937a1: Add missing header changesAlexander Amelkin2020-07-211-2/+1
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Add version info to debug outputAlexander Amelkin2020-07-173-15/+16
| | | | | | | | | | | | | | | | | - Initialize the log at the start of ipmi_main() to allow for proper logging at the start; - Remove the unused log_level_get() function; - Update log_level_set() to take verbosity instead of log level (default verbosity is 0, which is LOG_NOTICE log level), use the function to update log level as `-v` is encountered in command line; - Move IANA PEN list debugging to verbosity 6. The list is too long to see it in each debug output of verbosity 5 that is used for debugging lan/lanplus packets; - For verbosity >= 2 (that is `-vv`) add the ipmitool version information at the start. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* doc, ci: Fix an error in package name for WindowsAlexander Amelkin2020-07-162-2/+2
| | | | | | it's dos2unix, not unix2dos Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* doc: Fix a small typo in INSTALLAlexander Amelkin2020-07-061-1/+1
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* RPM support: updated spec file changelogGilles Buloz2020-07-041-0/+620
| | | | | | Updated specfile changelog according to the Changelog file Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
* RPM support: simplified build processGilles Buloz2020-07-046-31/+6
| | | | | | | | Simplified target "rpm" of Makefile, and removed rpmrc and rpmmacros to use default settings and those from the spec file such as Distribution that has been changed to "GitHub Build" instead of "Sourceforge Build". Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
* RPM support: fixed broken RPM buildGilles Buloz2020-07-043-6/+10
| | | | | | | | | | | | | | The command "make rpm" was failing for the following reasons : - setting the build directory to ./rpmbuild/ instead of default ~/rpmbuild/ was ignored. - errors in the spec file : wrong dates and characters in the changelog, and unpackaged files under misc/* - debug package built even if unneeded but failing to build because of missing requisites. Using "rpmbuild -tb ipmitool-*.tar.gz" instead of 'make rpm" builds under ~/rpmbuild/ but also fails because of the last two reasons. Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
* doc: Update INSTALL with Windows infoAlexander Amelkin2020-07-041-0/+16
| | | | | | | | | | | | | | The documentation now contains instructions on how to build on Windows. The instructions have been verified and added to a continous integration workflow with the previous commit, so Windows buildability will from now on be automatically verified. Resolves: ipmitool/ipmitool#148 (ipmitool for win with FreeIPMI) ipmitool/ipmitool#200 (windows build error) ipmitool/ipmitool#201 (windows build error) ipmitool/ipmitool#203 (no lanplus on windows) Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Add Windows/cygwin configAlexander Amelkin2020-07-041-0/+40
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* doc: Update INSTALL for new CIAlexander Amelkin2020-07-041-9/+29
| | | | | | | Update according to the new GitHub CI build configuration. Add information regarding prerequisites for macOS X 10.15. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ci: Add github workflow, drop travisAlexander Amelkin2020-07-042-37/+82
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Fix compatibility with OpenBSD and macOSAlexander Amelkin2020-07-042-7/+6
| | | | | | | | | | | | | | Neither of these systems have the `-t` option for `install`. For Linux the option is not necessary and is only needed if the target directory is specified before the source file(s). Also, macOS produces strange files with -e suffix for man pages when they are processed with sed using AC_CONFIG_FILES(). Move prefix expansion to another point in code to avoid these unneeded intermediate files produced by configure. Resolves: ipmitool/ipmitool#206 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* dist: Fix dependencies and cleanupAlexander Amelkin2020-06-302-4/+11
| | | | | | | The `make distcheck` was failing because of some files deleted twice and some intermediate files not deleted at all. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* dist: Add missing ipmi_time.h header to packagingAlexander Amelkin2020-06-301-1/+2
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* configure: Fix compatibility with non-bash systemsAlexander Amelkin2020-06-161-6/+5
| | | | | | | | | Remove a bashims from configure to make build compatible with systems without bash. Resolves ipmitool/ipmitool#205 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Finalize refactoring of string comparisonsAlexander Amelkin2020-06-1033-502/+518
| | | | | | | | | | | | | | Unify the comparison idioms use. Always use `if(!strcmp())` for "if string equals" and `if(strcmp())` for "if string is not equal". Never use `== 0` and `!= 0` with `strcmp()`. Minor reformatting of the code immediately surrounding the refactored lines. Resolves ipmitool/ipmitool#104 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* channel: Refactor set_user_access option processingAlexander Amelkin2020-06-103-29/+62
| | | | | | | | Reduce code duplication by extracting option names, types, and value ranges into a separate structure, and rewriting the option parsing code without mixing it with the data. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* Refactor string comparisonsJiang Junyu2020-06-1034-570/+563
| | | | | | | Clean up use of strcmp/strncmp/strncasecmp for command line arguments. Never use anything but `strcmp()` unless absolutely neccessary. Partialy resolves ipmitool/ipmitool#104
* sel: Fix OEM record definition exampleAlexander Amelkin2020-06-051-1/+1
| | | | | | | The example contained nested double quotes. Changed them to single quotes. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* sdr: harden against bad recordsJohn Levon2020-05-261-10/+5
| | | | | | Harden ipmi_sdr_get_record() against bad records Signed-off-by: John Levon <john.levon@joyent.com>
* fru: fix memory leak in ipmi_spd_print_fruVaclav Dolezal2020-05-251-16/+16
| | | | | | Fixed by using centralised exiting. Signed-off-by: Václav Doležal <vdolezal@redhat.com>
* ipmi_sel_set_time: fix strptime() return checkPavel Kiryukhin2020-05-221-1/+1
| | | | | | | | | | The current behavior: - correct date format is not accepted by "sel time set". - incorrect date format that looks correct is accepted, but time is not set correctly. - commands like ipmitool sel time set "11/22/2013 trash" are accepted.
* hpm: use portable __max() in hpmfwupgJohn Levon2020-05-181-2/+3
| | | Instead of non-portable MAX() use __max() in hpmfwupg
* hpmfwupg: move variable definition to .c fileVaclav Dolezal2020-02-132-1/+3
| | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* sel: time: fix null pointer dereference in setPavel Kiryukhin2020-02-121-1/+3
| | | | This is a refix of commit f0d5c17e
* fru, sdr: Fix id_string buffer overflowsChrostoper Ertl2020-02-042-17/+25
| | | | | | | | | | | | | | | | | | Final part of the fixes for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp 9 variants of stack buffer overflow when parsing `id_string` field of SDR records returned from `CMD_GET_SDR` command. SDR record structs have an `id_code` field, and an `id_string` `char` array. The length of `id_string` is calculated as `(id_code & 0x1f) + 1`, which can be larger than expected 16 characters (if `id_code = 0xff`, then length will be `(0xff & 0x1f) + 1 = 32`). In numerous places, this can cause stack buffer overflow when copying into fixed buffer of size `17` bytes from this calculated length.
* lanp: Fix buffer overflows in get_lan_param_selectChrostoper Ertl2020-02-041-7/+7
| | | | | | | | | Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `get_lan_param_select` function is missing a validation check on the response’s `data_len`, which it then returns to caller functions, where stack buffer overflow can occur.
* channel: Fix buffer overflowChrostoper Ertl2020-02-041-1/+4
| | | | | | | | | Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `ipmi_get_channel_cipher_suites` function does not properly check the final response’s `data_len`, which can lead to stack buffer overflow on the final copy.
* session: Fix buffer overflow in ipmi_get_session_infoChrostoper Ertl2020-02-041-4/+8
| | | | | | | | | Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `ipmi_get_session_info` function does not properly check the response `data_len`, which is used as a copy size, allowing stack buffer overflow.
* fru: Fix buffer overflow in ipmi_spd_print_fruChrostoper Ertl2020-02-041-1/+8
| | | | | | | | | | | | Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `ipmi_spd_print_fru` function has a similar issue as the one fixed by the previous commit in `read_fru_area_section`. An initial request is made to get the `fru.size`, which is used as the size for the allocation of `spd_data`. Inside a loop, further requests are performed to get the copy sizes which are not checked before being used as the size for a copy into the buffer.
* fru: Fix buffer overflow vulnerabilitiesChrostoper Ertl2020-02-041-2/+31
| | | | | | | | | | | | | Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `read_fru_area_section` function only performs size validation of requested read size, and falsely assumes that the IPMI message will not respond with more than the requested amount of data; it uses the unvalidated response size to copy into `frubuf`. If the response is larger than the request, this can result in overflowing the buffer. The same issue affects the `read_fru_area` function.
* chassis: bootmbox: Refix 62a04390Ivan Mikhaylov2020-01-231-1/+2
| | | | | | | | Fix ipmitool not writing the last block of boot mailbox data if the block is shorter than 3 bytes. Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com> Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* configure: Drop requirement for curses et. al libsAlexander Amelkin2019-12-052-8/+2
| | | | | | | | Libraries ncurses, curses, tinfo and termcap are not actually needed as the tgetent() function listed as required is not actually used anywhere in the code. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* configure: remove some duplicate codeAlexander Amelkin2019-12-051-10/+4
| | | | Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* doc: Update INSTALL to fix installation errorsAlexander Amelkin2019-11-291-1/+1
| | | | | | | The `sudo` was missing from `make install` which prevented installation if build is performed, as it should be, by an unpriviliged user. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* ipmi_dcmi: fix typo in nm_policy_options initialization.Pavel Kiryukhin2019-11-271-1/+1
| | | | This re-enables "nm policy add" functionality.
* Docs: Add info on packages to install on Ubuntu 16.04John L. Villalovos2019-11-151-0/+6
| | | | | | | | Add some documenation on packages to install on Ubuntu 16.04 and Fedora 31 before building the software. This will make it easier for people who are building ipmitool as they won't need to figure out all the package dependencies on their own.
* chassis: Refactor to get rid of strncmp()Alexander Amelkin2019-11-121-53/+76
| | | | | | | | For parameter checking replace calls to strncmp() with calls to strcmp() in order to improve readability and get rid of literal string lengths. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis: Refactor main for centralized exitingAlexander Amelkin2019-11-121-6/+8
| | | | | | | | | | In ipmi_chassis_main: * Default to error return code (-1). * Use centralized exit. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis: bootdev: Refactor moreAlexander Amelkin2019-11-121-17/+27
| | | | | | | | | | * Get rid of magic '8' in bootdev options processing. * Optimize the code of bootdev arguments processing, remove the special crafting of flags for 'clear-cmos' argument, make it use the same code as other options. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis: bootdev: Refactor to reduce nestingAlexander Amelkin2019-11-121-188/+205
| | | | | | Move bootdev options parsing to a separate helper function Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis: bootdev: Fix help message and its formattingAlexander Amelkin2019-11-121-5/+7
| | | | | | | There was a wrong help message regarding the console redirection, and also the help formatting was a bit off. Straightened this all up. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* chassis: bootparam/bootdev: Refactor for less magicAlexander Amelkin2019-11-121-82/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the boot flags decoder: * Add macros for boot flag bits, replace magic numbers in the `chassis bootparam get 5` and in `chassis bootdev` handlers. The macros are prefixed with BFx_ where x stands for the boot flags data byte as per IPMI 2.0 specification Table 28-14; * Add decoding of remote/redirected media boot flags; * Remove erroneous decoding of boot flags byte 3 bit 1 as Sleep button lockout whereas the bit is a part of console redirection setting; * Fix console redirection settings reported under the 'BIOS verbosity' header and vice versa; * Fix resetting of all other boot flags in the data byte when setting any of the bits in the same byte. This fixes inability to set both 'efiboot' and 'persistent' bits at the same time, and other similar cases. Resolves ipmitool/ipmitool#163 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* oem: supermicro: Add product codes from IPMICFGAlexander Amelkin2019-11-061-1/+657
| | | | | | | | | | | ftp://ftp.supermicro.com/utility/IPMICFG/IPMICFG_1.30.0_build.190710.zip contains MBType.dat file that lists all known Supermicro product IDs with their respective names. Import that knowledge into ipmitool. Resolves ipmitool/ipmitool#151 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
* lan: Refix 6e2b688e. Fix vlan range checking.Alexander Amelkin2019-09-051-2/+2
| | | | | | | | | Commit 6e2b688e introduced a bug due to which VLAN id range checking was negated and resulted in error messages printed for correct VLAN ids. Resolves ipmitool/ipmitool#55 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>