File suse.diff of Package openais

Index: openais/conf/openais.conf
===================================================================
--- openais.orig/conf/openais.conf
+++ openais/conf/openais.conf
@@ -1,22 +1,70 @@
 # Please read the openais.conf.5 manual page
 
+aisexec {
+	# Run as root - this is necessary to be able to manage resources with Pacemaker
+	user:	root
+	group:	root
+}
+
+service {
+	# Load the Pacemaker Cluster Resource Manager
+	ver:       0
+	name:      pacemaker
+	use_mgmtd: yes
+}
+
 totem {
 	version: 2
-	secauth: off
-	threads: 0
+
+	# How long before declaring a token lost (ms)
+	token:          5000
+
+	# How many token retransmits before forming a new configuration
+	token_retransmits_before_loss_const: 10
+
+	# How long to wait for join messages in the membership protocol (ms)
+	join:           2000
+
+	# How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
+	consensus:      2500
+
+	# Turn off the virtual synchrony filter
+	vsftype:        none
+
+	# Number of messages that may be sent by one processor on receipt of the token
+	max_messages:   20
+
+	# Stagger sending the node join messages by 1..send_join ms
+	send_join: 45
+
+	# Limit generated nodeids to 31-bits (positive signed integers)
+	clear_node_high_bit: yes
+
+	# Disable encryption
+	secauth:	off
+
+	# How many threads to use for encryption/decryption
+	threads:   	0
+
+	# Optionally assign a fixed node id (integer)
+	# nodeid:         1234
+
 	interface {
 		ringnumber: 0
-		bindnetaddr: 192.168.2.0
-		mcastaddr: 226.94.1.1
-		mcastport: 5405
+
+		# The following values need to be set based on your environment
+		#bindnetaddr: 192.168.2.0
+		#mcastaddr: 226.94.1.1
+		#mcastport: 5405
 	}
 }
 
 logging {
-	to_stderr: yes
-	to_file: yes
-	logfile: /tmp/ais
 	debug: off
+	fileline: off
+	to_syslog: yes
+	to_stderr: off
+	syslog_facility: daemon
 	timestamp: on
 }
 
Index: openais/exec/clm.c
===================================================================
--- openais.orig/exec/clm.c
+++ openais/exec/clm.c
@@ -277,8 +277,14 @@ static void my_cluster_node_load (void)
 
 	iface_string = totemip_print (&interfaces[0]);
 
-	sprintf ((char *)my_cluster_node.node_address.value, "%s",
-		iface_string);
+	if (strlen(iface_string)+1 > sizeof(my_cluster_node.node_address.value)) {
+	    log_printf (LOG_LEVEL_ERROR,
+			"iface_string <%s>%d larger than available storage (%d)",
+			iface_string, strlen(iface_string), sizeof(my_cluster_node.node_address.value));
+	}
+	snprintf ((char *)my_cluster_node.node_address.value, sizeof(my_cluster_node.node_address.value),
+		  "%s", iface_string);
+	
 	my_cluster_node.node_address.length =
 		strlen ((char *)my_cluster_node.node_address.value);
 	if (totempg_my_family_get () == AF_INET) {
Index: openais/exec/ipc.c
===================================================================
--- openais.orig/exec/ipc.c
+++ openais/exec/ipc.c
@@ -391,9 +391,11 @@ req_setup_send (
 	int error)
 {
 	mar_res_setup_t res_setup;
-	res_setup.error = error;
 	unsigned int res;
 
+	memset(&res_setup, 0, sizeof(mar_res_setup_t));
+	res_setup.error = error;
+
 retry_send:
 	res = send (conn_info->fd, &res_setup, sizeof (mar_res_setup_t), MSG_WAITALL);
 	if (res == -1 && errno == EINTR) {
Index: openais/exec/main.c
===================================================================
--- openais.orig/exec/main.c
+++ openais/exec/main.c
@@ -113,14 +113,6 @@ static void sigsegv_handler (int num)
 	raise (SIGSEGV);
 }
 
-static void sigabrt_handler (int num)
-{
-	signal (SIGABRT, SIG_DFL);
-	log_flush ();
-	raise (SIGABRT);
-}
-
-
 #define LOCALHOST_IP inet_addr("127.0.0.1")
 
 totempg_groups_handle openais_group_handle;
@@ -469,7 +461,6 @@ int main (int argc, char **argv)
 	signal (SIGINT, sigintr_handler);
 	signal (SIGUSR2, sigusr2_handler);
 	signal (SIGSEGV, sigsegv_handler);
-	signal (SIGABRT, sigabrt_handler);
 	signal (SIGQUIT, sigquit_handler);
 	
 	openais_timer_init (
Index: openais/exec/service.c
===================================================================
--- openais.orig/exec/service.c
+++ openais/exec/service.c
@@ -298,34 +298,41 @@ extern unsigned int openais_service_unli
 	struct objdb_iface_ver0 *objdb)
 {
 	char *service_name = NULL;
+	unsigned short *service_id;
 	unsigned int *service_ver = 0;
 	unsigned int object_service_handle = 0;
 
 	log_printf(LOG_LEVEL_NOTICE, "Unloading all openais components\n");
-	
-	objdb->object_find_reset (OBJECT_PARENT_HANDLE);
-	while (objdb->object_find (OBJECT_PARENT_HANDLE,
-				   "service",
-				   strlen ("service"),
-				   &object_service_handle) == 0) {
-		
-		objdb->object_key_get (object_service_handle,
-			"name",
-			strlen ("name"),
-			(void *)&service_name,
-			NULL);
-
-		objdb->object_key_get (object_service_handle,
-			"ver",
-			strlen ("ver"),
-			(void *)&service_ver,
-			NULL);
-				
-		openais_service_unlink_common(
-			objdb, object_service_handle, service_name, *service_ver);
 
-		objdb->object_destroy (object_service_handle);
+	int lpc = SERVICE_HANDLER_MAXIMUM_COUNT - 1;
+	for( ; lpc >= 0; lpc--) {
+	    if(ais_service[lpc] != NULL) {
+		/* unload */
+		log_printf(LOG_LEVEL_NOTICE, "Unloading slot %d: %s\n", ais_service[lpc]->id, ais_service[lpc]->name);
+
 		objdb->object_find_reset (OBJECT_PARENT_HANDLE);
+		while (objdb->object_find (OBJECT_PARENT_HANDLE,
+					   "service", strlen ("service"), &object_service_handle) == 0) {
+
+		    int res = objdb->object_key_get (object_service_handle,
+						     "service_id", strlen ("service_id"), (void *)&service_id, NULL);
+
+		    service_name = NULL;
+		    if(res == 0 && *service_id == ais_service[lpc]->id) {
+			objdb->object_key_get (object_service_handle,
+					       "name", strlen ("name"), (void *)&service_name, NULL);
+			
+			objdb->object_key_get (object_service_handle,
+					       "ver", strlen ("ver"), (void *)&service_ver, NULL);
+			
+			openais_service_unlink_common(
+			    objdb, object_service_handle, service_name, *service_ver);
+			
+			objdb->object_destroy (object_service_handle);
+			break;
+		    } 
+		}
+	    }
 	}
 
 	return (0);
Index: openais/exec/totemip.c
===================================================================
--- openais.orig/exec/totemip.c
+++ openais/exec/totemip.c
@@ -445,6 +445,8 @@ int totemip_iface_check(struct totem_ip_
 	struct totem_ip_address ipaddr;
 	static char rcvbuf[NETLINK_BUFSIZE];
 
+	memset(&req, 0, sizeof(req));
+	
 	*interface_up = 0;
 	*interface_num = 0;
 	memset(&ipaddr, 0, sizeof(ipaddr));
Index: openais/exec/totemsrp.c
===================================================================
--- openais.orig/exec/totemsrp.c
+++ openais/exec/totemsrp.c
@@ -2569,9 +2569,12 @@ static int token_hold_cancel_send (struc
 	token_hold_cancel.header.nodeid = instance->my_id.addr[0].nodeid;
 	assert (token_hold_cancel.header.nodeid);
 
+	memset(iovec, 0, 2 * sizeof(struct iovec));
+
 	iovec[0].iov_base = &token_hold_cancel;
 	iovec[0].iov_len = sizeof (struct token_hold_cancel) -
 		sizeof (struct memb_ring_id);
+      
 	iovec[1].iov_base = &instance->my_ring_id;
 	iovec[1].iov_len = sizeof (struct memb_ring_id);
 
Index: openais/lib/util.c
===================================================================
--- openais.orig/lib/util.c
+++ openais/lib/util.c
@@ -114,6 +114,9 @@ openais_send (
 	char *rbuf = (char *)msg;
 	int processed = 0;
 
+	memset(&msg_send, 0, sizeof(struct msghdr));
+	memset(&iov_send, 0, sizeof(struct iovec));
+	
 	msg_send.msg_iov = &iov_send;
 	msg_send.msg_iovlen = 1;
 	msg_send.msg_name = 0;
openSUSE Build Service is sponsored by