diff --git a/ipmitool/lib/helper.c b/ipmitool/lib/helper.c index c4f9794..e596cc9 100644 --- a/ipmitool/lib/helper.c +++ b/ipmitool/lib/helper.c @@ -388,7 +388,7 @@ ipmi_start_daemon(void) close(fd); } #else - if (setpgrp() == -1) + if (setpgid(0, 0) == -1) exit(1); pid = (pid_t) fork(); if (pid < 0 || pid > 0) @@ -405,4 +405,3 @@ ipmi_start_daemon(void) dup(0); dup(0); } - diff --git a/ipmitool/lib/ipmi_event.c b/ipmitool/lib/ipmi_event.c index fa0126c..b8496ff 100644 --- a/ipmitool/lib/ipmi_event.c +++ b/ipmitool/lib/ipmi_event.c @@ -71,7 +71,7 @@ ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg) sel_event.sel_type.standard_type.event_data[0] = pmsg->event_data[0]; sel_event.sel_type.standard_type.event_data[1] = pmsg->event_data[1]; sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2]; - + if (verbose) ipmi_sel_print_extended_entry_verbose(intf, &sel_event); else @@ -523,10 +523,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file) /* clip off trailing and leading whitespace */ ptr--; - while (isspace(*ptr) && ptr >= buf) + while (isspace((int)*ptr) && ptr >= buf) *ptr-- = '\0'; ptr = buf; - while (isspace(*ptr)) + while (isspace((int)*ptr)) ptr++; if (strlen(ptr) == 0) continue; diff --git a/ipmitool/lib/ipmi_sel.c b/ipmitool/lib/ipmi_sel.c index 5d4e930..a141ca3 100644 --- a/ipmitool/lib/ipmi_sel.c +++ b/ipmitool/lib/ipmi_sel.c @@ -354,10 +354,10 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename) /* clip off trailing and leading whitespace */ ptr--; - while (isspace(*ptr) && ptr >= buf) + while (isspace((int)*ptr) && ptr >= buf) *ptr-- = '\0'; ptr = buf; - while (isspace(*ptr)) + while (isspace((int)*ptr)) ptr++; if (strlen(ptr) == 0) continue; @@ -476,6 +476,12 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec) case IPMI_OEM_NEWISYS: desc = get_newisys_evt_desc(intf, rec); break; + case IPMI_OEM_SUN: + case IPMI_OEM_INTEL: + case IPMI_OEM_TYAN: + case IPMI_OEM_SUPERMICRO: + case IPMI_OEM_KONTRON: + case IPMI_OEM_UNKNOWN: default: break; } diff --git a/ipmitool/src/ipmishell.c b/ipmitool/src/ipmishell.c index f7aca49..e6778f4 100644 --- a/ipmitool/src/ipmishell.c +++ b/ipmitool/src/ipmishell.c @@ -56,6 +56,11 @@ extern const struct valstr ipmi_authtype_session_vals[]; #ifdef HAVE_READLINE +/* avoid warnings errors due to non-ANSI type declarations in readline.h */ +#define _FUNCTION_DEF +#define USE_VARARGS +#define PREFER_STDARG + #include #include #define RL_PROMPT "ipmitool> " @@ -107,7 +112,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv) shell_intf = intf; rl_event_hook = rl_event_keepalive; #if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402 - /* There is a bug in readline 4.2 and later (at least on FreeBSD): + /* There is a bug in readline 4.2 and later (at least on FreeBSD and NetBSD): * timeout equal or greater than 1 second causes an infinite loop. */ rl_set_keyboard_input_timeout(1000 * 1000 - 1); #endif @@ -139,7 +144,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv) if (*ptr == '"') { ptr++; while (*ptr != '"') { - if (isspace(*ptr)) + if (isspace((int)*ptr)) *ptr = '~'; ptr++; } @@ -147,7 +152,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv) if (*ptr == '\'') { ptr++; while (*ptr != '\'') { - if (isspace(*ptr)) + if (isspace((int)*ptr)) *ptr = '~'; ptr++; } @@ -211,7 +216,7 @@ ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv) #endif /* HAVE_READLINE */ -void ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv) +int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv) { int i; @@ -219,6 +224,8 @@ void ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv) printf("%s ", argv[i]); } printf("\n"); + + return 0; } static void @@ -355,7 +362,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv) if (*ptr == '"') { ptr++; while (*ptr != '"') { - if (isspace(*ptr)) + if (isspace((int)*ptr)) *ptr = '~'; ptr++; } @@ -363,7 +370,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv) if (*ptr == '\'') { ptr++; while (*ptr != '\'') { - if (isspace(*ptr)) + if (isspace((int)*ptr)) *ptr = '~'; ptr++; } @@ -373,10 +380,10 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv) /* clip off trailing and leading whitespace */ ptr--; - while (isspace(*ptr) && ptr >= buf) + while (isspace((int)*ptr) && ptr >= buf) *ptr-- = '\0'; ptr = buf; - while (isspace(*ptr)) + while (isspace((int)*ptr)) ptr++; if (strlen(ptr) == 0) continue; diff --git a/ipmitool/src/plugins/lanplus/lanplus_crypt_impl.c b/ipmitool/src/plugins/lanplus/lanplus_crypt_impl.c index 51342ea..7d6b46d 100644 --- a/ipmitool/src/plugins/lanplus/lanplus_crypt_impl.c +++ b/ipmitool/src/plugins/lanplus/lanplus_crypt_impl.c @@ -117,8 +117,7 @@ lanplus_HMAC(uint8_t mac, uint8_t *md, uint32_t *md_len) { - - const EVP_MD *evp_md; + const EVP_MD *evp_md = NULL; if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) || (mac == IPMI_INTEGRITY_HMAC_SHA1_96)) @@ -128,7 +127,6 @@ lanplus_HMAC(uint8_t mac, fprintf(stderr, "Invalid mac type 0x%x in lanplus_HMAC\n", mac); assert(0); } - return HMAC(evp_md, key, key_len, d, n, md, (unsigned int *)md_len); } @@ -293,4 +291,3 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, printbuf(output, *bytes_written, "Decrypted this data"); } } -