1369 Commits

Author SHA1 Message Date
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
Zdenek Styblik
5dbb6b69de ID: 3577154 - 'lib/ipmi_mc.c' - return value of 'mc reset'
Commit adds response handling for 'mc reset' commands according to IPMI
specification.

Reported by: Duncan Idaho
2012-12-20 08:53:05 +00:00
Zdenek Styblik
791268a61c ID: 3597468 - 'lib/ipmi_mc.c' - print_mc_usage() prints to STDOUT
Commit replaces printf() with lprintf(LOG_NOTICE,...) to print help text on
STDERR as other ipmitool's sub-commands do.
2012-12-20 04:54:44 +00:00
Zdenek Styblik
970c5ff8b6 ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
Commit fixes/replaces lprintf(LOG_ERR,...) with printf() to print info message
on STDOUT instead of STDERR in 'mc watchdog off'.
2012-12-20 04:41:50 +00:00
Zdenek Styblik
4728863d5b ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
Commit fixes/replaces lprintf(LOG_ERR,...) with printf() to print info message
on STDOUT instead of STDERR in 'mc watchdog reset'.
2012-12-20 04:36:06 +00:00
Zdenek Styblik
a3d872c73d ID: 3595199 - Add support for # ipmitool sdr <list|elist> help;
Commit adds suppor for # ipmitool sdr <list|elist> help; command.
2012-12-12 13:12:14 +00:00
Zdenek Styblik
9b3000e329 'lib/helper.c', 'include/ipmitool/helper.h' - add str2double()
Commit adds function to handle conversion from string to double. Function has
the same concept as other str2*() functions.
2012-12-12 05:39:35 +00:00
Zdenek Styblik
bd851bab8f ID: 3594835 - NULL reference possible in str2*() functions
Commit fixes possible NULL reference in str2*() functions in 'lib/helper.c'.
Although it's less likely to happen in ipmitool's daily life, it's still
possible.
Let's make sure it doesn't happen.
2012-12-11 20:59:58 +00:00
Zdenek Styblik
b4754b5edb ID: 3592773 - # ipmitool sdr info; prints incorrect info
Commit fixes output printed by # ipmitool sdr info; about 'SDR Repository Alloc
info supported' due to incorrect member name; probably because of copy-paste
error.
2012-12-05 11:02:38 +00:00
Zdenek Styblik
99e4ac0399 ID: 3592770 - # ipmitool sdr list|elist INV_INPUT; return code
Commit fixes return code of # ipmitool sdr list|elist; when invalid
input/unknown command is given.
Return code is > 0 now and error message is printed.
2012-12-05 10:39:46 +00:00
Zdenek Styblik
6733b66a9c ID: 3592732 - 'lib/ipmi_picmg.c' - printf() misuse
Commit replaces printf() with appropriate lprintf() calls. Some error messages
got changed as well.
2012-12-05 07:22:55 +00:00
Zdenek Styblik
daf4c4831f ID: 3528310 - 'lib/ipmi_picmg.c' - NULL reference
Commit fixes reference to rsp which can be NULL if there is no response from
BMC, eg. KCS driver is not loaded.
2012-12-04 19:33:26 +00:00
Zdenek Styblik
d2d2f4789d 'lib/helper.c' - clean-up - remove standalone tabs('\t')
Commit removes standalone tabs - code clean-up.
2012-11-26 05:11:16 +00:00
Zdenek Styblik
cce3f84896 ID: 3528347 - 'lib/ipmi_raw.c' - possible int *flow
Commit fixes missing return in function is_valid_param() which slipped in code
review.
2012-11-25 05:39:27 +00:00
Zdenek Styblik
3018b229b1 ID: 3588726 - % ipmitool sol payload status ...; segfaults on no rsp
Commit fixes segafult in ipmi_sol_payload_access_status in 'lib/ipmi_sol.c' when
no response is received. This is caused by passing NULL to lprintf() as
parameter, resp. accessing response data that aren't there.

Reported by: Ales Ledvinka
2012-11-21 09:07:30 +00:00
Zdenek Styblik
fc62075b76 ID: 3582307 - 'lib/ipmi_fru.c' - ipmi_fru_main() return codes
ID: 3582310 - 'lib/ipmi_fru.c' - ipmi_fru_main() - misuse of printf()

Commit is a major re-work of ipmi_fru_main().
* Help print-outs moved into functions.
* Proper return codes on error/help, although some TODOs remain.
* "discovery" 'fru get'
* hopefully less bloat in ipmi_fru_main()
2012-11-17 11:50:24 +00:00
Zdenek Styblik
a5384fa12e ID: 3587913 - Command % ipmitool raw help; returns 1
Commit fixes % ipmitool raw help; return code which should be 0.
2012-11-16 19:23:59 +00:00
Zdenek Styblik
7973f44304 ID: 3528347 - 'lib/ipmi_raw.c' - possible int *flow
Commit fixes int *flows via user input parameters in 'lib/ipmi_raw.c'.
2012-11-16 14:28:10 +00:00
Zdenek Styblik
8d9b434b5a ID: 3577159 - 'lib/ipmi_sdr.c' - uint32_t cast to uint8_t and back
Commit removes pointless(?) and unhandled cast from uint32_t to uint8_t and
back. intf->target_addr is uint32_t, don't try to "squeeze" it into uint8_t
then.

Reported by: Duncan Idaho
2012-11-11 18:59:36 +00:00
Zdenek Styblik
5b90f68407 ID: 3528368 - 'lib/ipmi_sdr.c' - possible int *flow
Commit fixes possible int *flow in ipmi_sdr_print_type() in 'lib/ipmi_sdr.c'.
str2uchar() is used instead of strtol() which wasn't being checked for errors.

Reported by: Duncan Idaho
2012-11-11 18:26:36 +00:00
Zdenek Styblik
2edc474cef ID: 3586228 - 'lib/ipmi_ekanalyzer.c' - ipmi_ekanalyzer_usage() rework
Commit gets rid of huge array of chars and replaces it with couple lprintf()
functions in 'lib/ipmi_ekanalyzer.c' - ipmi_ekanalyzer_usage()
2012-11-11 18:09:43 +00:00
Zdenek Styblik
472d8ab1b3 ID: 3576213 - 'lib/ipmi_fru.c' - unused variable
Commit removes two unused variables, rsp and req, from
ipmi_fru_set_field_string_rebuild() in 'lib/ipmi_fru.c'.

Reported by: Dune Idaho
2012-11-02 06:35:51 +00:00
Zdenek Styblik
4af83567b0 ID: 3528271 - 'lib/ipmi_fru.c' - possible *flow via FRUID
Commit fixes *flow via atoi() and not checking strtol() properly. is_fru_id()
wrapper has been added to mitigate code repetition.

Reported by: Dune Idaho
2012-11-02 06:11:06 +00:00
Zdenek Styblik
66bdb86f04 ID: 3528388 - 'lib/ipmi_ekanalyzer.c' - a typo in error message
Commit fixes a typo in error message in 'lib/ipmi_ekanalyzer.c'.

Reported by: Dune Idaho
2012-11-01 18:52:11 +00:00
Zdenek Styblik
9ef6162f3c ID: 3576211 - 'lib/ipmi_delloem.c' - unused variable
Commit removes unused variables in ipmi_led_get_platform_model_name() in
'lib/ipmi_delloem.c'.

Reported by: Dune Idaho
2012-11-01 18:45:31 +00:00
Zdenek Styblik
629a96d9c3 ID: 3576210 - 'lib/ipmi_dcmi.c' - unused variable
Commit removes unused variable in ipmi_dcmi_prnt_oobDiscover() in
'lib/ipmi_dcmi.c'.

Reported by: Dune Idaho
2012-11-01 18:44:05 +00:00
Zdenek Styblik
122e11a2e8 ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
PROPER - Commit fixes ipmi_get_sol_info()'s return value, so (-1) is returned on
error, eg. response is NULL. It doesn't matter whether it is first or last
response, we bail out immediately.
Commit also fixes missing argument to one lprintf() and
indentation(spaces->tabs).

This bug is connected with ``ID: 1835038 - 'lib/ipmi_sol.c' -
ipmi_get_sol_info() returns always 0''.

Reported by: Duncan Idaho
2012-10-22 16:50:34 +00:00