1252 Commits

Author SHA1 Message Date
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
Zdenek Styblik
a974ab2c69 REVERT - ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
I'm reverting to previous revision, because I've realized these
``if (rsp != NULL)'' became redundant.
I'm sorry about that.
2012-10-22 06:09:49 +00:00
Zdenek Styblik
f8f6d51fd2 ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
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-21 11:46:17 +00:00
Zdenek Styblik
8d828f6c72 ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
ipmitool doesn't build on big endian architectures, because of missing include
of <bswap.h>.

Submitted by: Dan Horak
2012-10-21 04:28:08 +00:00
Zdenek Styblik
d54e20c545 ID: 3578022 - 'lib/ipmi_delloem.c' fix typos
This is a patch for building on big endian platforms that fixes the typos
introduced by rev 1.17 of ipmi_delloem.c

Submitted by: Dan Horak
2012-10-21 04:14:38 +00:00
Zdenek Styblik
44310bd898 ID: 3578276 - 'lib/ipmi_fru.c' - free() on freed memory possible
ID: 3578275 - 'lib/ipmi_fru.c' - memory leaks

Commit fixes several memory leaks and possible call of free() on memory that has
been already freed.
Despite 'goto' should be avoided as much as possible, its use seemed to be quite
reasonable in this case.
2012-10-20 19:57:17 +00:00
Zdenek Styblik
a9f7a7b92e ID: 3578277 - 'lib/ipmi_fru.c' - possible NULL pointer
Commit fixes possible NULL pointer by adding check whether fru_bloc, returned
from build_fru_bloc(), is NULL or not. If it is, print an error message and
return (-1).
2012-10-19 07:01:40 +00:00
Zdenek Styblik
d65cccc32a ID: 3577155 - 'lib/ipmi_main.c' - memory leaks
Commit fixes two memory leaks in 'lib/ipmi_main.c'. They were caused by not
freeing memory allocated by strdup() which uses malloc() underneath.

Reported by Duncan Idaho.
2012-10-17 05:03:45 +00:00
Zdenek Styblik
131846fb40 ID: 3577766 - configure's knobs and switches don't work
Some of configure's knobs and switches, eg. --disable-intf-open, don't work.
This is caused by poor choice of variable names, resp. using the same variable
names Autoconf is using. And Autoconf doesn't like it, resp. gets confused.

Variable names prefixed with an 'x' in order to make them 'unique'.
2012-10-17 04:45:14 +00:00
Zdenek Styblik
c62359bd79 lib/ipmi_fru.c - pointless/wrong cast loop
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.
2012-10-04 07:46:27 +00:00
Zdenek Styblik
1e83f7c88a ID: 3568976 - 'sel set time' behaviour is inconsistent
Commit fixes missing '*'. Without it, not only the previous commit breaks more
than it fixes, but it may (eventually) lead to segfault.
2012-10-02 18:55:41 +00:00
Zdenek Styblik
4a4b2e3b59 configure.in - remove Solaris+SPARC -> no BMC
Commit removes false presumption there is no BMC driver for SPARC platform in
Solaris. Also, this makes BMC driver default to yes, being built, on Solaris.
2012-09-29 08:51:53 +00:00
Zdenek Styblik
c88b139452 configure.in - replace leading spaces with tab
Commit replaces leading spaces with single tabulator in solaris section.
Somebody probably mistaken tabs for the spaces.
No functional change.
2012-09-29 08:33:45 +00:00
Zdenek Styblik
6011359cb3 ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
Commit fixes compilation problems on Solaris. These were caused by missing
header file, <sys/ioccom.h>, which defines _IO* macros.
2012-09-28 18:47:01 +00:00
Zdenek Styblik
23a5477d6e ID: 3568976 - 'sel set time' behaviour is inconsistent
Commit fixes inconsistent behaviour of 'sel set time' command. This was caused
by random init values of tm structures.
Also, the state of DST should be looked up now.
2012-09-28 17:50:56 +00:00
Jim Mankovich
700ee7d27d Author: Jan Safranek <jsafrane@redhat.com>
Date:   Mon Aug 13 14:35:28 2012 +0200
    Fixed ipmievd start under systemd.

    Systemd init system starts services with parent PID=1. Still, it is expected
    that the daemon forks and exits with nozero exit status, if its initialization
    fails.
2012-09-05 20:46:16 +00:00
Jim Mankovich
2d725c2cd6 ipmitool should document also -b, -B, -l and -T options, which are
currently missing. The description is taken from ipmitool -h output.

Original author: J.H.M. Dassen, rdassen at redhat.com.
2012-09-05 14:22:36 +00:00
Jordan Hargrave
5c9addb8c4 Fix offset for LCD_STATUS with new sysinfo interface 2012-08-14 17:54:08 +00:00