Commit replaces atoi() and strtoul() calls with wrappers in order to prevent
possible int *flow via user input.
Also, limits on user provided values are applied wherever possible.
Reported-by: Dune Idaho
Commit adds new function str2char() into 'lib/helper.c'. Also, function
is_fru_id() moves from 'lib/ipmi_fru.c' into 'lib/helper.c' in order to be
utilized by other modules.
Commit fixes bug where OS default values were over-ridden if the corresponding
enable/disable arguments weren't provided via command-line parameters.
Commit also changes IPMI shell default configuration setting from 'yes' to
'auto'.
Commit for Dmitry Bazhenov
Fixed a bug where connecting to a remote shelf manager via the lan
interface would always fail with:
``Activate Session error: Session sequence out of range Error: Unable
to establish LAN session''
This is due to a bug introduced in get_random() by fix for ID#3600963 where
braces were missing from an error check.
Commit for Dan Gora
ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
Compilation would fail on big endian architecture because BSWAP_32 was not
defined in 'ipmi_chassis.c' and 'ipmi_pef.c'.
The problem was '#include <ipmitool/bswap.h>' depended on WORDS_BIGENDIAN which
comes from '<config.h>'. However, none of the previous header files
would include '<config.h>', so it remained undefined.
'bswap.h' gets included unconditionally now.
Commit for Dan Gora
Change the amc channel descriptor ports to be displayed in decimal
instead of hex. This matches the 'fru -v' output in ipmitool.
Add decimal value of Link Asymetric Match values. So people don't have to
look up the value in the source or in the PIGMG spec.
Commit for Dan Gora
Due to a bug in gcc where unaligned bit fields were not packed correctly
before gcc 4.4, we changed the fru_picmgext_amc_channel_desc_record
and fru_picmgext_amc_link_desc_record structures to use
larger types to be packed correctly. This then requires
us to use the FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE and
FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE defines instead of sizeof for
these structures.
Updated ipmi_ek_create_amc_p2p_record() and
ipmi_ek_display_amc_p2p_record() to read data in the correct byte order
on both big and little endian machines.
Commit for Dan Gora
Fixed several bugs with printing out the Carrier and AMC connectivity
information with 'ipmitool -v fru'
There were several bugs that were caused due to using bitfields with
char types in ipmi_fru.h. GCC versions before v4.4 had a bug where
they did not pack the bitfields correctly if the bitfields were not
cleanly aligned with the underlying char type.
Fixed and cleaned up all other PICMG FRU records.
Commit for Dan Gora
Fixed a bug where the carrier connectivity point to point descriptor
was not being displayed properly when compiled on big endian machines.
Commit for Dan Gora
Fixed bugs in ipmi_ek_display_chassis_info_area(),
ipmi_ek_display_product_info_area(), and
ipmi_ekanalyzer_fru_file2structure() where fread was being called to
read one byte of data into a int or long data type. This would result
in the value being byte swapped since the byte was read into the most
significant byte of the int (ie byte 0) on big endian machines.
Commit for Dan Gora
Previous versions were not setting the file_offset properly if a Custom
board type was found, which would prevent subsequent dissectors from
operating properly and terminating the output of 'ipmitool ekanalyze
frushow oc=<atca carrier fruinfo>' early.
Rewrote ipmi_ek_display_board_info_area() to fix indentation and
to properly set the file_offset and end the while loop if a Custom
board_type was found.
Previous versions were also abusing the board_length variable,
treating it as an int and using it to break out of the loop.
Commit for Dan Gora
Rewrote ipmi_ek_display_chassis_info_area,
ipmi_ek_display_product_info_area, and
ipmi_ekanalyzer_fru_file2structure to reverse the checks of error
conditions to reduce the amount of indentation required.
Commit for Dan Gora
Commit updates main help of 'lib/ipmi_sdr.c'. Changes:
* LOG_ERR -> LOG_NOTICE
* add error messages, eg. Invalid command, Not enough parameters etc.
* handle 'sdr fill INV_PARAM'
* return codes on error
* general fixes and changes of SDR help output
Reported-by: Dan Gora
Performing prefix or postfix increments, eg. ++var or var++, in the
arguments to printf is inherently non-portable and may give different
results on different platforms.
Commit mends this issue.
Commit for Dan Gora
Commit adds the hex value for the sensor type to displays so that the user
can correlate sensor type values with their hex values without having to
look them up in the IPMI spec.
Commit for Dan Gora
Previous versions had two values for "Watchdog" in the list which
means that users could not perform # ipmitool sdr type "Watchdog";
and get the IPMI v1.0 and later version of the watchdog sensor,
eg. 0x23 instead of 0x11.
Commit for Dan Gora
Commit removes -Wno-packed-bitfield-compat from 'configure.in'. This was hiding
an important bug in ipmi_fru.h and is not a valid flag for older versions of
gcc.
Commit for Dan Gora
This code was moved to ipmi_main.c from open.c and in the change a bug
was introduced where the PICMG Get Device Locator command would not
be run unless the user explicitly set my_addr to 0 with the -m command.
The more sensible thing to do is to run this unless the user explictly
overrides it with the -m option.
Commit for Dan Gora
The previous test to see if we need pragma pack(1) was failing if we
cross compile because there was no way to run the test.
We now use AC_TRY_COMPILE and add the pragma pack(1) to the test code.
If it compiles, it must be good, so add the define.
Commit for Dan Gora
Commit fixes issue in 'user priv' sub-command which turns off LinkAuth whenever
user's privilege is changed. This was caused by not setting apropriate bits.
However, fix leverages Set User Access Command(IPMI spec. v2 PDF, p.320) and
sets 7th bit of 1st byte to 0. This tells BMC not to change IPMI messaging,
LinkAuth and Callback for given user.
As a consequence, ipmitool no longer turns 'IPMI messaging' on by default when
user's privilege is being set. IPMI messaging can be turned on/off via 'channel
setaccess' sub-command.
Reported-by: Kipp Glover
Commit fixes incorrect evaluation of str2uchar() return value in
ipmi_sdr_print_type(). Prior to this fix, practically no user input was accepted
as a valid one in # ipmitool sdr type HEX_SENSOR_TYPE ;
This bug was introduced by ID#3528368 - 'lib/ipmi_sdr.c' - possible int *flow
Commit fixes problem in 'lib/ipmi_delloem.c'. Command % ipmitool delloem mac;
returns wrong MAC when flex addressing is enabled on the blade chassis.
Commit for Krishnaprasad K
The Information given by the command SEL was incorrect in "Get SEL Allocation"
command. According to the specification "byte 10" in response denotes the
"Maximum record size in allocation units". This information is given as "Max
Record Size : " in sel command. However, ipmitool was getting "byte 9" instead
of "byte 10".
Commit for Gokulakannan
The event data and SDRs support assertions and deassertions for threshold events
as well as discrete events. So print out assertion and deassertion on all
events.
Commit for Corey Minyard
Commit is a response(and fix) to double-free bug in 'lib/ipmi_main.c' via
username. Now, pointers should be set to NULL after calling free().
Reported-by: Ales Ledvinka
Commit changes code formatting in 'lib/ipmi_delloem.c' to be more consistent
with the rest of ipmitool's code. No functional changes are intended.
Clean up isn't perfect, but it's one of steps in long term effort.
Commit removes 'size' check from ipmi_fru_get_multirec_from_file() as
an unsigned value can't be less than zero(0).
This error has been introduced by ID#3600911.
Reported-by: Ales Ledvinka