1295 Commits

Author SHA1 Message Date
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
Zdenek Styblik
86805c2146 ID: 3601265 - # ipmitool sensor get; leaks memory
Commit fixes memory leak in ipmi_sensor_get() caused by not free()-ing
sdr_record_list.
2013-01-17 15:45:25 +00:00
Zdenek Styblik
c97d9d5b85 ID: 3601106 - # ipmitool sensor get NACname; output incorrect/inconsistent
Commit re-works output of # ipmitool sensor get; command. It removes calls to
sensor specific functions with call to ipmi_sdr_print_listentry(). This way,
output is unified with the output of '-v sdr list' and actually has corrent
information. Well, at least errors are gone and no information seems to be
missing.
Commit fixes help and return codes as well.
2013-01-17 14:36:13 +00:00
Zdenek Styblik
76ed820e03 ID: 3600908 - 'lib/ipmi_dcmi.c' - crash in ipmi_print_sensor_info(), NULL ref
Commit fixes crash in ipmi_print_sensor_info() in 'lib/ipmi_dcmi.c' due to NULL
reference. 'rec' is correctly checked whether NULL or not, but it's used
immediately despite of the outcome of the NULL test.
Also, ipmi_sdr_print_rawentry() is used instead of specific print function.
2013-01-17 06:54:07 +00:00
Ales Ledvinka
091ba2ea58 3600907 defined value for "Chassis may not support Force Identify" 2013-01-16 14:28:39 +00:00
Ales Ledvinka
3f53760062 3600929 error keyword 2013-01-16 13:32:41 +00:00
Ales Ledvinka
83794843b5 3600921 similar code as hpmfwupg reading negative length from failed ftell 2013-01-16 12:33:13 +00:00
Ales Ledvinka
4a12bdebd6 3600922 sizeof of incorrect value, bzero deprecated 2013-01-16 12:29:21 +00:00
Ales Ledvinka
8a4139e1b8 3600931 leaks 2013-01-16 12:27:29 +00:00
Ales Ledvinka
15d683d86d 3600942 check return code 2013-01-16 12:24:13 +00:00
Ales Ledvinka
6eda3b5482 3600946 check for failed bind on send, leaks 2013-01-16 12:20:52 +00:00
Ales Ledvinka
6a82e95988 3600960 check the copy of password exists 2013-01-16 12:17:06 +00:00
Ales Ledvinka
28f93df807 3600963 leak and failed random future note 2013-01-16 12:15:10 +00:00
Ales Ledvinka
3f9b728e57 3600964 leak 2013-01-16 12:12:21 +00:00
Ales Ledvinka
9a8a8b7dad 3600965 move the initialization past the null intf check 2013-01-16 12:08:50 +00:00
Ales Ledvinka
75d6c72c5d ID: 3595188 - minor leaks via options. revert prev, this cleaner naming, changes by Zdenek Styblik 2013-01-11 11:21:26 +00:00
Ales Ledvinka
8882955891 fixes minor leaks on command line argument parsing 2013-01-11 10:57:44 +00:00
Zdenek Styblik
22b283b210 ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
ID: 3597782 - 'lib/ipmi_mc' - sysinfo_param() has two consecutive returns
ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos

Commit changes/fixes issues described in tickets #3598203, #3597782 and
#3597781.
Typos in help text of 'getsysinfo'/'setsysinfo' got fixed and function
printf_sysinfo_usage() has been created.
Consecutive return in function sysinfo_param() has been removed.
Some code has been re-worked:
* ipmi_getsysinfo() -> ipmi_mc_getsysinfo(),
* ipmi_setsysinfo() -> ipmi_mc_setsysinfo();
* ipmi_sysinfo_main() extended for 'is_set' parameter to signal whether it's
a get/set operation
* return codes changed
* code styling clean-up
* a bit of code clean-up in ipmi_sysinfo_main(), ipmi_mc_getsysinfo(),
ipmi_mc_setsysinfo()
2013-01-09 11:17:42 +00:00
Zdenek Styblik
2bb3100395 ID: 3597471 - 'lib/ipmi_mc.c' - needs a bit of re-work - rc, inv. options
Commit fixes 'help' and return codes(help =~ 0, invalid > 1). Indentation of
file as well as some formatting changes were made as well.
2012-12-20 14:25:18 +00:00