1463 Commits

Author SHA1 Message Date
Zdenek Styblik
1f1dc806fe ID: 3608765 - Fix spelling of ipmi_ek_diplay_carrier_connectivity()
Commit corrects spelling of function ipmi_ek_display_carrier_connectivity().

Commit for Dan Gora
2013-04-09 09:55:03 +00:00
Zdenek Styblik
8afb3c315b ID: 3608763 - 'lib/ipmi_sdr.c' - display hex values of Sensors
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
2013-04-09 08:38:31 +00:00
Zdenek Styblik
4aae41904d ID: 3608763 - Update sensor_type_desc values to differentiate watchdogs
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
2013-04-09 08:08:20 +00:00
Zdenek Styblik
41a44b037f ID: 3608759 - Remove '-Wno-packed-bitfield-compat' from CFLAGS
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
2013-04-09 07:38:35 +00:00
Zdenek Styblik
49a7ceee70 ID: 3608761 - 'lib/ipmi_main.c' - PICMG Get Device Locator was never run
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
2013-04-08 17:46:17 +00:00
Zdenek Styblik
3687a6cbb8 ID: 3608762 - 'lib/ipm_hpmfwup.c' - Fixed help messages for hpm command
Commit cleans up the formatting of help output a bit to fit on an 80 column
screen.

Commit for Dan Gora
2013-04-08 17:36:33 +00:00
Zdenek Styblik
627cadaa39 ID: 3608759 - Fix bug in configure.in when cross compiling
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
2013-04-08 17:29:24 +00:00
Zdenek Styblik
eb63058bc3 ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
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
2013-04-08 17:21:38 +00:00
Zdenek Styblik
15f1255237 ID: 3610286 - 'lib/ipmi_sdr.c' - ipmi_sdr_print_type - incorrect eval
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
2013-04-08 17:04:34 +00:00
Jim Mankovich
2dfa02ba24 Fix "help" command line processing in fru command defect (ID: 3610117)
introduced by the following changes:

ID: 3582307 - 'lib/ipmi_fru.c' - ipmi_fru_main() return codes
ID: 3582310 - 'lib/ipmi_fru.c' - ipmi_fru_main() - misuse of printf()
2013-04-08 13:22:34 +00:00
Zdenek Styblik
9d6a201911 ID: 3608758 - 'include/ipmitool/ipmi.h' - add IPMI_NETFN_OEM
Commit adds IPMI_NETFN_OEM code 0x2E for completeness.

Commit for Dan Gora
2013-04-04 11:54:00 +00:00
Zdenek Styblik
ad01921281 ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
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
2013-04-04 07:27:11 +00:00
Zdenek Styblik
d27d2f7ae3 ID: 3016359 - Get SEL Alloc Information is incorrect
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
2013-04-02 10:37:15 +00:00
Zdenek Styblik
26c17eeb91 ID: 3600933 - 'lib/ipmi_sol.c' - use of deprecated bzero()
Commit replaces deprecated bzero() call with memset().

Commit for Ales Ledvinka
2013-03-30 06:37:51 +00:00
Zdenek Styblik
fdbef84866 ID: 3609472 - Add the instance to the SOL commands
The SOL protocol supports multiple serial ports using the "instance",
allow this to be passed in to ipmitool.

Commit for Corey Minyard
2013-03-29 21:01:10 +00:00
Zdenek Styblik
3a383608dd ID: 3609473 - Add assertion/deassertion to threshold events
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
2013-03-29 18:45:16 +00:00
Zdenek Styblik
66fcf484a4 ID: 3600911 - 'lib/ipmi_fru.c' - fix multiple increments in args to printf
Commit fixes multiple increments in arguments of printf() which leads to
undefined/inconsistent behaviour and results.

Reported-by: Ales Ledvinka
2013-03-29 14:52:59 +00:00
Zdenek Styblik
52c07d61f9 ID: 3608149 - ipmitool - set pointer to NULL after free()
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
2013-03-29 14:40:21 +00:00
Zdenek Styblik
fd752420ec ID: 3608261 - 'lib/ipmi_delloem.c' - code formatting
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.
2013-03-21 14:07:50 +00:00
Zdenek Styblik
7a74ab32a8 ID: 3608022 - 'lib/ipmi_fru.c' - unsigned errors
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
2013-03-21 11:32:09 +00:00
Zdenek Styblik
3ea41bda4b ID: 3607981 - 'lib/ipmi_lanp.c' - replace atoi() calls
Commit replaces atoi() calls with str2uchar() ones to eliminate possible int
*flow via user input.
2013-03-21 09:37:57 +00:00
Zdenek Styblik
992b42ceee ID: 3607320 - 'lib/ipmi_lanp.c' - possible NULL reference
Commit fixes possible NULL reference in 'lib/ipmi_lanp.c' which is caused by not
checking return value of get_lan_param(), resp. get_lan_param_select(). This
function can return NULL in certain situations.
2013-03-19 19:53:52 +00:00
Zdenek Styblik
002c8becf4 REVERT - ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
I'm reverting previous commit. I'm not sure what happened, but there is a huge
difference between what got committed, what came as a diff in e-mail and what
should have been committed in the first place.
2013-03-16 21:15:21 +00:00
Zdenek Styblik
6f1bd51f1e ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
Commit removes trailing white spaces and tabs in 'lib/ipmi_delloem.c'.
2013-03-16 20:15:07 +00:00
Zdenek Styblik
4719d371b7 ID: 3608007 - 'lib/ipmi_session.c' - typo in error message
Commit fixes typo in error mesage in ipmi_session_main().
2013-03-14 12:41:48 +00:00
Zdenek Styblik
ba9a313911 ID: 3600926 - 'lib/ipmi_lanp.c'
Commit replaces condition ``if (p == NULL)'' in get_lan_param_select(). This
condition is never met, because structure is on heap.
Condition is replaced by for() control structure which goes through structure
ipmi_lan_params and checks whether requested LAN parameter is defined in
structure or not.

Reported-by: Ales Ledvinka
2013-03-14 08:38:32 +00:00
Zdenek Styblik
4a9af33734 ID: 3528247 - 'lib/ipmi_delloem.c' - fix possible *int flows
Commit fixes possible integer *flows in 'lib/ipmi_delloem.c'. Function
make_int() is removed and replaced with calls to appropriate str2*() function
calls from 'lib/helper.c'.

Reported-by: Duncan Idaho
2013-03-14 05:33:37 +00:00
Zdenek Styblik
e320e266b1 ID: 3576212 - 'lib/ipmi_event.c' - better rsp handling
Commit changes handling of response in ipmi_event_fromsensor(). If ccode doesn't
equal to 0, then error message is printed and function returns.

Reported-by: Duncan Idaho
2013-03-14 05:29:50 +00:00
Zdenek Styblik
95df7b2499 ID: 3607393 - 'lib/ipmi_event.c' - redundant '\n' in error message
Commit removes redundant '\n' in error message.
2013-03-11 14:09:33 +00:00
Jim Mankovich
665f2f7ee9 revert back to the 1.8.11 default cipher suite of 3, ID: #3571371, #3576112 2013-03-11 13:10:23 +00:00
Zdenek Styblik
e99e525a53 ID: 3600911 - 'lib/ipmi_fru.c' - rewrite of ipmi_fru_get_multirec_from_file()
Commit is a rewrite of function ipmi_fru_get_multirec_from_file() in
'lib/ipmi_fru.c'.
Changes:
* argument size is checked; size must be greater than 0
* argument pFileName is checked
* return value of seek() is checked
* error messages are printed on STDERR
* code flow got a re-work
2013-03-08 20:32:07 +00:00
Zdenek Styblik
39ad0d62cc ID: 3603419 - 'lib/ipmi_dcmi.c' - waste of resources
Commit moves one #ifdef upwards in the code, so resources are not wasted
pointlessly. There is no need to allocate memory for variables/structs and open
interface, if we're about to quit immediately because LAN+ support is not
enabled.
Error message got changed as well and it gets printed on STDERR where it
belongs!
2013-03-08 06:39:54 +00:00
Jim Mankovich
db56cc3f86 Do not bridge in-band ipmi requests when -m <local_addr> is specified without -t <target_address> on the command line. Prior to this change -m <local_addr> would always attempt to bride the request becaues the default target_address was being set to 0x20 instead of zero. ID: 3605313 2013-03-05 18:49:09 +00:00
Zdenek Styblik
108dc8aa0b ID: 3600911 - 'lib/ipmi_fru.c' - retval ipmi_fru_get_adjust_size_from_buffer()
Commit changes return value of ipmi_fru_get_adjust_size_from_buffer() from void
to int in order to determine whether call was successful or wasn't.
ipmi_fru_upg_ekeying() got re-work as well.

Changes to ipmi_fru_get_adjust_size_from_buffer():
* CHUNK_SIZE removed
* code formatting
* return value void -> int

Changes to ipmi_fru_upg_ekeying():
* check whether pFilename is NULL
* check return values of called functions
* re-work code - return early on error instead of nested if()
* added (error) messages
2013-03-05 05:00:32 +00:00
Ales Ledvinka
b6c97d8318 compile fix. see previous revision diff and comment for code change reason 2013-02-20 14:35:07 +00:00
Zdenek Styblik
fd2ab0b7bb ID: 3600911 - 'lib/ipmi_fru.c' memory leaks
Commit fixes memory leanks in functions ipmi_fru_set_field_string() and
ipmi_fru_set_field_string_rebuild() in 'lib/ipmi_fru.c'.

Note: it seems to me like these for() cycles do nothing.

Reported-by: Ales Ledvinka
2013-02-20 13:14:37 +00:00
Zdenek Styblik
8c91abfa19 ID: 3600910 - make ipmi_lcd_get_platform_model_name() to return int
Commit changes function ipmi_lcd_get_platform_model_name() to return integer
instead of void to signal potentional problems/issues.

Reported-by: Ales Ledvinka
2013-02-20 12:17:58 +00:00
Zdenek Styblik
4c009309eb ID: 3600928 - 'lib/ipmi_pef.c' handle unrecognized event trigger
Commit adds code to handle unrecognized event trigger in
ipmi_pef_print_event_info().

Reported-by: Ales Ledvinka
2013-02-13 11:46:15 +00:00
Zdenek Styblik
ed1865da0a ID: 3600928 - 'lib/ipmi_pef.c' use 'else if ()' instead of 'if ()'
Commit trades 'if ()' for 'else if ()' and removes one pointless 'if ()' since
rsp isn't NULL at this point.
2013-02-13 11:35:21 +00:00
Zdenek Styblik
c726a09482 ID: 3600928 - 'lib/ipmi_pef.c' memory leaks
Commit fixes memory leaks in 'lib/ipmi_pef.c'.

Reported-by: Ales Ledvinka
2013-02-13 11:28:58 +00:00
Zdenek Styblik
a70de993cf ID: 3600910 - 'lib/ipmi_delloem.c' use 'else if' instead of 'if', use 'rc'
Commit changes are related to ipmi_ldc_set_lock() in 'lib/ipmi_delloem.c':
* use 'else if' instead of 'if' since it's the same given the context and
probably better
* use 'rc' variable, since it's there, rather than 'return'

Note: ipmi_lcd_set_lock() would use some re-write.

Reported-by: Ales Ledvinka
2013-02-12 12:23:11 +00:00
Zdenek Styblik
c53a3cbb8e ID: 3600910 - 'lib/ipmi_delloem.c' remove unused variable
Commit removes unused variable 'dte' in ipmi_powermgmt() in
'lib/ipmi_delloem.c'.
2013-02-12 12:15:28 +00:00
Zdenek Styblik
69e43dc87f ID: 3600927 - change eval order of input param in ipmi_oem_setup()
Commit changes evaluation order of 'oemtype' which is an input parameter to
ipmi_oem_setup() in 'lib/ipmi_oem.c'. Make the check whether 'oemtype' is NULL
or not one of the first things we do rather than blindly use 'oemtype' in
strncmp() and then check if it isn't NULL. Yes, this is a potential crash
waiting to happen.

Reported-by: Ales Ledvinka
2013-02-12 12:01:32 +00:00
Zdenek Styblik
5fa202f7d3 ID: 3600930 - dead code in 'lib/ipmi_sdr.c'
Commit adds comment for dead code in 'lib/ipmi_sdr.c'. This part of code has
been purposefully turned off.
2013-02-07 06:14:56 +00:00
Zdenek Styblik
c070fc00d6 ID: 3600930 - 'lib/ipmi_sdr.c' - NULL dereference
Commit fixes NULL dereference in 'lib/ipmi_sdr.c' by checking whether Sensor is
type of 'full' or 'compact'.

Fix by: Jim Mank
Reported by: Ales Ledvinka
2013-02-05 06:57:44 +00:00
Zdenek Styblik
bd4f34b035 ID: 3602439 - 'lib/ipmi_sdr.c' - memory leaks
Commit fixes memory leaks in 'lib/ipmi_sdr.c'. This is based on ticket #3600930.

Reported by: Ales Ledvinka
2013-02-05 06:51:43 +00:00
Zdenek Styblik
6e87e423eb ID: 3601265 - # ipmitool sensor get; leaks memory
ID: 3601106 - # ipmitool sensor get NACname; output incorrect/inconsistent

After a lengthy discussion with Jim, I'm removing free() of sdr_record_list in
ipmi_sensor_get() as this is freed in 'lib/ipmi_main.c' on/prior to ipmitool's
exit.
2013-01-23 11:24:05 +00:00
Ales Ledvinka
37861d60e4 3600962 descriptor leaks 2013-01-18 12:46:52 +00:00
Ales Ledvinka
bd5ffa4756 3600914 no more crash on no response. allow more send/recv loops of waiting. 2013-01-18 12:43:19 +00:00
Ales Ledvinka
c958de2870 3600929 additional ticket request. 2013-01-18 12:37:27 +00:00