fixes from netbsd

This commit is contained in:
Duncan Laurie 2006-06-28 22:16:32 +00:00
parent cc63758d53
commit a92765fbc9
5 changed files with 28 additions and 19 deletions

View File

@ -388,7 +388,7 @@ ipmi_start_daemon(void)
close(fd); close(fd);
} }
#else #else
if (setpgrp() == -1) if (setpgid(0, 0) == -1)
exit(1); exit(1);
pid = (pid_t) fork(); pid = (pid_t) fork();
if (pid < 0 || pid > 0) if (pid < 0 || pid > 0)
@ -405,4 +405,3 @@ ipmi_start_daemon(void)
dup(0); dup(0);
dup(0); dup(0);
} }

View File

@ -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[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[1] = pmsg->event_data[1];
sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2]; sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2];
if (verbose) if (verbose)
ipmi_sel_print_extended_entry_verbose(intf, &sel_event); ipmi_sel_print_extended_entry_verbose(intf, &sel_event);
else else
@ -523,10 +523,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
/* clip off trailing and leading whitespace */ /* clip off trailing and leading whitespace */
ptr--; ptr--;
while (isspace(*ptr) && ptr >= buf) while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0'; *ptr-- = '\0';
ptr = buf; ptr = buf;
while (isspace(*ptr)) while (isspace((int)*ptr))
ptr++; ptr++;
if (strlen(ptr) == 0) if (strlen(ptr) == 0)
continue; continue;

View File

@ -354,10 +354,10 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
/* clip off trailing and leading whitespace */ /* clip off trailing and leading whitespace */
ptr--; ptr--;
while (isspace(*ptr) && ptr >= buf) while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0'; *ptr-- = '\0';
ptr = buf; ptr = buf;
while (isspace(*ptr)) while (isspace((int)*ptr))
ptr++; ptr++;
if (strlen(ptr) == 0) if (strlen(ptr) == 0)
continue; continue;
@ -476,6 +476,12 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
case IPMI_OEM_NEWISYS: case IPMI_OEM_NEWISYS:
desc = get_newisys_evt_desc(intf, rec); desc = get_newisys_evt_desc(intf, rec);
break; 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: default:
break; break;
} }

View File

@ -56,6 +56,11 @@ extern const struct valstr ipmi_authtype_session_vals[];
#ifdef HAVE_READLINE #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 <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
#define RL_PROMPT "ipmitool> " #define RL_PROMPT "ipmitool> "
@ -107,7 +112,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
shell_intf = intf; shell_intf = intf;
rl_event_hook = rl_event_keepalive; rl_event_hook = rl_event_keepalive;
#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402 #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. */ * timeout equal or greater than 1 second causes an infinite loop. */
rl_set_keyboard_input_timeout(1000 * 1000 - 1); rl_set_keyboard_input_timeout(1000 * 1000 - 1);
#endif #endif
@ -139,7 +144,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '"') { if (*ptr == '"') {
ptr++; ptr++;
while (*ptr != '"') { while (*ptr != '"') {
if (isspace(*ptr)) if (isspace((int)*ptr))
*ptr = '~'; *ptr = '~';
ptr++; ptr++;
} }
@ -147,7 +152,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '\'') { if (*ptr == '\'') {
ptr++; ptr++;
while (*ptr != '\'') { while (*ptr != '\'') {
if (isspace(*ptr)) if (isspace((int)*ptr))
*ptr = '~'; *ptr = '~';
ptr++; ptr++;
} }
@ -211,7 +216,7 @@ ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#endif /* HAVE_READLINE */ #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; int i;
@ -219,6 +224,8 @@ void ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
printf("%s ", argv[i]); printf("%s ", argv[i]);
} }
printf("\n"); printf("\n");
return 0;
} }
static void static void
@ -355,7 +362,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '"') { if (*ptr == '"') {
ptr++; ptr++;
while (*ptr != '"') { while (*ptr != '"') {
if (isspace(*ptr)) if (isspace((int)*ptr))
*ptr = '~'; *ptr = '~';
ptr++; ptr++;
} }
@ -363,7 +370,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '\'') { if (*ptr == '\'') {
ptr++; ptr++;
while (*ptr != '\'') { while (*ptr != '\'') {
if (isspace(*ptr)) if (isspace((int)*ptr))
*ptr = '~'; *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 */ /* clip off trailing and leading whitespace */
ptr--; ptr--;
while (isspace(*ptr) && ptr >= buf) while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0'; *ptr-- = '\0';
ptr = buf; ptr = buf;
while (isspace(*ptr)) while (isspace((int)*ptr))
ptr++; ptr++;
if (strlen(ptr) == 0) if (strlen(ptr) == 0)
continue; continue;

View File

@ -117,8 +117,7 @@ lanplus_HMAC(uint8_t mac,
uint8_t *md, uint8_t *md,
uint32_t *md_len) uint32_t *md_len)
{ {
const EVP_MD *evp_md = NULL;
const EVP_MD *evp_md;
if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) || if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
(mac == IPMI_INTEGRITY_HMAC_SHA1_96)) (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); fprintf(stderr, "Invalid mac type 0x%x in lanplus_HMAC\n", mac);
assert(0); assert(0);
} }
return HMAC(evp_md, key, key_len, d, n, md, (unsigned int *)md_len); 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"); printbuf(output, *bytes_written, "Decrypted this data");
} }
} }