[Debian-ha-commits] [cluster-glue] 28/73: Imported Upstream version 1.0.8

Richard Winters devrik-guest at moszumanska.debian.org
Sat Apr 18 20:24:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

devrik-guest pushed a commit to branch master
in repository cluster-glue.

commit ab5f7df5f9f5feaff6aeff90caa56b83f127b8b1
Author: Richard B Winters <rik at mmogp.com>
Date:   Sat Apr 18 07:48:46 2015 -0400

    Imported Upstream version 1.0.8
---
 .hg_archival.txt                     |   2 +-
 .hgtags                              |   2 +
 ChangeLog                            |  27 +++++++
 Makefile.am                          |   3 +-
 cluster-glue-fedora.spec             |   2 +-
 cluster-glue-suse.spec               |   2 +-
 Makefile.am => config/Makefile.am    |  26 ++-----
 config/byteorder_test.c              |  15 ++++
 configure.ac                         |  21 ++----
 hb_report/hb_report.in               | 137 +++++++++++++++++------------------
 include/lha_internal.h               |  10 +++
 include/stonith/stonith.h            |   2 +-
 include/stonith/stonith_plugin.h     |   4 +-
 lib/clplumbing/base64_md5_test.c     |   1 +
 lib/clplumbing/cl_msg.c              |   3 -
 lib/clplumbing/cl_msg_types.c        |  26 ++-----
 lib/clplumbing/cl_poll.c             |   2 -
 lib/clplumbing/cl_syslog.c           |   4 -
 lib/clplumbing/ipcsocket.c           |  11 +--
 lib/clplumbing/ipctest.c             |   3 +-
 lib/clplumbing/longclock.c           |  27 ++++---
 lib/plugins/lrm/raexeclsb.c          |   4 +
 lib/plugins/stonith/apcmaster.c      |   4 +-
 lib/plugins/stonith/apcmastersnmp.c  |   4 +-
 lib/plugins/stonith/apcsmart.c       |   6 +-
 lib/plugins/stonith/baytech.c        |   4 +-
 lib/plugins/stonith/bladehpi.c       |   4 +-
 lib/plugins/stonith/cyclades.c       |   4 +-
 lib/plugins/stonith/drac3.c          |   4 +-
 lib/plugins/stonith/external.c       |   6 +-
 lib/plugins/stonith/external/ipmi    |  12 ++-
 lib/plugins/stonith/external/vcenter |   3 +-
 lib/plugins/stonith/ibmhmc.c         |   4 +-
 lib/plugins/stonith/ipmilan.c        |   4 +-
 lib/plugins/stonith/meatware.c       |   6 +-
 lib/plugins/stonith/null.c           |   6 +-
 lib/plugins/stonith/nw_rpc100s.c     |   4 +-
 lib/plugins/stonith/rcd_serial.c     |   6 +-
 lib/plugins/stonith/rhcs.c           |   8 +-
 lib/plugins/stonith/riloe.c          |   6 +-
 lib/plugins/stonith/rps10.c          |   4 +-
 lib/plugins/stonith/ssh.c            |   6 +-
 lib/plugins/stonith/suicide.c        |   4 +-
 lib/plugins/stonith/vacm.c           |   4 +-
 lib/plugins/stonith/wti_mpc.c        |   4 +-
 lib/plugins/stonith/wti_nps.c        |   4 +-
 lib/stonith/expect.c                 |   4 +-
 lib/stonith/ha_log.sh                |   2 +-
 lib/stonith/main.c                   |   8 +-
 lib/stonith/stonith.c                |  16 ++--
 logd/ha_logd.c                       |   3 +-
 lrm/admin/cibsecret.in               |  39 +++++-----
 lrm/test/apitest.c                   |   7 +-
 lrm/test/callbacktest.c              |   3 +-
 lrm/test/lrmregtest.in               |   2 +-
 lrm/test/regression.sh.in            |   2 +-
 56 files changed, 281 insertions(+), 260 deletions(-)

diff --git a/.hg_archival.txt b/.hg_archival.txt
index 0036b6b..73caea4 100644
--- a/.hg_archival.txt
+++ b/.hg_archival.txt
@@ -1,2 +1,2 @@
 repo: e3ffdd7ae81c596b2be7e1e110d2c1255161340e
-node: 177de02442d54d435eaf1d4a6ac9e1248845c05e
+node: 5ea7e344a63312105ee78e54624d6a024ff82633
diff --git a/.hgtags b/.hgtags
index c94a7ce..fedd4ac 100644
--- a/.hgtags
+++ b/.hgtags
@@ -59,3 +59,5 @@ f6c2cd2593f365f984ce051db61466738ac05dcd Beta-0.4.9f
 1c87a0c58c59fc384b93ec11476cefdbb6ddc1e1 glue-1.0.6
 61200fbe18358e420cdc2037d87e803e150c1eac glue-1.0.7-rc1
 5e06b2ddd24b37ad6c1c25d958d7a9dda7d02f93 glue-1.0.7
+5740338816e1ff07d0e37f36214f442e183984d7 glue-1.0.8-rc1
+c69dc6ace936f501776df92dab3d611c2405f69e glue-1.0.8
diff --git a/ChangeLog b/ChangeLog
index f6688c1..855adc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+* Tue Oct 18 2011 Dejan Muhamedagic <dejan at suse.de>, Lars Ellenberg <lars.ellenberg at linbit.com>, and many others
+- stable release 1.0.8
+- cl_log: log spamming control
+- LRM: raexecocf: list resource agents properly (bnc#664409)
+- LRM: lrmd: allow storing parameters in local files (lf#2415)
+- LRM: lrmd: limit number of "stayed too long in operation list"
+  log messages (bnc#636576)
+- stonith: external/libvirt: new plugin for libvirt virtualization technologies
+- stonith: external/vcenter: new plugin
+- stonith: external/hetzner: new plugin
+- stonith: sbd: support for multiple devices
+- stonith: sbd: Fix timeout setting on archs where int != long (bnc#635690)
+- stonith: sbd: abort start if watchdog cannot be initialized (bnc#680109)
+- stonith: sbd: Make failing to set the watchdog timeout non-fatal but annoying
+- stonith: sbd: Make the restart interval for servants configurable
+- stonith: sbd: Maximize scheduler and IO priority in the child processes (bnc#702907)
+- stonith: external/sbd: Fix ordering of arguments in reset
+- stonith: external/ipmi: fix unique parameters' attributes
+- stonith: external/rackpdu: split off assignment from local to
+  make it work with non-bash shells
+- stonith: external: avoid false error if parameter isn't set (bnc#646205)
+- hb_report: add .info files with the last byte pos for all logs
+- hb_report: use sudo for remove collectors if connecting with
+  user other than root
+- hb_report: install debuginfo packages on platforms with zypper (bnc#641979)
+- hb_report: improve detecting ssh user
+
 * Tue Nov 30 2010 Dejan Muhamedagic <dejan at suse.de>, Lars Ellenberg <lars.ellenberg at linbit.com>, and many others
 - stable release 1.0.7
 - clplumbing: ipc: adjust socket buffers size when adjusting ipc queue length
diff --git a/Makefile.am b/Makefile.am
index e92c925..d724837 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,8 @@
 MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure DRF/config-h.in \
 			  DRF/stamp-h.in libtool.m4 ltdl.m4 libltdl.tar
 
-SUBDIRS			= include $(LIBLTDL_DIR) replace lib lrm logd hb_report doc
+SUBDIRS			= include $(LIBLTDL_DIR) replace lib lrm logd \
+			  hb_report doc config
 
 install-exec-local:
 	$(INSTALL) -d $(DESTDIR)/$(HA_COREDIR)
diff --git a/cluster-glue-fedora.spec b/cluster-glue-fedora.spec
index 06a62bb..2c53cfc 100644
--- a/cluster-glue-fedora.spec
+++ b/cluster-glue-fedora.spec
@@ -15,7 +15,7 @@
 
 Name:		cluster-glue
 Summary:	Reusable cluster components
-Version:	1.0.7
+Version:	1.0.8
 Release:	1%{?dist}
 License:	GPLv2+ and LGPLv2+
 Url:		http://www.linux-ha.org/wiki/Cluster_Glue
diff --git a/cluster-glue-suse.spec b/cluster-glue-suse.spec
index c86d609..1a9b25d 100644
--- a/cluster-glue-suse.spec
+++ b/cluster-glue-suse.spec
@@ -29,7 +29,7 @@
 
 Name:           cluster-glue
 Summary:        Reusable cluster components
-Version:        1.0.7
+Version:        1.0.8
 Release:        1%{?dist}
 License:        GPL v2 or later; LGPL v2.1 or later
 Url:            http://www.linux-ha.org/wiki/Cluster_Glue
diff --git a/Makefile.am b/config/Makefile.am
similarity index 50%
copy from Makefile.am
copy to config/Makefile.am
index e92c925..fa41516 100644
--- a/Makefile.am
+++ b/config/Makefile.am
@@ -1,35 +1,19 @@
 #
-# Copyright (C) 2008 Andrew Beekhof
+# Copyright (C) 2005 Guochun Shi (gshi at ncsa.uiuc.edu)
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#
+# 
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+# 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-
-MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure DRF/config-h.in \
-			  DRF/stamp-h.in libtool.m4 ltdl.m4 libltdl.tar
-
-SUBDIRS			= include $(LIBLTDL_DIR) replace lib lrm logd hb_report doc
-
-install-exec-local:
-	$(INSTALL) -d $(DESTDIR)/$(HA_COREDIR)
-	-$(INSTALL) -d -m 700 -o root $(DESTDIR)/$(HA_COREDIR)/root
-	-$(INSTALL) -d -m 700 -o nobody $(DESTDIR)/$(HA_COREDIR)/nobody
-	$(INSTALL) -d -m 700 $(DESTDIR)/$(HA_COREDIR)/$(GLUE_DAEMON_USER)
-	-chown $(GLUE_DAEMON_USER) $(DESTDIR)/$(HA_COREDIR)/$(GLUE_DAEMON_USER)
-# Use chown because $(GLUE_DAEMON_USER) may not exist yet
-
-dist-clean-local:
-	rm -f autoconf automake autoheader $(TARFILE)
 
-.PHONY: 
+MAINTAINERCLEANFILES    = Makefile.in
+EXTRA_DIST = byteorder_test.c
diff --git a/config/byteorder_test.c b/config/byteorder_test.c
new file mode 100644
index 0000000..0583803
--- /dev/null
+++ b/config/byteorder_test.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+int
+main ()
+{
+	unsigned int a = 0x1234;
+
+	if ( (unsigned int) ( ((unsigned char *)&a)[0]) == 0x34 ) {
+		printf("little-endian\n");
+		return 0;
+	} else {
+		printf("big-endian\n");
+		return 1;
+	}	
+}
diff --git a/configure.ac b/configure.ac
index 0896628..2d143d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl     checks for compiler characteristics
 dnl     checks for library functions
 dnl     checks for system services
 
-AC_INIT(cluster-glue, 1.0.7, linux-ha-dev at lists.linux-ha.org)
+AC_INIT(cluster-glue, 1.0.8, linux-ha-dev at lists.linux-ha.org)
 
 FEATURES=""
 HB_PKG=heartbeat
@@ -79,6 +79,7 @@ AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(clock_t, [], [#include <sys/times.h>])
 AC_STRUCT_TIMEZONE
 
 dnl ===============================================
@@ -453,19 +454,6 @@ AC_DEFINE_UNQUOTED(GLUE_BUILD_VERSION, "$GLUE_BUILD_VERSION", Build version)
 AC_MSG_RESULT($GLUE_BUILD_VERSION)
 AC_SUBST(GLUE_BUILD_VERSION)
 
-
-dnl check if there are getpid() inconsistency
-dnl	Note: reduce LIBS; in particular, ltdl can cause confusion.
-dnl	Possibly better:  move 'LIBS="$LIBS -lltdl"' from above to beyond here.
-dnl
-AC_MSG_CHECKING(for getpid() consistency in multi-process/threads program)
-ac_save_LIBS=$LIBS
-LIBS="-lpthread"
-AC_TRY_RUN(`cat $srcdir/config/pidtest.c`, 
-AC_MSG_RESULT(ok), 
-[AC_MSG_RESULT(fail); AC_DEFINE(GETPID_INCONSISTENT, 1 , [pid inconsistent])],)
-LIBS=$ac_save_LIBS
-
 dnl check byte order
 AC_MSG_CHECKING(for byteorder)
 AC_TRY_RUN(`cat $srcdir/config/byteorder_test.c`,
@@ -816,7 +804,7 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[[#include <time.h>]])
 AC_CHECK_TYPES([nfds_t],,,[[#include <poll.h>]])
 
 AC_MSG_CHECKING(if clock_t is long enough)
-if test $ac_cv_sizeof_long -ge 8; then
+if test $ac_cv_sizeof_clock_t -ge 8; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(CLOCK_T_IS_LONG_ENOUGH, 1, [Set if CLOCK_T is adequate by itself for the "indefinite future" (>= 100 years)])
 else
@@ -1199,7 +1187,7 @@ else
 		-Wall
 		-Waggregate-return
 		-Wbad-function-cast 
-		-Wcast-qual 
+		-Wcast-qual
 		-Wcast-align 
 		-Wdeclaration-after-statement
 		-Wendif-labels
@@ -1322,6 +1310,7 @@ AC_SUBST(QUIET_LIBTOOL_OPTS)
 
 dnl The Makefiles and shell scripts we output
 AC_CONFIG_FILES(Makefile				        \
+config/Makefile						\
 include/Makefile						\
    include/pils/Makefile					\
    include/pils/plugin.h					\
diff --git a/hb_report/hb_report.in b/hb_report/hb_report.in
index 3094cc6..7cdb28c 100755
--- a/hb_report/hb_report.in
+++ b/hb_report/hb_report.in
@@ -17,7 +17,7 @@
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  #
 
-. @OCF_ROOT_DIR@/resource.d/heartbeat/.ocf-shellfuncs
+. @OCF_ROOT_DIR@/lib/heartbeat/ocf-shellfuncs
 
 HA_NOARCHBIN=@datadir@/@PACKAGE_NAME@
 
@@ -216,8 +216,7 @@ logmarks() {
 		if [ "$n" = "`uname -n`" ]; then
 			is_node && logmark $HA_LOGFACILITY.$HA_LOGLEVEL $msg
 		else
-			[ "$ssh_good" ] &&
-				ssh $ssh_opts $n "$c"
+			ssh $SSH_OPTS_AUTH $n "$c"
 		fi
 	done
 }
@@ -473,12 +472,13 @@ is_master() {
 start_slave_collector() {
 	local node=$1
 
+	dumpenv |
 	if [ "$node" = "$WE" ]; then
-		dumpenv > $DESTDIR/.env
+		cat > $DESTDIR/.env
 		hb_report __slave $DESTDIR
 	else
-		ssh $ssh_opts $node \
-			"$SUDO hb_report __slave $DESTDIR" |
+		ssh $SSH_OPTS_AUTH $node \
+			"cat > $DESTDIR/.env; $SUDO hb_report __slave $DESTDIR" |
 			(cd $DESTDIR && tar xf -)
 	fi &
 
@@ -487,44 +487,50 @@ start_slave_collector() {
 
 #
 # does ssh work?
+# and how
 #
-testsshuser() {
-	if [ "$2" ]; then
-		ssh -T -o Batchmode=yes $2@$1 true 2>/dev/null
-	else
-		ssh -T -o Batchmode=yes $1 true 2>/dev/null
-	fi
+testsshconn() {
+	ssh -T -o Batchmode=yes $1 true 2>/dev/null
 }
 findsshuser() {
-	for u in "" $TRY_SSH; do
-		rc=0
-		failed_nodes=""
-		for n in $NODES; do
-			[ "$n" = "$WE" ] && continue
-			u_print=$u
-			[ "$u_print" ] || u_print=`id -un`
-			debug "test ssh $u_print@$n"
-			if testsshuser $n $u; then
-				debug "ssh $u_print@$n OK"
+	local n u rc
+	local ssh_s ssh_user="__undef" try_user_list failed_nodes=""
+	try_user_list=${SSH_USER:-"\"\" $TRY_SSH"}
+	for n in $NODES; do
+		rc=1
+		[ "$n" = "$WE" ] && continue
+		for u in $try_user_list; do
+			if [ "$u" != '""' ]; then
+				ssh_s=$u@$n
 			else
-				rc=1
-				failed_nodes="$failed_nodes $n"
-				debug "ssh $u_print@$n failed"
+				ssh_s=$n
 			fi
-		done
-		if [ $rc -eq 0 ]; then
-			echo $u
-			return 0
-		else
-			if [ "$u" ]; then
-				info "ssh with user $u does not work to $failed_nodes"
+			if testsshconn $ssh_s; then
+				debug "ssh $ssh_s OK"
+				ssh_user="$u"
+				try_user_list="$u" # we support just one user
+				rc=0
+				break
 			else
-				info "ssh without user does not work to $failed_nodes"
+				debug "ssh $ssh_s failed"
 			fi
-			info "will try next user"
-		fi
+		done
+		[ $rc = 1 ] &&
+			failed_nodes="$failed_nodes $n"
 	done
-	return 1
+	[ -n "$failed_nodes" ] &&
+		warning "ssh to node(s)$failed_nodes does not work"
+	if [ "$ssh_user" != "__undef" ]; then
+		if [ "$ssh_user" != '""' ]; then
+			SSH_OPTS_AUTH="$SSH_OPTS -l $ssh_user"
+		else
+			SSH_OPTS_AUTH="$SSH_OPTS"
+		fi
+	else
+		return 1
+	fi
+	# drop nodes we cannot reach
+	NODES=`for n in $failed_nodes $NODES; do echo $n; done | sort | uniq -u`
 }
 
 #
@@ -602,7 +608,7 @@ getconfigurations() {
 sys_info() {
 	cluster_info
 	hb_report -V # our info
-	echo "resource-agents: `grep 'Build version:' @OCF_ROOT_DIR@/resource.d/heartbeat/.ocf-shellfuncs`"
+	echo "resource-agents: `grep 'Build version:' @OCF_ROOT_DIR@/lib/heartbeat/ocf-shellfuncs`"
 	crm_info
 	pkg_ver $PACKAGES
 	echo "Platform: `uname`"
@@ -628,7 +634,17 @@ sys_stats() {
 	lsscsi
 	lspci
 	mount
-	df
+	# df can block, run in background, allow for 5 seconds (!)
+	local maxcnt=5
+	df &
+	while kill -0 $! >/dev/null 2>&1; do
+		sleep 1
+		if [ $maxcnt -le 0 ]; then
+			warning "df appears to be hanging, continuing without it"
+			break
+		fi
+		maxcnt=$((maxcnt-1))
+	done
 	set +x
 }
 dlm_dump() {
@@ -1189,18 +1205,8 @@ if ! is_collector; then
 # part 2: ssh business
 #
 	# find out if ssh works
-	ssh_good=""
 	if [ -z "$NO_SSH" ]; then
-		[ "$SSH_USER" ] ||
-			SSH_USER=`findsshuser`
-		if [ $? -eq 0 ]; then
-			ssh_good=1
-			if [ "$SSH_USER" ]; then
-				ssh_opts="-l $SSH_USER $SSH_OPTS"
-			else
-				ssh_opts="$SSH_OPTS"
-			fi
-		fi
+		findsshuser
 	fi
 # final check: don't run if the destination directory exists
 	[ -d $DESTDIR ] && {
@@ -1212,26 +1218,19 @@ if ! is_collector; then
 	}
 	mkdir -p $DESTDIR
 	[ -d $DESTDIR ] || nodistdirectory
-	if [ "$ssh_good" ]; then
-		for node in $NODES; do
-			[ "$node" = "$WE" ] && continue
-			ssh $ssh_opts $node "test -d $DESTDIR" && {
-				if [ "$FORCE_REMOVE_DEST" -o "$CTS" ]; then # relax a bit for CTS
-					ssh $ssh_opts $node "rm -r $DESTDIR"
-				else
-					test -d $DESTDIR && rmdir $DESTDIR
-					msgcleanup $node
-				fi
-			}
-			dumpenv |
-			ssh $ssh_opts $node "mkdir -p $DESTDIR && cat > $DESTDIR/.env"
-		done
-	else
-		if [ -z "$NO_SSH" -a $NODECNT -gt 1 ]; then
-			warning "ssh does not work to all nodes"
-			warning "please use the -u option if you want to supply a password"
-		fi
-	fi
+	for node in $NODES; do
+		[ "$node" = "$WE" ] && continue
+		ssh $SSH_OPTS_AUTH $node "test -d $DESTDIR" && {
+			if [ "$FORCE_REMOVE_DEST" -o "$CTS" ]; then # relax a bit for CTS
+				ssh $SSH_OPTS_AUTH $node "rm -r $DESTDIR"
+			else
+				test -d $DESTDIR && rmdir $DESTDIR
+				msgcleanup $node
+			fi
+		}
+		dumpenv |
+		ssh $SSH_OPTS_AUTH $node "mkdir -p $DESTDIR && cat > $DESTDIR/.env"
+	done
 fi
 
 # only cluster nodes need their own directories
diff --git a/include/lha_internal.h b/include/lha_internal.h
index 94d04bc..bae10a0 100644
--- a/include/lha_internal.h
+++ b/include/lha_internal.h
@@ -169,4 +169,14 @@ inet_pton(int af, const char *src, void *dst);
 #	define	ASSERT(X)	{if(!(X)) ha_assert("X", __LINE__, __FILE__);}
 #endif
 
+/* shamelessly stolen from linux kernel */
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
+/* Force a compilation error if condition is true, but also produce a
+ * result (of value 0 and type size_t), so the expression can be used
+ * e.g. in a structure initializer (or where-ever else comma expressions
+ * aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
+
 #endif /* LHA_INTERNAL_H */
diff --git a/include/stonith/stonith.h b/include/stonith/stonith.h
index 7dd58f8..1aba74b 100644
--- a/include/stonith/stonith.h
+++ b/include/stonith/stonith.h
@@ -95,7 +95,7 @@ char **	stonith_types(void);	/* NULL-terminated list */
 Stonith*stonith_new(const char * type);
 void	stonith_delete(Stonith *);
 
-const char**	stonith_get_confignames	(Stonith* s);
+const char * const *	stonith_get_confignames	(Stonith* s);
 				/* static/global return */
 				/* Return number and list of valid s_names */
 
diff --git a/include/stonith/stonith_plugin.h b/include/stonith/stonith_plugin.h
index 1dd66b4..9091a6e 100644
--- a/include/stonith/stonith_plugin.h
+++ b/include/stonith/stonith_plugin.h
@@ -53,7 +53,7 @@ struct stonith_ops {
 	void (*destroy)		(StonithPlugin*);	/*(full) Destructor */
 
 	const char* (*get_info)	(StonithPlugin*, int infotype);
-	const char** (*get_confignames)	(StonithPlugin*);
+	const char * const * (*get_confignames)	(StonithPlugin*);
 	int (*set_config)	(StonithPlugin*, StonithNVpair* list);
 					/* Finishes construction */
 	/*
@@ -104,7 +104,7 @@ struct StonithImports_s {
 	const char* (*GetValue)(StonithNVpair*, const char * name);
 	int	(*CopyAllValues) (StonithNamesToGet* out, StonithNVpair* in);
 	char **(*StringToHostList)(const char * hlstring);
-	char **(*CopyHostList)(const char ** hlstring);
+	char **(*CopyHostList)(const char * const * hlstring);
 	void (*FreeHostList)(char** hostlist);
 	int (*TtyLock)(const char* tty);
 	int (*TtyUnlock)(const char* tty);
diff --git a/lib/clplumbing/base64_md5_test.c b/lib/clplumbing/base64_md5_test.c
index f0fb0f3..d536776 100644
--- a/lib/clplumbing/base64_md5_test.c
+++ b/lib/clplumbing/base64_md5_test.c
@@ -108,5 +108,6 @@ int main(void)
 		error_count++;
 	}
 
+        (void) rc; /* Suppress -Werror=unused-but-set-variable  */
 	return error_count;
 }
diff --git a/lib/clplumbing/cl_msg.c b/lib/clplumbing/cl_msg.c
index 1342158..afb6830 100644
--- a/lib/clplumbing/cl_msg.c
+++ b/lib/clplumbing/cl_msg.c
@@ -598,7 +598,6 @@ ha_msg_addraw_ll(struct ha_msg * msg, char * name, size_t namelen,
 {
 	
 	size_t	startlen = sizeof(MSG_START)-1;
-	int	internal_type;
 	
 
 	int (*addfield) (struct ha_msg* msg, char* name, size_t namelen,
@@ -633,8 +632,6 @@ ha_msg_addraw_ll(struct ha_msg * msg, char * name, size_t namelen,
 		return(HA_FAIL);
 	}
 	
-	internal_type = type;
-	
 	HA_MSG_ASSERT(type < DIMOF(fieldtypefuncs));
 	
 	addfield =  fieldtypefuncs[type].addfield;
diff --git a/lib/clplumbing/cl_msg_types.c b/lib/clplumbing/cl_msg_types.c
index 1b9537b..56cf56a 100644
--- a/lib/clplumbing/cl_msg_types.c
+++ b/lib/clplumbing/cl_msg_types.c
@@ -931,7 +931,6 @@ add_struct_field(struct ha_msg* msg, char* name, size_t namelen,
 		 void* value, size_t vallen, int depth)
 {	
 	int next;
-	struct ha_msg* childmsg;
 
 	if ( !msg || !name || !value
 	     || depth < 0){
@@ -940,8 +939,6 @@ add_struct_field(struct ha_msg* msg, char* name, size_t namelen,
 		return HA_FAIL;
 	}
 	
-	childmsg = (struct ha_msg*)value; 
-	
 	next = msg->nfields;
 	msg->names[next] = name;
 	msg->nlens[next] = namelen;
@@ -964,7 +961,6 @@ add_list_field(struct ha_msg* msg, char* name, size_t namelen,
 	int next;
 	int j;
 	GList* list = NULL;
-	int stringlen_add;
 
 	if ( !msg || !name || !value
 	     || namelen <= 0 
@@ -983,13 +979,8 @@ add_list_field(struct ha_msg* msg, char* name, size_t namelen,
 	}
 	
 	if ( j >= msg->nfields){
-		int listlen;
 		list = (GList*)value;
 
-		listlen = string_list_pack_length(list);
-
-		stringlen_add = list_stringlen(namelen,listlen , value);
-		
 		next = msg->nfields;
 		msg->names[next] = name;
 		msg->nlens[next] = namelen;
@@ -1001,8 +992,7 @@ add_list_field(struct ha_msg* msg, char* name, size_t namelen,
 	}  else if(  msg->types[j] == FT_LIST ){
 
 		GList* oldlist = (GList*) msg->values[j];
-		int oldlistlen = string_list_pack_length(oldlist);
-		int newlistlen;
+		int listlen;
 		size_t i; 
 		
 		for ( i =0; i < g_list_length((GList*)value); i++){
@@ -1014,12 +1004,10 @@ add_list_field(struct ha_msg* msg, char* name, size_t namelen,
 			return HA_FAIL;
 		}
 		
-		newlistlen = string_list_pack_length(list);		
+		listlen = string_list_pack_length(list);		
 		
-		stringlen_add = newlistlen - oldlistlen;
-
 		msg->values[j] = list;
-		msg->vlens[j] =  string_list_pack_length(list);
+		msg->vlens[j] = listlen;
 		g_list_free((GList*)value); /*we don't free each element
 					      because they are used in new list*/
 		free(name); /* this name is no longer necessary
@@ -1069,7 +1057,6 @@ add_uncompress_field(struct ha_msg* msg, char* name, size_t namelen,
 		 void* value, size_t vallen, int depth)
 {	
 	int next;
-	struct ha_msg* childmsg;
 
 	if ( !msg || !name || !value
 	     || depth < 0){
@@ -1078,8 +1065,6 @@ add_uncompress_field(struct ha_msg* msg, char* name, size_t namelen,
 		return HA_FAIL;
 	}
 	
-	childmsg = (struct ha_msg*)value; 
-	
 	next = msg->nfields;
 	msg->names[next] = name;
 	msg->nlens[next] = namelen;
@@ -1533,7 +1518,6 @@ add_string_field(struct ha_msg* msg, char* name, size_t namelen,
 	size_t	cp_vallen;
 	void	*cp_value = NULL;
 	int	next;
-	int	stringlen_add = 0 ;
 
 	if ( !msg || !name || !value
 	     || namelen <= 0 
@@ -1593,8 +1577,8 @@ add_string_field(struct ha_msg* msg, char* name, size_t namelen,
 		}
 		
 		fieldstringlen = fieldtypefuncs[internal_type].stringlen;
-		if (!fieldstringlen || (stringlen_add = 
-					fieldstringlen(cp_namelen, cp_vallen, cp_value)) <= 0 ){
+		if (!fieldstringlen ||
+					fieldstringlen(cp_namelen, cp_vallen, cp_value) <= 0 ){
 			
 			cl_log(LOG_ERR, "add_string_field: stringlen failed");
 			return HA_FAIL;
diff --git a/lib/clplumbing/cl_poll.c b/lib/clplumbing/cl_poll.c
index 91732e2..789eb1a 100644
--- a/lib/clplumbing/cl_poll.c
+++ b/lib/clplumbing/cl_poll.c
@@ -497,7 +497,6 @@ cl_poll_sigaction(int nsig, siginfo_t* info, void* v)
 int
 cl_poll_ignore(int fd)
 {
-	short	nsig;
 	int	flags;
 
 	if (debug) {
@@ -511,7 +510,6 @@ cl_poll_ignore(int fd)
 	if (!is_monitored[fd]) {
 		return 0;
 	}
-	nsig = monitorinfo[fd].nsig;
 
 	is_monitored[fd] = FALSE;
 	memset(monitorinfo+fd, 0, sizeof(monitorinfo[0]));
diff --git a/lib/clplumbing/cl_syslog.c b/lib/clplumbing/cl_syslog.c
index ed9366f..6920bd5 100644
--- a/lib/clplumbing/cl_syslog.c
+++ b/lib/clplumbing/cl_syslog.c
@@ -120,14 +120,12 @@ struct _syslog_code facilitynames[] =
 int
 cl_syslogfac_str2int(const char *fname)
 {
-	struct _syslog_code *fnames;
 	int i;
 
 	if(fname == NULL || strcmp("none", fname) == 0) {
 		return 0;
 	}
 	
-	fnames = (struct _syslog_code *) facilitynames;
 	for (i = 0; facilitynames[i].c_name != NULL; i++) {
 		if (strcmp(fname, facilitynames[i].c_name) == 0) {
 			return facilitynames[i].c_val;
@@ -140,10 +138,8 @@ cl_syslogfac_str2int(const char *fname)
 const char *
 cl_syslogfac_int2str(int fnum)
 {
-	struct _syslog_code *fnames;
 	int i;
 
-	fnames = (struct _syslog_code *) facilitynames;
 	for (i = 0; facilitynames[i].c_name != NULL; i++) {
 		if (facilitynames[i].c_val == fnum) {
 			return facilitynames[i].c_name;
diff --git a/lib/clplumbing/ipcsocket.c b/lib/clplumbing/ipcsocket.c
index 9297c6a..4341daf 100644
--- a/lib/clplumbing/ipcsocket.c
+++ b/lib/clplumbing/ipcsocket.c
@@ -1117,7 +1117,6 @@ socket_recv(struct IPC_CHANNEL * ch, struct IPC_MESSAGE** message)
 
 	int		nbytes;
 	int		result;
-	struct IPC_MESSAGE* ipcmsg;
 
 	socket_resume_io(ch);
 	result = socket_resume_io_read(ch, &nbytes, TRUE);
@@ -1138,12 +1137,10 @@ socket_recv(struct IPC_CHANNEL * ch, struct IPC_MESSAGE** message)
 		ch->recv_queue->current_qlen = 0;
 		return IPC_FAIL;
 	}
-	ipcmsg = *message = (struct IPC_MESSAGE *) (element->data);
-	
-	
-#ifdef IPC_TIME_DEBUG		
-	ipc_time_debug(ch, ipcmsg, MSGPOS_DEQUEUE);	
-#endif	
+	*message = (struct IPC_MESSAGE *) (element->data);
+#ifdef IPC_TIME_DEBUG
+	ipc_time_debug(ch, *message, MSGPOS_DEQUEUE);
+#endif
 
 	CHECKFOO(1,ch, *message, SavedReadBody, "read message");
 	SocketIPCStats.nreceived++;
diff --git a/lib/clplumbing/ipctest.c b/lib/clplumbing/ipctest.c
index 70f646a..a8f7999 100644
--- a/lib/clplumbing/ipctest.c
+++ b/lib/clplumbing/ipctest.c
@@ -1326,7 +1326,6 @@ static int
 mainloop_server(IPC_Channel* chan, int repcount)
 {
 	struct iterinfo info;
-	GCHSource*	msgchan;
 	guint		sendmsgsrc;
 
 	
@@ -1340,7 +1339,7 @@ mainloop_server(IPC_Channel* chan, int repcount)
 	chan->low_flow_mark = 2;
 
 	sendmsgsrc = g_idle_add(s_send_msg, &info);
-	msgchan = G_main_add_IPC_Channel(G_PRIORITY_DEFAULT, chan
+	G_main_add_IPC_Channel(G_PRIORITY_DEFAULT, chan
 	,	FALSE, s_rcv_msg, &info, NULL);
 	cl_log(LOG_INFO, "Mainloop echo server: %d reps pid %d.", repcount, (int)getpid());
 	g_main_run(loop);
diff --git a/lib/clplumbing/longclock.c b/lib/clplumbing/longclock.c
index 6e2c985..594c9c5 100644
--- a/lib/clplumbing/longclock.c
+++ b/lib/clplumbing/longclock.c
@@ -108,14 +108,21 @@ cl_times(void)	/* Make times(2) behave rationally on Linux */
 	}
 	errno = save_errno;
 #endif /* DISABLE_TIMES_KLUDGE */
-	return (unsigned long)ret;
+
+	/* sizeof(long) may be larger than sizeof(clock_t).
+	 * Don't jump from 0x7fffffff to 0xffffffff80000000
+	 * because of sign extension.
+	 * We do expect sizeof(clock_t) <= sizeof(long), however.
+	 */
+	BUILD_BUG_ON(sizeof(clock_t) > sizeof(unsigned long));
+#define CLOCK_T_MAX	(~0UL >> (8*(sizeof(unsigned long) - sizeof(clock_t))))
+	return (unsigned long)ret & CLOCK_T_MAX;
 }
 
 #ifdef CLOCK_T_IS_LONG_ENOUGH
 longclock_t
 time_longclock(void)
 {
-
 	/* See note below about deliberately ignoring errors... */
 	return (longclock_t)cl_times();
 }
@@ -124,8 +131,8 @@ time_longclock(void)
 
 #define	BITSPERBYTE	8
 #define	WRAPSHIFT	(BITSPERBYTE*sizeof(clock_t))
-#define MAXIMUMULONG	((unsigned long)~(0UL))
-#define MINJUMP		((MAXIMUMULONG/100UL)*99UL)
+#define	WRAPAMOUNT	(((longclock_t) 1) << WRAPSHIFT)
+#define	MINJUMP		((CLOCK_T_MAX/100UL)*99UL)
 
 longclock_t
 time_longclock(void)
@@ -137,19 +144,18 @@ time_longclock(void)
 	 * cl_log call is where it is; found by Simon Graham. */
 	static	gboolean	calledbefore	= FALSE;
 	static	unsigned long	lasttimes	= 0L;
-	static	unsigned long	wrapcount	= 0L;
 	static	unsigned long	callcount	= 0L;
 	static	longclock_t	lc_wrapcount	= 0L;
 	unsigned long		timesval;
 
 	++callcount;
 
-	timesval = (unsigned long) cl_times();
+	timesval = cl_times();
 
 	if (calledbefore && timesval < lasttimes)  {
-		clock_t		jumpbackby = lasttimes - timesval;
+		unsigned long jumpbackby = lasttimes - timesval;
 
-		if (jumpbackby < (clock_t)MINJUMP) {
+		if (jumpbackby < MINJUMP) {
 			/* Kernel weirdness */
 			cl_log(LOG_CRIT
 			,	"%s: clock_t from times(2) appears to"
@@ -172,8 +178,7 @@ time_longclock(void)
 			   to double update of wrapcount! */
 
 			lasttimes = timesval;
-			++wrapcount;
-			lc_wrapcount = ((longclock_t)wrapcount) << WRAPSHIFT;
+			lc_wrapcount += WRAPAMOUNT;
 
 			cl_log(LOG_INFO
 			,	"%s: clock_t wrapped around (uptime)."
@@ -184,7 +189,7 @@ time_longclock(void)
 		lasttimes = timesval;
 		calledbefore = TRUE;
 	}
-	return (lc_wrapcount | (longclock_t)timesval);
+	return (lc_wrapcount | timesval);
 }
 #endif	/* ! CLOCK_T_IS_LONG_ENOUGH */
 
diff --git a/lib/plugins/lrm/raexeclsb.c b/lib/plugins/lrm/raexeclsb.c
index d12b7d5..46d7546 100644
--- a/lib/plugins/lrm/raexeclsb.c
+++ b/lib/plugins/lrm/raexeclsb.c
@@ -370,6 +370,8 @@ get_resource_list(GList ** rsc_info)
 			*rsc_info = g_list_remove(*rsc_info, cur->data);
 			g_free(cur->data);
 		}
+#else
+                (void) is_lsb_script;
 #endif
 		cur = tmp;
 	}
@@ -504,6 +506,8 @@ get_resource_meta(const char* rsc_type,  const char* provider)
 			break;
 		}
 	}
+#else
+        (void) next_continue;
 #endif
 
 	/* Enter into the lsb-compliant comment block */
diff --git a/lib/plugins/stonith/apcmaster.c b/lib/plugins/stonith/apcmaster.c
index 84e0818..db578aa 100644
--- a/lib/plugins/stonith/apcmaster.c
+++ b/lib/plugins/stonith/apcmaster.c
@@ -65,7 +65,7 @@
 
 static StonithPlugin *	apcmaster_new(const char *);
 static void		apcmaster_destroy(StonithPlugin *);
-static const char **	apcmaster_get_confignames(StonithPlugin *);
+static const char * const *	apcmaster_get_confignames(StonithPlugin *);
 static int		apcmaster_set_config(StonithPlugin *, StonithNVpair *);
 static const char *	apcmaster_getinfo(StonithPlugin * s, int InfoType);
 static int		apcmaster_status(StonithPlugin * );
@@ -678,7 +678,7 @@ apcmaster_reset_req(StonithPlugin * s, int request, const char * host)
 /*
  *	Get the configuration parameters names
  */
-static const char **
+static const char * const *
 apcmaster_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_IPADDR, ST_LOGIN, ST_PASSWD, NULL};
diff --git a/lib/plugins/stonith/apcmastersnmp.c b/lib/plugins/stonith/apcmastersnmp.c
index 0ad473e..c57f579 100644
--- a/lib/plugins/stonith/apcmastersnmp.c
+++ b/lib/plugins/stonith/apcmastersnmp.c
@@ -75,7 +75,7 @@
 
 static StonithPlugin *	apcmastersnmp_new(const char *);
 static void	apcmastersnmp_destroy(StonithPlugin *);
-static const char **	apcmastersnmp_get_confignames(StonithPlugin *);
+static const char * const *	apcmastersnmp_get_confignames(StonithPlugin *);
 static int	apcmastersnmp_set_config(StonithPlugin *, StonithNVpair *);
 static const char *	apcmastersnmp_getinfo(StonithPlugin * s, int InfoType);
 static int	apcmastersnmp_status(StonithPlugin * );
@@ -700,7 +700,7 @@ apcmastersnmp_reset_req(StonithPlugin * s, int request, const char *host)
  * Get the configuration parameter names.
  */
 
-static const char **
+static const char * const *
 apcmastersnmp_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_IPADDR, ST_PORT, ST_COMMUNITY, NULL};
diff --git a/lib/plugins/stonith/apcsmart.c b/lib/plugins/stonith/apcsmart.c
index 3a0613e..b609a2f 100644
--- a/lib/plugins/stonith/apcsmart.c
+++ b/lib/plugins/stonith/apcsmart.c
@@ -109,7 +109,7 @@ static const char *NOTpluginID = "APCSmart device has been destroyed";
 
 static StonithPlugin *	apcsmart_new(const char *);
 static void		apcsmart_destroy(StonithPlugin *);
-static const char**	apcsmart_get_confignames(StonithPlugin*);
+static const char * const *	apcsmart_get_confignames(StonithPlugin*);
 static int		apcsmart_set_config(StonithPlugin *, StonithNVpair*);
 static const char *	apcsmart_get_info(StonithPlugin * s, int InfoType);
 static int		apcsmart_status(StonithPlugin * );
@@ -621,7 +621,7 @@ APC_deinit(struct pluginDevice *ad)
 		ad->upsfd = -1;
 	}
 }
-static const char**
+static const char * const *
 apcsmart_get_confignames(StonithPlugin* sp)
 {
 	static const char * names[] =  {ST_TTYDEV, ST_HOSTLIST, NULL};
@@ -719,7 +719,7 @@ apcsmart_hostlist(StonithPlugin * s)
 	}
 	ERRIFNOTCONFIGED(s,NULL);
 
-	return OurImports->CopyHostList((const char **)ad->hostlist);
+	return OurImports->CopyHostList((const char **)(void*)ad->hostlist);
 }
 
 static gboolean
diff --git a/lib/plugins/stonith/baytech.c b/lib/plugins/stonith/baytech.c
index ad25974..85275a6 100644
--- a/lib/plugins/stonith/baytech.c
+++ b/lib/plugins/stonith/baytech.c
@@ -37,7 +37,7 @@
 static StonithPlugin *	baytech_new(const char *);
 static void		baytech_destroy(StonithPlugin *);
 static int		baytech_set_config(StonithPlugin *, StonithNVpair *);
-static const char **	baytech_get_confignames(StonithPlugin * s);
+static const char * const *	baytech_get_confignames(StonithPlugin * s);
 static const char *	baytech_get_info(StonithPlugin * s, int InfoType);
 static int		baytech_status(StonithPlugin *);
 static int		baytech_reset_req(StonithPlugin * s, int request, const char * host);
@@ -744,7 +744,7 @@ baytech_reset_req(StonithPlugin * s, int request, const char * host)
 	return(rc != S_OK ? rc : lorc);
 }
 
-static const char **
+static const char * const *
 baytech_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_IPADDR, ST_LOGIN, ST_PASSWD, NULL};
diff --git a/lib/plugins/stonith/bladehpi.c b/lib/plugins/stonith/bladehpi.c
index 27bb975..b835d28 100644
--- a/lib/plugins/stonith/bladehpi.c
+++ b/lib/plugins/stonith/bladehpi.c
@@ -69,7 +69,7 @@
 static StonithPlugin *	bladehpi_new(const char *);
 static void		bladehpi_destroy(StonithPlugin *);
 static const char *	bladehpi_getinfo(StonithPlugin *, int);
-static const char **	bladehpi_get_confignames(StonithPlugin *);
+static const char * const *	bladehpi_get_confignames(StonithPlugin *);
 static int		bladehpi_status(StonithPlugin *);
 static int		bladehpi_reset_req(StonithPlugin *, int, const char *);
 static char **		bladehpi_hostlist(StonithPlugin *);
@@ -333,7 +333,7 @@ done:
 }
 
 
-static const char **     
+static const char * const *
 bladehpi_get_confignames(StonithPlugin *s)
 {
 	static const char *	names[] = {ST_ENTITYROOT, NULL};
diff --git a/lib/plugins/stonith/cyclades.c b/lib/plugins/stonith/cyclades.c
index e765b82..77250ea 100644
--- a/lib/plugins/stonith/cyclades.c
+++ b/lib/plugins/stonith/cyclades.c
@@ -45,7 +45,7 @@
 static StonithPlugin *	cyclades_new(const char *);
 static void		cyclades_destroy(StonithPlugin *);
 static int		cyclades_set_config(StonithPlugin *, StonithNVpair *);
-static const char **	cyclades_get_confignames(StonithPlugin * s);
+static const char * const *	cyclades_get_confignames(StonithPlugin * s);
 static const char *	cyclades_get_info(StonithPlugin * s, int InfoType);
 static int		cyclades_status(StonithPlugin *);
 static int		cyclades_reset_req(StonithPlugin * s, int request, const char * host);
@@ -523,7 +523,7 @@ cyclades_reset_req(StonithPlugin * s, int request, const char * host)
 	return rc;
 }
 
-static const char **
+static const char * const *
 cyclades_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_IPADDR, ST_LOGIN, ST_SERIALPORT, NULL};
diff --git a/lib/plugins/stonith/drac3.c b/lib/plugins/stonith/drac3.c
index a984e4d..5907e29 100644
--- a/lib/plugins/stonith/drac3.c
+++ b/lib/plugins/stonith/drac3.c
@@ -39,7 +39,7 @@
 
 static StonithPlugin *	drac3_new(const char *);
 static void	drac3_destroy(StonithPlugin *);
-static const char ** drac3_get_confignames(StonithPlugin *);
+static const char * const * drac3_get_confignames(StonithPlugin *);
 static int	drac3_set_config(StonithPlugin *, StonithNVpair *);
 static const char * drac3_getinfo(StonithPlugin * s, int InfoType);
 static int	drac3_status(StonithPlugin * );
@@ -191,7 +191,7 @@ drac3_destroy(StonithPlugin * s)
 }
 
 /* ------------------------------------------------------------------ */
-static const char **
+static const char * const *
 drac3_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_HOST, ST_LOGIN, ST_PASSWD, NULL};
diff --git a/lib/plugins/stonith/external.c b/lib/plugins/stonith/external.c
index e991976..d3f26a9 100644
--- a/lib/plugins/stonith/external.c
+++ b/lib/plugins/stonith/external.c
@@ -46,7 +46,7 @@
 static StonithPlugin *	external_new(const char *);
 static void		external_destroy(StonithPlugin *);
 static int		external_set_config(StonithPlugin *, StonithNVpair *);
-static const char**	external_get_confignames(StonithPlugin *);
+static const char * const *	external_get_confignames(StonithPlugin *);
 static const char *	external_getinfo(StonithPlugin * s, int InfoType);
 static int		external_status(StonithPlugin * );
 static int		external_reset_req(StonithPlugin * s, int request, const char * host);
@@ -461,7 +461,7 @@ exec_select(const struct dirent *dire)
 /*
  * Return STONITH config vars
  */
-static const char**
+static const char * const *
 external_get_confignames(StonithPlugin* p)
 {
   	struct pluginDevice *	sd;
@@ -544,7 +544,7 @@ external_get_confignames(StonithPlugin* p)
 		sd->confignames[dircount] = NULL;
 	}
 
-	return (const char **)sd->confignames;
+	return (const char * const *)sd->confignames;
 }
 
 /*
diff --git a/lib/plugins/stonith/external/ipmi b/lib/plugins/stonith/external/ipmi
index b7832f3..9dc5b3b 100644
--- a/lib/plugins/stonith/external/ipmi
+++ b/lib/plugins/stonith/external/ipmi
@@ -36,7 +36,7 @@ RESET="power reset"
 POWEROFF="power off"
 POWERON="power on"
 STATUS="power status"
-IPMITOOL=`which ipmitool 2>/dev/null`
+IPMITOOL=${ipmitool:-"`which ipmitool 2>/dev/null`}
 
 have_ipmi() {
 	test -x "${IPMITOOL}"
@@ -237,6 +237,16 @@ IPMI interface to use, such as "lan" or "lanplus".
 </longdesc>
 </parameter>
 
+<parameter name="ipmitool" unique="0">
+<content type="string" default=""/>
+<shortdesc lang="en">
+IPMI command(ipmitool) 
+</shortdesc>
+<longdesc lang="en">
+Specify the full path to IPMI command.
+</longdesc>
+</parameter>
+
 </parameters>
 IPMIXML
 	exit 0
diff --git a/lib/plugins/stonith/external/vcenter b/lib/plugins/stonith/external/vcenter
index 5c1afb9..9c7d962 100755
--- a/lib/plugins/stonith/external/vcenter
+++ b/lib/plugins/stonith/external/vcenter
@@ -114,7 +114,8 @@ Allowed values: 0, 1
 # Command belongs to the group of commands that require connecting to VMware vCenter
 elsif ($command ~~ @netCommands) {
 
-	use VMware::VIRuntime;
+	eval { require VMware::VIRuntime; }
+	or dielog("Missing perl module VMware::VIRuntime. Download and install 'VMware Infrastructure (VI) Perl Toolkit', available at http://www.vmware.com/support/developer/viperltoolkit/ \n");
 
 	# A valid VI_CREDSTORE is required to avoid interactive prompt
 	( exists $ENV{'VI_CREDSTORE'} ) || dielog("VI_CREDSTORE not specified\n");
diff --git a/lib/plugins/stonith/ibmhmc.c b/lib/plugins/stonith/ibmhmc.c
index 2aa8422..28c2ca3 100644
--- a/lib/plugins/stonith/ibmhmc.c
+++ b/lib/plugins/stonith/ibmhmc.c
@@ -131,7 +131,7 @@
 static StonithPlugin *	ibmhmc_new(const char *);
 static void		ibmhmc_destroy(StonithPlugin *);
 static const char *	ibmhmc_getinfo(StonithPlugin * s, int InfoType);
-static const char**	ibmhmc_get_confignames(StonithPlugin* p);
+static const char * const *	ibmhmc_get_confignames(StonithPlugin* p);
 static int		ibmhmc_status(StonithPlugin * );
 static int		ibmhmc_reset_req(StonithPlugin * s,int request,const char* host);
 static char **		ibmhmc_hostlist(StonithPlugin  *);
@@ -318,7 +318,7 @@ ibmhmc_hostlist(StonithPlugin  *s)
 }
 
 
-static const char**     
+static const char * const *
 ibmhmc_get_confignames(StonithPlugin* p)
 {
 	static const char * names[] = {ST_IPADDR, NULL};
diff --git a/lib/plugins/stonith/ipmilan.c b/lib/plugins/stonith/ipmilan.c
index f4e2ea3..444c3bf 100644
--- a/lib/plugins/stonith/ipmilan.c
+++ b/lib/plugins/stonith/ipmilan.c
@@ -46,7 +46,7 @@
 
 static StonithPlugin *	ipmilan_new(const char *);
 static void		ipmilan_destroy(StonithPlugin *);
-static const char **	ipmilan_get_confignames(StonithPlugin *);
+static const char * const *	ipmilan_get_confignames(StonithPlugin *);
 static int		ipmilan_set_config(StonithPlugin *, StonithNVpair *);
 static const char *	ipmilan_getinfo(StonithPlugin * s, int InfoType);
 static int		ipmilan_status(StonithPlugin * );
@@ -379,7 +379,7 @@ ipmilan_reset_req(StonithPlugin * s, int request, const char * host)
 /*
  *	Get configuration parameter names
  */
-static const char **
+static const char * const *
 ipmilan_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = 
diff --git a/lib/plugins/stonith/meatware.c b/lib/plugins/stonith/meatware.c
index 8547541..96539ba 100644
--- a/lib/plugins/stonith/meatware.c
+++ b/lib/plugins/stonith/meatware.c
@@ -40,7 +40,7 @@
 static StonithPlugin *	meatware_new(const char *);
 static void		meatware_destroy(StonithPlugin *);
 static int		meatware_set_config(StonithPlugin *, StonithNVpair *);
-static const char**	meatware_get_confignames(StonithPlugin *);
+static const char * const *	meatware_get_confignames(StonithPlugin *);
 static const char *	meatware_getinfo(StonithPlugin * s, int InfoType);
 static int		meatware_status(StonithPlugin * );
 static int		meatware_reset_req(StonithPlugin * s, int request, const char * host);
@@ -136,7 +136,7 @@ meatware_hostlist(StonithPlugin  *s)
 		return(NULL);
 	}
 
-	return OurImports->CopyHostList((const char **)nd->hostlist);
+	return OurImports->CopyHostList((const char * const *)nd->hostlist);
 }
 
 /*
@@ -265,7 +265,7 @@ meatware_set_config(StonithPlugin* s, StonithNVpair *list)
 /*
  * Return STONITH config vars
  */
-static const char**
+static const char * const *
 meatware_get_confignames(StonithPlugin* p)
 {
 	static const char *	MeatwareParams[] = {ST_HOSTLIST, NULL };
diff --git a/lib/plugins/stonith/null.c b/lib/plugins/stonith/null.c
index 09dccaa..0d351fa 100644
--- a/lib/plugins/stonith/null.c
+++ b/lib/plugins/stonith/null.c
@@ -42,7 +42,7 @@ static StonithPlugin*	null_new(const char *);
 static void		null_destroy(StonithPlugin *);
 static int		null_set_config(StonithPlugin*
 ,				StonithNVpair*);
-static const char**	null_get_confignames(StonithPlugin*);
+static const char * const *	null_get_confignames(StonithPlugin*);
 static const char *	null_getinfo(StonithPlugin * s, int InfoType);
 static int		null_status(StonithPlugin * );
 static int		null_reset_req(StonithPlugin * s
@@ -126,7 +126,7 @@ null_hostlist(StonithPlugin  *s)
 	struct pluginDevice*	nd = (struct pluginDevice*)s;
 
 	ERRIFWRONGDEV(s, NULL);
-	return OurImports->CopyHostList((const char**)nd->hostlist);
+	return OurImports->CopyHostList((const char * const *)nd->hostlist);
 }
 
 
@@ -148,7 +148,7 @@ null_reset_req(StonithPlugin * s, int request, const char * host)
 }
 
 
-static const char**
+static const char * const *
 null_get_confignames(StonithPlugin* p)
 {
 	static const char *	NullParams[] = {ST_HOSTLIST, NULL };
diff --git a/lib/plugins/stonith/nw_rpc100s.c b/lib/plugins/stonith/nw_rpc100s.c
index 5b7b2df..c98d57c 100644
--- a/lib/plugins/stonith/nw_rpc100s.c
+++ b/lib/plugins/stonith/nw_rpc100s.c
@@ -40,7 +40,7 @@
 static StonithPlugin *	nw_rpc100s_new(const char *);
 static void		nw_rpc100s_destroy(StonithPlugin *);
 static int		nw_rpc100s_set_config(StonithPlugin *, StonithNVpair *);
-static const char**	nw_rpc100s_get_confignames(StonithPlugin *);
+static const char * const *	nw_rpc100s_get_confignames(StonithPlugin *);
 static const char *	nw_rpc100s_getinfo(StonithPlugin * s, int InfoType);
 static int		nw_rpc100s_status(StonithPlugin * );
 static int		nw_rpc100s_reset_req(StonithPlugin * s, int request, const char * host);
@@ -678,7 +678,7 @@ nw_rpc100s_set_config(StonithPlugin* s, StonithNVpair *list)
 /*
  * Return STONITH config vars
  */
-static const char **
+static const char * const *
 nw_rpc100s_get_confignames(StonithPlugin* p)
 {
 	static const char *	RpcParams[] = {ST_TTYDEV , ST_HOSTLIST, NULL };
diff --git a/lib/plugins/stonith/rcd_serial.c b/lib/plugins/stonith/rcd_serial.c
index 43426ce..e46df87 100644
--- a/lib/plugins/stonith/rcd_serial.c
+++ b/lib/plugins/stonith/rcd_serial.c
@@ -54,7 +54,7 @@
 static StonithPlugin*	rcd_serial_new(const char *);
 static void		rcd_serial_destroy(StonithPlugin *);
 static int		rcd_serial_set_config(StonithPlugin *, StonithNVpair *);
-static const char **	rcd_serial_get_confignames(StonithPlugin *);
+static const char * const *	rcd_serial_get_confignames(StonithPlugin *);
 static const char *	rcd_serial_getinfo(StonithPlugin * s, int InfoType);
 static int		rcd_serial_status(StonithPlugin * );
 static int		rcd_serial_reset_req(StonithPlugin * s, int request, const char * host);
@@ -347,7 +347,7 @@ rcd_serial_hostlist(StonithPlugin  *s)
 		return(NULL);
 	}
 
-	return OurImports->CopyHostList((const char **)rcd->hostlist);
+	return OurImports->CopyHostList((const char * const *)rcd->hostlist);
 }
 
 /*
@@ -497,7 +497,7 @@ rcd_serial_set_config(StonithPlugin* s, StonithNVpair *list)
 /*
  * Return STONITH config vars
  */
-static const char**
+static const char * const *
 rcd_serial_get_confignames(StonithPlugin* p)
 {
 	static const char *	RcdParams[] = {ST_HOSTLIST, ST_TTYDEV
diff --git a/lib/plugins/stonith/rhcs.c b/lib/plugins/stonith/rhcs.c
index 7b9c6d5..f499465 100644
--- a/lib/plugins/stonith/rhcs.c
+++ b/lib/plugins/stonith/rhcs.c
@@ -53,7 +53,7 @@
 static StonithPlugin *	rhcs_new(const char *);
 static void		rhcs_destroy(StonithPlugin *);
 static int		rhcs_set_config(StonithPlugin *, StonithNVpair *);
-static const char**	rhcs_get_confignames(StonithPlugin *);
+static const char * const *	rhcs_get_confignames(StonithPlugin *);
 static const char *	rhcs_getinfo(StonithPlugin * s, int InfoType);
 static int		rhcs_status(StonithPlugin * );
 static int		rhcs_reset_req(StonithPlugin * s, int request, const char * host);
@@ -557,7 +557,7 @@ static int
 load_confignames(xmlNodeSet *nodes, struct pluginDevice *sd)
 {
 	xmlChar *attr;
-	const char **skip;
+	const char * const*skip;
 	xmlNode *cur;
 	int i, j, namecount;
 
@@ -659,7 +659,7 @@ err:
 /*
  * Return STONITH config vars
  */
-static const char**
+static const char * const *
 rhcs_get_confignames(StonithPlugin* p)
 {
   	struct pluginDevice *	sd;
@@ -703,7 +703,7 @@ rhcs_get_confignames(StonithPlugin* p)
 		sd->confignames[dircount] = NULL;
 	}
 
-	return (const char **)sd->confignames;
+	return (const char * const *)sd->confignames;
 }
 
 /*
diff --git a/lib/plugins/stonith/riloe.c b/lib/plugins/stonith/riloe.c
index e8e69c8..b9fc0f0 100644
--- a/lib/plugins/stonith/riloe.c
+++ b/lib/plugins/stonith/riloe.c
@@ -33,7 +33,7 @@
 static StonithPlugin *	riloe_new(const char *);
 static void		riloe_destroy(StonithPlugin *);
 static int		riloe_set_config(StonithPlugin *, StonithNVpair *);
-static const char **	riloe_get_confignames(StonithPlugin * );
+static const char * const *	riloe_get_confignames(StonithPlugin * );
 static const char *	riloe_getinfo(StonithPlugin * s, int InfoType);
 static int		riloe_status(StonithPlugin * );
 static int		riloe_reset_req(StonithPlugin * s, int request, const char * host);
@@ -140,7 +140,7 @@ riloe_hostlist(StonithPlugin  *s)
 		return(NULL);
 	}
 
-	return OurImports->CopyHostList((const char **)nd->hostlist);
+	return OurImports->CopyHostList((const char * const*)nd->hostlist);
 }
 
 /*
@@ -236,7 +236,7 @@ riloe_set_config(StonithPlugin* s, StonithNVpair *list)
 /*
  *  Return the  Stonith plugin configuration parameter
  */
-static const char**
+static const char* const *
 riloe_get_confignames(StonithPlugin* p)
 {
 	static const char *	RiloeParams[] = {ST_HOSTLIST, NULL };
diff --git a/lib/plugins/stonith/rps10.c b/lib/plugins/stonith/rps10.c
index ec47ce5..021449a 100644
--- a/lib/plugins/stonith/rps10.c
+++ b/lib/plugins/stonith/rps10.c
@@ -43,7 +43,7 @@
 static StonithPlugin *	rps10_new(const char *);
 static void		rps10_destroy(StonithPlugin *);
 static int		rps10_set_config(StonithPlugin *, StonithNVpair *);
-static const char**	rps10_get_confignames(StonithPlugin *);
+static const char * const *	rps10_get_confignames(StonithPlugin *);
 static const char *	rps10_getinfo(StonithPlugin * s, int InfoType);
 static int		rps10_status(StonithPlugin * );
 static int		rps10_reset_req(StonithPlugin * s, int request, const char * host);
@@ -948,7 +948,7 @@ rps10_set_config(StonithPlugin* s, StonithNVpair* list)
  *  Return the Stonith plugin configuration parameter 
  *
  */
-static const char**
+static const char * const *
 rps10_get_confignames(StonithPlugin* p)
 {
 	static const char *	Rps10Params[] = {ST_RPS10 ,NULL };
diff --git a/lib/plugins/stonith/ssh.c b/lib/plugins/stonith/ssh.c
index 8f8bf6d..a42d2c8 100644
--- a/lib/plugins/stonith/ssh.c
+++ b/lib/plugins/stonith/ssh.c
@@ -36,7 +36,7 @@
 
 static StonithPlugin *	ssh_new(const char *);
 static void		ssh_destroy(StonithPlugin *);
-static const char**	ssh_get_confignames(StonithPlugin *);
+static const char * const *	ssh_get_confignames(StonithPlugin *);
 static int		ssh_set_config(StonithPlugin *, StonithNVpair*);
 static const char *	ssh_get_info(StonithPlugin * s, int InfoType);
 static int		ssh_status(StonithPlugin * );
@@ -161,7 +161,7 @@ ssh_hostlist(StonithPlugin  *s)
 		return(NULL);
 	}
 
-	return OurImports->CopyHostList((const char **)sd->hostlist);
+	return OurImports->CopyHostList((const char * const *)sd->hostlist);
 }
 
 
@@ -234,7 +234,7 @@ ssh_reset_req(StonithPlugin * s, int request, const char * host)
 	}
 }
 
-static const char**
+static const char * const *
 ssh_get_confignames(StonithPlugin* p)
 {
 	static const char *	SshParams[] = {ST_HOSTLIST, NULL };
diff --git a/lib/plugins/stonith/suicide.c b/lib/plugins/stonith/suicide.c
index 3b4ed4c..9d1b3ea 100644
--- a/lib/plugins/stonith/suicide.c
+++ b/lib/plugins/stonith/suicide.c
@@ -34,7 +34,7 @@
 
 static StonithPlugin *	suicide_new(const char *);
 static void		suicide_destroy(StonithPlugin *);
-static const char**	suicide_get_confignames(StonithPlugin *);
+static const char * const *	suicide_get_confignames(StonithPlugin *);
 static int		suicide_set_config(StonithPlugin *, StonithNVpair*);
 static const char *	suicide_get_info(StonithPlugin * s, int InfoType);
 static int		suicide_status(StonithPlugin * );
@@ -189,7 +189,7 @@ suicide_reset_req(StonithPlugin * s, int request, const char * host)
 	}
 }
 
-static const char**
+static const char * const *
 suicide_get_confignames(StonithPlugin* p)
 {
 	/* Donnot need to initialize from external. */
diff --git a/lib/plugins/stonith/vacm.c b/lib/plugins/stonith/vacm.c
index af12f26..4023cf2 100644
--- a/lib/plugins/stonith/vacm.c
+++ b/lib/plugins/stonith/vacm.c
@@ -59,7 +59,7 @@
 
 static StonithPlugin *	vacm_new(const char *);
 static void		vacm_destroy(StonithPlugin *);
-static const char **	vacm_get_confignames(StonithPlugin *);
+static const char * const *	vacm_get_confignames(StonithPlugin *);
 static int		vacm_set_config(StonithPlugin *, StonithNVpair *);
 static const char *	vacm_getinfo(StonithPlugin * s, int InfoType);
 static int		vacm_status(StonithPlugin * );
@@ -339,7 +339,7 @@ vacm_reset_req(StonithPlugin *s, int request, const char *host)
 }
 
 /* list => "nexxus:username:password" */
-static const char **
+static const char * const *
 vacm_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_NEXXUS, ST_LOGIN, ST_PASSWD, NULL};
diff --git a/lib/plugins/stonith/wti_mpc.c b/lib/plugins/stonith/wti_mpc.c
index be1f227..b263b55 100644
--- a/lib/plugins/stonith/wti_mpc.c
+++ b/lib/plugins/stonith/wti_mpc.c
@@ -77,7 +77,7 @@
 
 static StonithPlugin *	wti_mpc_new(const char *);
 static void	wti_mpc_destroy(StonithPlugin *);
-static const char **	wti_mpc_get_confignames(StonithPlugin *);
+static const char * const *	wti_mpc_get_confignames(StonithPlugin *);
 static int	wti_mpc_set_config(StonithPlugin *, StonithNVpair *);
 static const char *	wti_mpc_getinfo(StonithPlugin * s, int InfoType);
 static int	wti_mpc_status(StonithPlugin * );
@@ -636,7 +636,7 @@ wti_mpc_reset_req(StonithPlugin * s, int request, const char *host)
  * Get the configuration parameter names.
  */
 
-static const char **
+static const char * const *
 wti_mpc_get_confignames(StonithPlugin * s)
 {
 	static const char * ret[] = {ST_IPADDR, ST_PORT, ST_COMMUNITY, ST_MIBVERSION, NULL};
diff --git a/lib/plugins/stonith/wti_nps.c b/lib/plugins/stonith/wti_nps.c
index 4fb3821..aa98e61 100644
--- a/lib/plugins/stonith/wti_nps.c
+++ b/lib/plugins/stonith/wti_nps.c
@@ -78,7 +78,7 @@
 
 static StonithPlugin *	wti_nps_new(const char *);
 static void		wti_nps_destroy(StonithPlugin *);
-static const char**	wti_nps_get_confignames(StonithPlugin *);
+static const char * const *	wti_nps_get_confignames(StonithPlugin *);
 static int		wti_nps_set_config(StonithPlugin * , StonithNVpair * );
 static const char *	wti_nps_get_info(StonithPlugin * s, int InfoType);
 static int		wti_nps_status(StonithPlugin * );
@@ -689,7 +689,7 @@ wti_nps_set_config(StonithPlugin * s, StonithNVpair *list)
  * Return the Stonith plugin configuration parameter 
  *
  */
-static const char**
+static const char * const *
 wti_nps_get_confignames(StonithPlugin * p)
 {
 	static	const char * names[] =  { ST_IPADDR , ST_PASSWD , NULL};
diff --git a/lib/stonith/expect.c b/lib/stonith/expect.c
index 53b8b17..c76e6e5 100644
--- a/lib/stonith/expect.c
+++ b/lib/stonith/expect.c
@@ -335,10 +335,10 @@ StartProcess(const char * cmd, int * readfd, int * writefd)
 }
 
 static char **
-stonith_copy_hostlist(const char** hostlist)
+stonith_copy_hostlist(const char * const * hostlist)
 {
 	int hlleng = 1;
-	const char ** here = hostlist;
+	const char * const * here = hostlist;
 	char ** hret;
 	char **	ret;
 
diff --git a/lib/stonith/ha_log.sh b/lib/stonith/ha_log.sh
index 3f52c2c..26a2a27 100755
--- a/lib/stonith/ha_log.sh
+++ b/lib/stonith/ha_log.sh
@@ -2,7 +2,7 @@
 #
 #
 # 	ha_log.sh for stonith external plugins
-#	(equivalent to ocf_log in .ocf-shellfuncs in resource-agents)
+#	(equivalent to ocf_log in ocf-shellfuncs in resource-agents)
 #
 # Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Brée
 #                    All Rights Reserved.
diff --git a/lib/stonith/main.c b/lib/stonith/main.c
index 0365009..e76c061 100644
--- a/lib/stonith/main.c
+++ b/lib/stonith/main.c
@@ -191,7 +191,7 @@ confhelp(const char * cmd, FILE* stream, const char * devtype)
 	for(this=typelist; *this && !devfound; ++this) {
 		const char *    SwitchType = *this;
 		const char *	cres;
-		const char **	pnames;
+		const char * const *	pnames;
 
 
 		if ((s = stonith_new(SwitchType)) == NULL) {
@@ -318,7 +318,7 @@ print_types()
 void
 print_confignames(Stonith *s)
 {
-	const char**	names;
+	const char * const *	names;
 	int		i;
 
 	names = stonith_get_confignames(s);
@@ -572,7 +572,7 @@ main(int argc, char** argv)
 
 	if (!listparanames && !metadata && optfile == NULL &&
 			parameters == NULL && !params_from_env && nvcount == 0) {
-		const char**	names;
+		const char * const *	names;
 		int		needs_parms = 1;
 
 		if (s != NULL && (names = stonith_get_confignames(s)) != NULL && names[0] == NULL) {
@@ -654,7 +654,7 @@ main(int argc, char** argv)
 		 *	Configure STONITH device using cmdline arguments...
 		 */
 		if ((rc = stonith_set_config(s, nvargs)) != S_OK) {
-			const char**	names;
+			const char * const *	names;
 			int		j;
 			fprintf(stderr
 			,	"Invalid config info for %s device\n"
diff --git a/lib/stonith/stonith.c b/lib/stonith/stonith.c
index eb88c78..bd158a2 100644
--- a/lib/stonith/stonith.c
+++ b/lib/stonith/stonith.c
@@ -166,7 +166,8 @@ static char **
 get_plugin_list(const char *pltype)
 {
 	char **	typelist = NULL;
-	const char **extPI, **p;
+	const char * const *extPI;
+	const char * const *p;
 	int numextPI, i;
 	Stonith * ext;
 
@@ -185,9 +186,6 @@ get_plugin_list(const char *pltype)
 	/* count the external plugins */
 	for (numextPI = 0, p = extPI; *p; p++, numextPI++);
 
-	/* sort the external plugins */
-	qsort(extPI, numextPI, sizeof(char *), qsort_string_cmp);
-
 	typelist = (char **)
 		MALLOC((numextPI+1)*sizeof(char *));
 	if (typelist == NULL) {
@@ -213,6 +211,10 @@ get_plugin_list(const char *pltype)
 	}
 
 	stonith_delete(ext);
+
+	/* sort the list of plugin names */
+	qsort(typelist, numextPI, sizeof(char *), qsort_string_cmp);
+
 	return typelist;
 err:
 	stonith_free_hostlist(typelist);
@@ -303,7 +305,7 @@ stonith_delete(Stonith *s)
 	}
 }
 
-const char **
+const char * const *
 stonith_get_confignames(Stonith* s)
 {
 	StonithPlugin*	sp = (StonithPlugin*)s;
@@ -471,7 +473,7 @@ stonith1_compat_string_to_NVpair(Stonith* s, const char * str)
 	 * Everything after the last delimiter is passed along as part of
 	 * the final argument - white space and all...
 	 */
-	const char **	config_names;
+	const char * const *	config_names;
 	int		n_names;
 	int		j;
 	const char *	delims = " \t\n\r\f";
@@ -521,7 +523,7 @@ StonithNVpair*
 stonith_env_to_NVpair(Stonith* s)
 {
 	/* Read the config names values from the environment */
-	const char **	config_names;
+	const char * const *	config_names;
 	int		n_names;
 	int		j;
 	StonithNVpair*	ret;
diff --git a/logd/ha_logd.c b/logd/ha_logd.c
index 6ff3d64..06cdd6e 100644
--- a/logd/ha_logd.c
+++ b/logd/ha_logd.c
@@ -138,11 +138,10 @@ logd_log( const char * fmt, ...)
 {
 	char		buf[MAXLINE];
 	va_list		ap;
-	int		nbytes;
 	
 	buf[MAXLINE-1] = EOS;
 	va_start(ap, fmt);
-	nbytes=vsnprintf(buf, sizeof(buf)-1, fmt, ap);
+	vsnprintf(buf, sizeof(buf)-1, fmt, ap);
 	va_end(ap);
 	
 	fprintf(stderr, "%s", buf);
diff --git a/lrm/admin/cibsecret.in b/lrm/admin/cibsecret.in
index 8994667..5255cdd 100755
--- a/lrm/admin/cibsecret.in
+++ b/lrm/admin/cibsecret.in
@@ -31,7 +31,7 @@
 # NB: this program depends on utillib.sh
 #
 
-. @OCF_ROOT_DIR@/resource.d/heartbeat/.ocf-shellfuncs
+. @OCF_ROOT_DIR@/lib/heartbeat/ocf-shellfuncs
 
 HA_NOARCHBIN=@datadir@/@PACKAGE_NAME@
 
@@ -40,6 +40,7 @@ HA_NOARCHBIN=@datadir@/@PACKAGE_NAME@
 LRM_CIBSECRETS=$HA_VARLIB/lrm/secrets
 
 PROG=`basename $0`
+SSH_OPTS="-o StrictHostKeyChecking=no"
 
 usage() {
 	cat<<EOF
@@ -126,29 +127,31 @@ check_down_nodes() {
 }
 
 pssh_fun() {
-	pssh -q -H "$nodes" $*
+	pssh -qi -H "$nodes" -x "$SSH_OPTS" $*
 }
 pscp_fun() {
-	pscp -q -H "$nodes" -x "-pr" $*
+	pscp -q -H "$nodes" -x "-pr" -x "$SSH_OPTS" $*
 }
 pdsh_fun() {
 	local pdsh_nodes=`echo $nodes | tr ' ' ','`
+	export PDSH_SSH_ARGS_APPEND="$SSH_OPTS"
 	pdsh -w $pdsh_nodes $*
 }
 pdcp_fun() {
 	local pdsh_nodes=`echo $nodes | tr ' ' ','`
+	export PDSH_SSH_ARGS_APPEND="$SSH_OPTS"
 	pdcp -pr -w $pdsh_nodes $*
 }
 ssh_fun() {
 	local h
 	for h in $nodes; do
-		ssh $h $*
+		ssh $SSH_OPTS $h $* || return
 	done
 }
 scp_fun() {
 	local h src="$1" dest=$2
 	for h in $nodes; do
-		scp -pr -q $src $h:$dest
+		scp -pr -q $SSH_OPTS $src $h:$dest || return
 	done
 }
 # TODO: this procedure should be replaced with csync2
@@ -162,9 +165,9 @@ sync_files() {
 		return
 	}
 	info "syncing $LRM_CIBSECRETS to `echo $nodes` ..."
-	$rsh rm -rf $LRM_CIBSECRETS
-	$rsh mkdir -p `dirname $LRM_CIBSECRETS`
-	$rcp $LRM_CIBSECRETS `dirname $LRM_CIBSECRETS`
+	$rsh rm -rf $LRM_CIBSECRETS &&
+		$rsh mkdir -p `dirname $LRM_CIBSECRETS` &&
+		$rcp $LRM_CIBSECRETS `dirname $LRM_CIBSECRETS`
 }
 sync_one() {
 	local f=$1 f_all="$1 $1.sign"
@@ -176,12 +179,12 @@ sync_one() {
 		return
 	}
 	info "syncing $f to `echo $nodes` ..."
-	$rsh mkdir -p `dirname $f`
-	if [ -f "$f" ]; then
-		$rcp "$f_all" `dirname $f`
-	else
-		$rsh rm -f $f_all
-	fi
+	$rsh mkdir -p `dirname $f` &&
+		if [ -f "$f" ]; then
+			$rcp "$f_all" `dirname $f`
+		else
+			$rsh rm -f $f_all
+		fi
 }
 
 is_secret() {
@@ -260,7 +263,7 @@ cibsecret_set() {
 	local value=$1
 
 	if [ -z "$NO_CRM" ]; then
-		[ "$current" -a "$current" != "$value" ] &&
+		[ "$current" -a "$current" != "$MAGIC" -a "$current" != "$value" ] &&
 			fatal "CIB value <$current> different for $rsc parameter $param; please delete it first"
 	fi
 	set_local_param $rsc $param $value &&
@@ -270,7 +273,7 @@ cibsecret_set() {
 cibsecret_check() {
 	local md5sum local_md5sum
 	is_secret "$current" ||
-		fatal "no magic in CIB for resource $rsc parameter $param"
+		fatal "resource $rsc parameter $param not set as secret, nothing to check"
 	local_md5sum=`localfiles getsum $rsc $param`
 	[ "$local_md5sum" ] ||
 		fatal "no MD5 hash for resource $rsc parameter $param"
@@ -295,7 +298,7 @@ cibsecret_stash() {
 	[ "$current" = "" ] &&
 		fatal "nothing to stash for resource $rsc parameter $param"
 	is_secret "$current" &&
-		fatal "CIB value for resource $rsc parameter $param already MD5 hash"
+		fatal "resource $rsc parameter $param already set as secret, nothing to stash"
 	cibsecret_set "$current"
 }
 
@@ -305,7 +308,7 @@ cibsecret_unstash() {
 	[ "$current_local" = "" ] &&
 		fatal "nothing to unstash for resource $rsc parameter $param"
 	is_secret "$current" ||
-		warn "no MD5 hash in CIB for resource $rsc parameter $param, proceeding anyway"
+		warn "resource $rsc parameter $param not set as secret, but we have local value so proceeding anyway"
 	remove_local_param $rsc $param &&
 	set_cib_param $rsc $param $current_local
 }
diff --git a/lrm/test/apitest.c b/lrm/test/apitest.c
index 26367dd..0d4c572 100644
--- a/lrm/test/apitest.c
+++ b/lrm/test/apitest.c
@@ -44,7 +44,6 @@ int main (int argc, char* argv[])
 	lrm_op_t* op = NULL;
 	const char* rid = "ip248";
 	GHashTable* param = NULL;
-	int call_id;
 	GList* classes;
 	int i;
 	
@@ -104,7 +103,7 @@ int main (int argc, char* argv[])
 	op->user_data_len = strlen(op->user_data)+1;
 	op->interval = 1000;
 	op->target_rc=EVERYTIME;
-	call_id = rsc->ops->perform_op(rsc,op);
+	rsc->ops->perform_op(rsc,op);
 	printf_op(op);
 	lrm_free_op(op);
 
@@ -142,7 +141,7 @@ int main (int argc, char* argv[])
 	op->user_data_len = strlen(op->user_data)+1;
 	op->interval = 2000;
 	op->target_rc=EVERYTIME;
-	call_id = rsc->ops->perform_op(rsc,op);
+	rsc->ops->perform_op(rsc,op);
 	printf_op(op);
 	lrm_free_op(op);
 
@@ -180,7 +179,7 @@ int main (int argc, char* argv[])
 	op->user_data_len = strlen(op->user_data)+1;
 	op->interval = 3000;
 	op->target_rc=EVERYTIME;
-	call_id = rsc->ops->perform_op(rsc,op);
+	rsc->ops->perform_op(rsc,op);
 	printf_op(op);
 	lrm_free_op(op);
 
diff --git a/lrm/test/callbacktest.c b/lrm/test/callbacktest.c
index 63792b9..48f4d49 100644
--- a/lrm/test/callbacktest.c
+++ b/lrm/test/callbacktest.c
@@ -44,7 +44,6 @@ main(int argc, char *argv[])
 	lrm_op_t* op = NULL;
 	const char* rid = "ip248";
 	GHashTable* param = NULL;
-	int call_id;
 
 	lrm = ll_lrm_new("lrm");
 
@@ -94,7 +93,7 @@ main(int argc, char *argv[])
 	op->user_data_len = strlen(op->user_data)+1;
 	op->interval = 1000;
 	op->target_rc=EVERYTIME;
-	call_id = rsc->ops->perform_op(rsc,op);
+	rsc->ops->perform_op(rsc,op);
 	printf_op(op);
 
 	puts("perform_op(stop)...");
diff --git a/lrm/test/lrmregtest.in b/lrm/test/lrmregtest.in
index b9a367b..001a662 100644
--- a/lrm/test/lrmregtest.in
+++ b/lrm/test/lrmregtest.in
@@ -35,7 +35,7 @@
 #######################################################################
 # Initialization:
 
-. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
+. ${OCF_ROOT}/lib/heartbeat/ocf-shellfuncs
 
 #######################################################################
 
diff --git a/lrm/test/regression.sh.in b/lrm/test/regression.sh.in
index 523bd40..94d8488 100755
--- a/lrm/test/regression.sh.in
+++ b/lrm/test/regression.sh.in
@@ -93,7 +93,7 @@ HA_logfacility=""
 export HA_logfile HA_debugfile HA_use_logd HA_logfacility
 
 mkdir -p $OUTDIR
-. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
+. ${OCF_ROOT}/lib/heartbeat/ocf-shellfuncs
 
 args=`getopt hq $*`
 [ $? -ne 0 ] && usage

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/cluster-glue.git



More information about the Debian-HA-Commits mailing list