Attached is a patch for the ipmilan STONITH plugin. The good news is that
it does now properly parse the arguments as described in the documentation.
the "auth" now properly takes "admin" or "operator", and "priv" takes
"none", "md5", "md2"... Previously it was just doing an atoi on these
strings which always returned 0.
This sees to solve the problem of STONITH reporting:
CRITICAL **: Unable to setup connection: 16
The other good news is that it now does reset the system on my test
machines (Dell 1920).
The bad news is that it then pukes with:
*** glibc detected *** stonith: munmap_chunk(): invalid pointer:
0x00007fff2dfc6d70 ***
The worse news is that ipmilan uses a deprecated API call to do it's work.
Possibly because of this, it seems to be entirely undocumented, from what I
can see.
So, I wouldn't exactly call ipmilan fixed, but it sucks less.
I'd recommend that ipmilan just be removed. It almost certainly needs
to be rewritten before it can be useful, as it needs to at least use the
new API. horms suggested that one alternative would be to add a configure
option for "--enable-ipmilan", and have it be disabled by default.
As it is quite unhappy, I'm just going to switch to the external STONITH
plugin and use a script calling "ipmitool"...
Sean
--
Early morning cheerfulness can be extremely obnoxious.
-- William Feather
Sean Reifschneider, Member of Technical Staff <[EMAIL PROTECTED]>
tummy.com, ltd. - Linux Consulting since 1995: Ask me about High Availability
diff -ru heartbeat-2.1.2-orig/lib/plugins/stonith/ipmilan.c
heartbeat-2.1.2/lib/plugins/stonith/ipmilan.c
--- heartbeat-2.1.2-orig/lib/plugins/stonith/ipmilan.c 2007-08-01
19:06:55.000000000 -0700
+++ heartbeat-2.1.2/lib/plugins/stonith/ipmilan.c 2007-08-08
18:38:30.000000000 -0700
@@ -411,9 +411,38 @@
tmp->ipaddr = namestocopy[1].s_value;
tmp->portnumber = atoi(namestocopy[2].s_value);
FREE(namestocopy[2].s_value);
- tmp->authtype = atoi(namestocopy[3].s_value);
+ if (strcmp(namestocopy[3].s_value, "none") == 0) {
+ tmp->authtype = 0;
+ }
+ else if (strcmp(namestocopy[3].s_value, "md2") == 0) {
+ tmp->authtype = 1;
+ }
+ else if (strcmp(namestocopy[3].s_value, "md5") == 0) {
+ tmp->authtype = 2;
+ }
+ else if (strcmp(namestocopy[3].s_value, "key") == 0) {
+ tmp->authtype = 4;
+ }
+ else if (strcmp(namestocopy[3].s_value, "password") == 0) {
+ tmp->authtype = 4;
+ }
+ else {
+ LOG(PIL_CRIT, "ipmilan auth type '%s' invalid. See "
+ "README.ipmilan for allowed values", namestocopy[3].s_value);
+ return(S_OOPS);
+ }
FREE(namestocopy[3].s_value);
- tmp->privilege = atoi(namestocopy[4].s_value);
+ if (strcmp(namestocopy[4].s_value, "operator") == 0) {
+ tmp->privilege = 3;
+ }
+ if (strcmp(namestocopy[4].s_value, "admin") == 0) {
+ tmp->privilege = 4;
+ }
+ else {
+ LOG(PIL_CRIT, "ipmilan priv value '%s' invalid. See "
+ "README.ipmilan for allowed values", namestocopy[4].s_value);
+ return(S_OOPS);
+ }
FREE(namestocopy[4].s_value);
tmp->username = namestocopy[5].s_value;
tmp->password = namestocopy[6].s_value;
diff -ru heartbeat-2.1.2-orig/lib/plugins/stonith/ipmilan_command.c
heartbeat-2.1.2/lib/plugins/stonith/ipmilan_command.c
--- heartbeat-2.1.2-orig/lib/plugins/stonith/ipmilan_command.c 2007-08-01
19:06:55.000000000 -0700
+++ heartbeat-2.1.2/lib/plugins/stonith/ipmilan_command.c 2007-08-08
18:37:50.000000000 -0700
@@ -141,14 +141,15 @@
int
rsp_handler(ipmi_con_t *ipmi, ipmi_msg_t *rsp)
{
+
+/* This code causes segmentation faults in the "rv = " line, and the
+ * "free(" line seems to be freeing invalid memory */
+#if 0
int rv;
int * request;
request = (void *) rsp->data;
-#if 0
- dump_msg_data(rsp, addr, NULL);
-#endif
rv = rsp->data[0];
/* some IPMI device might not issue 0x00, success, for reset command.
instead, a 0xc3, timeout, is returned. */
@@ -158,8 +159,12 @@
} else {
gstatus = S_RESETFAIL;
}
-
free(request);
+#else
+ /* so, until this code can be fixed, we'll just assume it's ok */
+ gstatus = S_OK;
+#endif
+
return gstatus;
}
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/