mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-12 11:37:23 +00:00
Jan Safranek patch for #216967 10/22/08 to fix crashes when parsing 'sol payload' and 'tsol' commands
This commit is contained in:
parent
a1684a2e0b
commit
e807543023
@ -1846,6 +1846,12 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
uint8_t userid = 1;
|
uint8_t userid = 1;
|
||||||
int enable = -1;
|
int enable = -1;
|
||||||
|
|
||||||
|
if (argc == 1 || argc > 4)
|
||||||
|
{
|
||||||
|
print_sol_usage();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strncmp(argv[1], "enable", 6))
|
if (!strncmp(argv[1], "enable", 6))
|
||||||
{
|
{
|
||||||
enable = 1;
|
enable = 1;
|
||||||
@ -1864,7 +1870,7 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
channel = (uint8_t)strtol(argv[2], NULL, 0);
|
channel = (uint8_t)strtol(argv[2], NULL, 0);
|
||||||
}
|
}
|
||||||
if (argc >= 4)
|
if (argc == 4)
|
||||||
{
|
{
|
||||||
userid = (uint8_t)strtol(argv[3], NULL, 0);
|
userid = (uint8_t)strtol(argv[3], NULL, 0);
|
||||||
}
|
}
|
||||||
@ -1912,13 +1918,21 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
*/
|
*/
|
||||||
else if (!strncmp(argv[0], "activate", 8)) {
|
else if (!strncmp(argv[0], "activate", 8)) {
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 2) {
|
||||||
if (!strncmp(argv[1], "usesolkeepalive", 11))
|
print_sol_usage();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc == 2) {
|
||||||
|
if (!strncmp(argv[1], "usesolkeepalive", 15))
|
||||||
_use_sol_for_keepalive = 1;
|
_use_sol_for_keepalive = 1;
|
||||||
else if (!strncmp(argv[1], "nokeepalive", 11))
|
else if (!strncmp(argv[1], "nokeepalive", 11))
|
||||||
_disable_keepalive = 1;
|
_disable_keepalive = 1;
|
||||||
|
else {
|
||||||
|
print_sol_usage();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = ipmi_sol_activate(intf, 0, 0);
|
retval = ipmi_sol_activate(intf, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
int read_only = 0, rows = 0, cols = 0;
|
int read_only = 0, rows = 0, cols = 0;
|
||||||
int port = IPMI_TSOL_DEF_PORT;
|
int port = IPMI_TSOL_DEF_PORT;
|
||||||
|
|
||||||
if (strlen(intf->name) == 3 && strncmp(intf->name, "lan", 3) != 0) {
|
if (strlen(intf->name) < 3 || strncmp(intf->name, "lan", 3) != 0) {
|
||||||
lprintf(LOG_ERR, "Error: Tyan SOL is only available over lan interface");
|
lprintf(LOG_ERR, "Error: Tyan SOL is only available over lan interface");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user