summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2007-02-28 17:29:28 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2007-02-28 17:29:28 +0000
commit6987fcf64df084d6b5eda9e69f7c19c093667963 (patch)
treeff0ce7af007b96ba6906370578b39a95ddf7b0e2 /sys-cluster
parentEbuild cleanup. (diff)
downloadgentoo-2-6987fcf64df084d6b5eda9e69f7c19c093667963.tar.gz
gentoo-2-6987fcf64df084d6b5eda9e69f7c19c093667963.tar.bz2
gentoo-2-6987fcf64df084d6b5eda9e69f7c19c093667963.zip
Version bump, fixed memory leak.
(Portage version: 2.1.2-r9)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/heartbeat/ChangeLog11
-rw-r--r--sys-cluster/heartbeat/files/digest-heartbeat-2.0.83
-rw-r--r--sys-cluster/heartbeat/files/heartbeat-2.0.8-crm-leaks.patch601
-rw-r--r--sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild5
-rw-r--r--sys-cluster/heartbeat/heartbeat-2.0.8.ebuild120
5 files changed, 736 insertions, 4 deletions
diff --git a/sys-cluster/heartbeat/ChangeLog b/sys-cluster/heartbeat/ChangeLog
index 0ddc17c58e6e..a442f4762436 100644
--- a/sys-cluster/heartbeat/ChangeLog
+++ b/sys-cluster/heartbeat/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-cluster/heartbeat
-# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/ChangeLog,v 1.59 2006/09/25 23:57:35 xmerlin Exp $
+# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/ChangeLog,v 1.60 2007/02/28 17:29:28 xmerlin Exp $
+
+*heartbeat-2.0.8 (28 Feb 2007)
+
+ 28 Feb 2007; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/heartbeat-2.0.8-crm-leaks.patch, heartbeat-2.0.7-r2.ebuild,
+ +heartbeat-2.0.8.ebuild:
+ Version bump, fixed memory leak.
26 Sep 2006; Christian Zoffoli <xmerlin@gentoo.org>
heartbeat-1.2.5-r1.ebuild, heartbeat-2.0.7-r2.ebuild:
diff --git a/sys-cluster/heartbeat/files/digest-heartbeat-2.0.8 b/sys-cluster/heartbeat/files/digest-heartbeat-2.0.8
new file mode 100644
index 000000000000..7399aaf70f4b
--- /dev/null
+++ b/sys-cluster/heartbeat/files/digest-heartbeat-2.0.8
@@ -0,0 +1,3 @@
+MD5 39d7d12d2a7d5c98d1e3f8ae7977a3e6 heartbeat-2.0.8.tar.gz 3502095
+RMD160 76f3a56cbbafac8c35a87266b73d46a86de86feb heartbeat-2.0.8.tar.gz 3502095
+SHA256 b8425098e1243976f1e9deedfbf763fd42f0461bdd8933b0b8a94f0626912c91 heartbeat-2.0.8.tar.gz 3502095
diff --git a/sys-cluster/heartbeat/files/heartbeat-2.0.8-crm-leaks.patch b/sys-cluster/heartbeat/files/heartbeat-2.0.8-crm-leaks.patch
new file mode 100644
index 000000000000..046b9bdfda06
--- /dev/null
+++ b/sys-cluster/heartbeat/files/heartbeat-2.0.8-crm-leaks.patch
@@ -0,0 +1,601 @@
+diff -r 2d298bca0d0a crm/cib/io.c
+--- a/crm/cib/io.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/cib/io.c Fri Feb 09 15:05:29 2007 +0100
+@@ -121,7 +121,8 @@ validate_cib_digest(crm_data_t *local_ci
+ crm_malloc0(expected, (length+1));
+ read_len = fread(expected, 1, length, expected_strm);
+ CRM_ASSERT(read_len == length);
+-
++ fclose(expected_strm);
++
+ if(expected == NULL) {
+ crm_err("On-disk digest is empty");
+
+@@ -635,6 +636,8 @@ write_cib_contents(gpointer p)
+ epoch?epoch:"0", updates?updates:"0", digest);
+
+ rc = write_cib_digest(the_cib, digest);
++ crm_free(digest);
++
+ if(rc <= 0) {
+ crm_err("Digest couldn't be written to disk");
+ exit(LSB_EXIT_GENERIC);
+@@ -650,7 +653,6 @@ write_cib_contents(gpointer p)
+ exit(LSB_EXIT_OK);
+ }
+
+- crm_free(digest);
+ return HA_OK;
+ }
+
+diff -r 2d298bca0d0a crm/crmd/callbacks.c
+--- a/crm/crmd/callbacks.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/callbacks.c Fri Feb 09 15:05:29 2007 +0100
+@@ -410,28 +410,33 @@ crmd_client_status_callback(const char *
+ trigger_fsa(fsa_source);
+ }
+
+-static void
++void
+ crmd_ipc_connection_destroy(gpointer user_data)
+ {
++ GCHSource *source = NULL;
+ crmd_client_t *client = user_data;
+
+ if(client == NULL) {
+ crm_debug_4("No client to delete");
+ return;
+ }
+-
+- if(client->client_source != NULL) {
+- crm_debug_4("Deleting %s (%p) from mainloop",
+- client->uuid, client->client_source);
+- G_main_del_IPC_Channel(client->client_source);
+- client->client_source = NULL;
+- }
+-
+- crm_debug_3("Freeing %s client", client->uuid);
+- crm_free(client->table_key);
+- crm_free(client->sub_sys);
+- crm_free(client->uuid);
+- crm_free(client);
++
++ source = client->client_source;
++ client->client_source = NULL;
++ crm_debug_3("Processing %s (%p)", client->uuid, source);
++ if(source != NULL) {
++ crm_debug_2("Deleting %s (%p) from mainloop",
++ client->uuid, source);
++ /* this will re-call crmd_ipc_connection_destroy() */
++ G_main_del_IPC_Channel(source);
++
++ } else {
++ crm_debug_2("Freeing %s client", client->uuid);
++ crm_free(client->table_key);
++ crm_free(client->sub_sys);
++ crm_free(client->uuid);
++ crm_free(client);
++ }
+
+ return;
+ }
+@@ -604,11 +609,7 @@ crmd_ccm_msg_callback(
+ trigger_transition?A_TE_CANCEL:A_NOTHING,
+ FALSE, __FUNCTION__);
+
+- if (event_data->oc) {
+- crm_free(event_data->oc);
+- event_data->oc = NULL;
+- }
+- crm_free(event_data);
++ delete_ccm_data(event_data);
+ }
+
+ oc_ev_callback_done(cookie);
+diff -r 2d298bca0d0a crm/crmd/ccm.c
+--- a/crm/crmd/ccm.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/ccm.c Fri Feb 09 15:05:30 2007 +0100
+@@ -49,7 +49,6 @@ void crmd_ccm_msg_callback(oc_ed_t event
+ size_t size,
+ const void *data);
+
+-gboolean ghash_node_clfree(gpointer key, gpointer value, gpointer user_data);
+ void ghash_update_cib_node(gpointer key, gpointer value, gpointer user_data);
+
+ #define CCM_EVENT_DETAIL 0
+@@ -446,22 +445,9 @@ do_ccm_update_cache(long long action,
+ g_hash_table_size(fsa_membership_copy->members),
+ g_hash_table_size(fsa_membership_copy->new_members),
+ g_hash_table_size(fsa_membership_copy->dead_members));
+-
+- /* Free the old copy */
+- if(tmp != NULL) {
+- if(tmp->members != NULL)
+- g_hash_table_foreach_remove(
+- tmp->members, ghash_node_clfree, NULL);
+- if(tmp->new_members != NULL)
+- g_hash_table_foreach_remove(
+- tmp->new_members, ghash_node_clfree, NULL);
+- if(tmp->dead_members != NULL)
+- g_hash_table_foreach_remove(
+- tmp->dead_members, ghash_node_clfree, NULL);
+- crm_free(tmp);
+- }
+- crm_debug_3("Free'd old copies");
+-
++
++ free_ccm_cache(tmp);
++
+ set_bit_inplace(fsa_input_register, R_CCM_DATA);
+
+ if(cur_state != S_STOPPING) {
+@@ -680,15 +666,4 @@ ghash_update_cib_node(gpointer key, gpoi
+ free_xml(tmp1);
+ }
+
+-gboolean
+-ghash_node_clfree(gpointer key, gpointer value, gpointer user_data)
+-{
+- /* value->node_uname is free'd as "key" */
+- if(key != NULL) {
+- crm_free(key);
+- }
+- if(value != NULL) {
+- crm_free(value);
+- }
+- return TRUE;
+-}
++
+diff -r 2d298bca0d0a crm/crmd/crmd_callbacks.h
+--- a/crm/crmd/crmd_callbacks.h Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/crmd_callbacks.h Fri Feb 09 15:05:30 2007 +0100
+@@ -29,6 +29,8 @@ extern void crmd_ccm_msg_callback(
+ * Returning FALSE means "we're all done, close the connection"
+ */
+
++extern void crmd_ipc_connection_destroy(gpointer user_data);
++
+ extern gboolean crmd_ha_msg_dispatch(
+ ll_cluster_t *cluster_conn, gpointer user_data);
+
+diff -r 2d298bca0d0a crm/crmd/crmd_utils.h
+--- a/crm/crmd/crmd_utils.h Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/crmd_utils.h Fri Feb 09 15:05:30 2007 +0100
+@@ -23,6 +23,9 @@
+ #include <crm/common/xml.h>
+
+ #define CLIENT_EXIT_WAIT 30
++
++extern void free_ccm_cache(oc_node_list_t *tmp);
++extern void delete_ccm_data(struct crmd_ccm_data_s *ccm_input);
+
+ extern void process_client_disconnect(crmd_client_t *curr_client);
+
+diff -r 2d298bca0d0a crm/crmd/lrm.c
+--- a/crm/crmd/lrm.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/lrm.c Fri Feb 09 15:05:30 2007 +0100
+@@ -358,7 +358,6 @@ get_rsc_metadata(const char *type, const
+ metadata = g_hash_table_lookup(meta_hash, key);
+ if(metadata) {
+ crm_debug_2("Returning cached metadata for %s", key);
+- crm_free(key);
+ goto out;
+ }
+
+@@ -368,14 +367,15 @@ get_rsc_metadata(const char *type, const
+
+ if(metadata) {
+ g_hash_table_insert(meta_hash, key, metadata);
+- }
++ key = NULL; /* prevent it from being free'd */
++
++ } else {
++ crm_warn("No metadata found for %s", key);
++ }
+
+ out:
+- if(metadata == NULL) {
+- crm_warn("No metadata found for %s::%s:%s",
+- class, type, provider);
+- }
+-
++
++ crm_free(key);
+ return metadata;
+ }
+
+@@ -429,7 +429,9 @@ get_rsc_restart_list(lrm_rsc_t *rsc, lrm
+ return restart_list;
+ }
+
+-static void
++void append_restart_list(crm_data_t *update, lrm_op_t *op, const char *version);
++
++void
+ append_restart_list(crm_data_t *update, lrm_op_t *op, const char *version)
+ {
+ int len = 0;
+@@ -686,8 +688,6 @@ build_operation_update(
+ if(args_parent == NULL) {
+ free_xml(args_xml);
+ }
+-
+- append_restart_list(xml_op, op, caller_version);
+
+ return TRUE;
+ }
+@@ -859,7 +859,8 @@ do_lrm_query(gboolean is_replace)
+ }
+
+ xml_result = create_cib_fragment(xml_state, XML_CIB_TAG_STATUS);
+-
++ free_xml(xml_state);
++
+ crm_log_xml_debug_3(xml_state, "Current state of the LRM");
+
+ return xml_result;
+diff -r 2d298bca0d0a crm/crmd/messages.c
+--- a/crm/crmd/messages.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/messages.c Fri Feb 09 15:05:30 2007 +0100
+@@ -314,9 +314,7 @@ delete_fsa_input(fsa_data_t *fsa_data)
+ case fsa_dt_ccm:
+ ccm_input = (struct crmd_ccm_data_s *)
+ fsa_data->data;
+-
+- crm_free(ccm_input->oc);
+- crm_free(ccm_input);
++ delete_ccm_data(ccm_input);
+ break;
+
+ case fsa_dt_none:
+diff -r 2d298bca0d0a crm/crmd/utils.c
+--- a/crm/crmd/utils.c Thu Jan 11 18:42:41 2007 -0700
++++ b/crm/crmd/utils.c Fri Feb 09 15:05:30 2007 +0100
+@@ -1151,6 +1148,42 @@ copy_ccm_data(const struct crmd_ccm_data
+ ccm_input_copy->event = ccm_input->event;
+
+ return ccm_input_copy;
++}
++
++void
++delete_ccm_data(struct crmd_ccm_data_s *ccm_input)
++{
++ int lpc, offset = 0;
++ oc_node_t *a_node = NULL;
++ oc_ev_membership_t *oc_in = ccm_input->oc;
++ if(oc_in != NULL) {
++ offset = oc_in->m_memb_idx;
++ }
++ for(lpc = 0; lpc < oc_in->m_n_member; lpc++) {
++ a_node = &oc_in->m_array[lpc+offset];
++ crm_free(a_node->node_uname);
++ a_node->node_uname = NULL;
++ }
++
++ if(oc_in != NULL) {
++ offset = oc_in->m_in_idx;
++ }
++ for(lpc = 0; lpc < oc_in->m_n_in; lpc++) {
++ a_node = &oc_in->m_array[lpc+offset];
++ crm_free(a_node->node_uname);
++ a_node->node_uname = NULL;
++ }
++
++ if(oc_in != NULL) {
++ offset = oc_in->m_out_idx;
++ }
++ for(lpc = 0; lpc < oc_in->m_n_out; lpc++) {
++ a_node = &oc_in->m_array[lpc+offset];
++ crm_free(a_node->node_uname);
++ a_node->node_uname = NULL;
++ }
++ crm_free(ccm_input->oc);
++ crm_free(ccm_input);
+ }
+
+ oc_ev_membership_t *
+@@ -1243,21 +1274,61 @@ copy_ccm_node(oc_node_t a_node, oc_node_
+ a_node.node_id, a_node.node_born_on,
+ a_node.node_uname);
+
++ if(a_node_copy->node_uname != NULL) {
++ crm_debug_2("%p (%s) already copied", a_node_copy, a_node_copy->node_uname);
++ return;
++ }
++
+ a_node_copy->node_id = a_node.node_id;
+- a_node_copy->node_born_on = a_node.node_born_on;
++ a_node_copy->node_born_on = a_node.node_born_on;
+ a_node_copy->node_uname = NULL;
+
+ if(a_node.node_uname != NULL) {
+- a_node_copy->node_uname =
+- crm_strdup(a_node.node_uname);
++ a_node_copy->node_uname = crm_strdup(a_node.node_uname);
+ } else {
+- crm_err("Node Id %d had a NULL uname!",
+- a_node.node_id);
+- }
+-
++ crm_err("Node Id %d had a NULL uname!", a_node.node_id);
++ }
+ crm_debug_3("Copied ccm node: id=%d, born=%d, uname=%s",
+ a_node_copy->node_id, a_node_copy->node_born_on,
+ a_node_copy->node_uname);
++}
++
++static gboolean
++ghash_node_clfree(gpointer key, gpointer value, gpointer user_data)
++{
++ /* value->node_uname is free'd as "key" */
++ if(key != NULL) {
++ crm_free(key);
++ }
++ if(value != NULL) {
++ crm_free(value);
++ }
++ return TRUE;
++}
++
++void
++free_ccm_cache(oc_node_list_t *tmp)
++{
++ /* Free the old copy */
++ if(tmp == NULL) {
++ return;
++ }
++
++ if(tmp->members != NULL) {
++ g_hash_table_foreach_remove(
++ tmp->members, ghash_node_clfree, NULL);
++ }
++ if(tmp->new_members != NULL) {
++ g_hash_table_foreach_remove(
++ tmp->new_members, ghash_node_clfree, NULL);
++ }
++ if(tmp->dead_members != NULL) {
++ g_hash_table_foreach_remove(
++ tmp->dead_members, ghash_node_clfree, NULL);
++ }
++
++ crm_free(tmp);
++ crm_debug_3("Free'd old copies");
+ }
+
+ crm_data_t*
+diff -r 2d298bca0d0a lib/crm/cib/cib_attrs.c
+--- a/lib/crm/cib/cib_attrs.c Thu Jan 11 18:42:41 2007 -0700
++++ b/lib/crm/cib/cib_attrs.c Fri Feb 09 15:05:30 2007 +0100
+@@ -101,7 +101,9 @@ find_attr_details(crm_data_t *xml_search
+ NULL, XML_ATTR_ID, node_uuid, FALSE);
+ crm_log_xml_debug_2(set_children, "search by node:");
+ if(matches == 0) {
+- crm_info("No node matching id=%s in %s", node_uuid, TYPE(xml_search));
++ CRM_CHECK(set_children == NULL, crm_err("Memory leak"));
++ crm_info("No node matching id=%s in %s",
++ node_uuid, TYPE(xml_search));
+ return NULL;
+ }
+ }
+@@ -114,6 +116,7 @@ find_attr_details(crm_data_t *xml_search
+ crm_log_xml_debug_2(set_children, "search by set:");
+ if(matches == 0) {
+ crm_info("No set matching id=%s in %s", set_name, TYPE(xml_search));
++ CRM_CHECK(set_children == NULL, crm_err("Memory leak"));
+ return NULL;
+ }
+ }
+@@ -140,6 +143,7 @@ find_attr_details(crm_data_t *xml_search
+ break;
+ );
+ free_xml(nv_children);
++ free_xml(set_children);
+ return single_match;
+
+ } else if(matches > 1) {
+@@ -176,6 +180,7 @@ find_attr_details(crm_data_t *xml_search
+ );
+ }
+ }
++ free_xml(set_children);
+ return NULL;
+ }
+
+@@ -230,6 +235,7 @@ update_attr(cib_t *the_cib, int call_opt
+ CRM_CHECK(set_name != NULL, return cib_missing);
+
+ if(attr_value == NULL) {
++ free_xml(xml_obj);
+ return cib_missing_data;
+ }
+
+@@ -264,6 +270,7 @@ update_attr(cib_t *the_cib, int call_opt
+ xml_obj = create_xml_node(xml_obj, XML_TAG_ATTRS);
+ crm_free(local_set_name);
+ } else {
++ free_xml(xml_obj);
+ xml_obj = NULL;
+ }
+
+diff -r 2d298bca0d0a lib/crm/cib/cib_client.c
+--- a/lib/crm/cib/cib_client.c Thu Jan 11 18:42:41 2007 -0700
++++ b/lib/crm/cib/cib_client.c Fri Feb 09 15:05:30 2007 +0100
+@@ -487,7 +487,8 @@ int cib_client_add_notify_callback(
+
+ if(list_item != NULL) {
+ crm_warn("Callback already present");
+-
++ crm_free(new_client);
++
+ } else {
+ cib->notify_list = g_list_append(
+ cib->notify_list, new_client);
+diff -r 2d298bca0d0a lib/crm/common/utils.c
+--- a/lib/crm/common/utils.c Thu Jan 11 18:42:41 2007 -0700
++++ b/lib/crm/common/utils.c Fri Feb 09 15:05:30 2007 +0100
+@@ -519,6 +519,7 @@ int
+ int
+ compare_version(const char *version1, const char *version2)
+ {
++ int rc = 0;
+ int lpc = 0;
+ char *step1 = NULL, *step2 = NULL;
+ char *rest1 = NULL, *rest2 = NULL;
+@@ -533,7 +534,7 @@ compare_version(const char *version1, co
+
+ rest1 = crm_strdup(version1);
+ rest2 = crm_strdup(version2);
+-
++
+ while(1) {
+ int cmp = 0;
+ int step1_i = 0;
+@@ -543,6 +544,13 @@ compare_version(const char *version1, co
+ decodeNVpair(rest1, '.', &step1, &tmp1);
+ decodeNVpair(rest2, '.', &step2, &tmp2);
+
++ if(step1 == NULL && step2 == NULL) {
++ CRM_CHECK(tmp1 == tmp2 && tmp1 == NULL,
++ crm_err("Leftover data: %s, %s",
++ crm_str(tmp1), crm_str(tmp2)));
++ break;
++ }
++
+ if(step1 != NULL) {
+ step1_i = crm_parse_int(step1, NULL);
+ }
+@@ -564,27 +572,34 @@ compare_version(const char *version1, co
+ crm_free(rest1);
+ crm_free(rest2);
+
++ crm_free(step1);
++ crm_free(step2);
++
+ rest1 = tmp1;
+ rest2 = tmp2;
+-
+- if(step1 == NULL && step2 == NULL) {
++
++ if(cmp < 0) {
++ rc = -1;
+ break;
+- }
+-
+- crm_free(step1);
+- crm_free(step2);
+-
+- if(cmp < 0) {
+- crm_debug_3("%s < %s", version1, version2);
+- return -1;
+
+ } else if(cmp > 0) {
+- crm_debug_3("%s > %s", version1, version2);
+- return 1;
+- }
+- }
+- crm_debug_3("%s == %s", version1, version2);
+- return 0;
++ rc = 1;
++ break;
++ }
++ }
++
++ crm_free(rest1);
++ crm_free(rest2);
++
++ if(rc == 0) {
++ crm_debug_3("%s == %s", version1, version2);
++ } else if(rc < 0) {
++ crm_debug_3("%s < %s", version1, version2);
++ } else if(rc > 0) {
++ crm_debug_3("%s > %s", version1, version2);
++ }
++
++ return rc;
+ }
+
+ gboolean do_stderr = FALSE;
+diff -r 2d298bca0d0a lib/crm/common/xml.c
+--- a/lib/crm/common/xml.c Thu Jan 11 18:42:41 2007 -0700
++++ b/lib/crm/common/xml.c Fri Feb 09 15:05:30 2007 +0100
+@@ -2500,13 +2500,13 @@ validate_with_dtd(
+ CRM_CHECK(buffer != NULL, return FALSE);
+
+ doc = xmlParseMemory(buffer, strlen(buffer));
+- CRM_CHECK(doc != NULL, crm_free(buffer); return FALSE);
++ CRM_CHECK(doc != NULL, valid = FALSE; goto cleanup);
+
+ dtd = xmlParseDTD(NULL, (const xmlChar *)dtd_file);
+- CRM_CHECK(dtd != NULL, crm_free(buffer); return TRUE);
++ CRM_CHECK(dtd != NULL, goto cleanup);
+
+ cvp = xmlNewValidCtxt();
+- CRM_CHECK(cvp != NULL, crm_free(buffer); return TRUE);
++ CRM_CHECK(cvp != NULL, goto cleanup);
+
+ if(to_logs) {
+ cvp->userData = (void *) LOG_ERR;
+@@ -2520,15 +2520,16 @@ validate_with_dtd(
+
+ if (!xmlValidateDtd(cvp, doc, dtd)) {
+ crm_err("CIB does not validate against %s", dtd_file);
++ crm_log_xml_debug(xml_blob, "invalid");
+ valid = FALSE;
+- crm_log_xml_debug(xml_blob, "invalid");
+- }
+-
++ }
++
++ cleanup:
+ xmlFreeValidCtxt(cvp);
+ xmlFreeDtd(dtd);
+ xmlFreeDoc(doc);
+-
+ crm_free(buffer);
++
+ #endif
+ return valid;
+ }
+diff -r 2d298bca0d0a tools/attrd.c
+--- a/tools/attrd.c Thu Jan 11 18:42:41 2007 -0700
++++ b/tools/attrd.c Fri Feb 09 15:05:30 2007 +0100
+@@ -85,6 +85,7 @@ free_hash_entry(gpointer data)
+ }
+ crm_free(entry->id);
+ crm_free(entry->set);
++ crm_free(entry->dampen);
+ crm_free(entry->section);
+ if(entry->value != entry->last_value) {
+ crm_free(entry->value);
+@@ -477,6 +489,7 @@ find_hash_entry(HA_Message * msg)
+
+ value = ha_msg_value(msg, F_ATTRD_SET);
+ if(value != NULL) {
++ crm_free(hash_entry->set);
+ hash_entry->set = crm_strdup(value);
+ crm_debug("\t%s->set: %s", attr, value);
+ }
+@@ -485,12 +498,15 @@ find_hash_entry(HA_Message * msg)
+ if(value == NULL) {
+ value = XML_CIB_TAG_STATUS;
+ }
++ crm_free(hash_entry->section);
+ hash_entry->section = crm_strdup(value);
+ crm_debug("\t%s->section: %s", attr, value);
+
+ value = ha_msg_value(msg, F_ATTRD_DAMPEN);
+ if(value != NULL) {
++ crm_free(hash_entry->dampen);
+ hash_entry->dampen = crm_strdup(value);
++
+ hash_entry->timeout = crm_get_msec(value);
+ crm_debug("\t%s->timeout: %s", attr, value);
+ }
+@@ -601,6 +617,7 @@ attrd_timer_callback(void *user_data)
+ ha_msg_add(msg, F_ATTRD_SECTION, hash_entry->section);
+ ha_msg_add(msg, F_ATTRD_DAMPEN, hash_entry->dampen);
+ send_ha_message(attrd_cluster_conn, msg, NULL, FALSE);
++ crm_msg_del(msg);
+
+ return TRUE;
+ }
diff --git a/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild b/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild
index 2ea8804f71b9..57932fd152e7 100644
--- a/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild
+++ b/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild,v 1.2 2006/09/25 23:57:35 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild,v 1.3 2007/02/28 17:29:28 xmerlin Exp $
inherit flag-o-matic eutils
@@ -47,6 +47,7 @@ src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/${P}-update-resources-failcount.patch || die
+ #epatch ${FILESDIR}/${P}-crm-leaks.patch || die
}
src_compile() {
diff --git a/sys-cluster/heartbeat/heartbeat-2.0.8.ebuild b/sys-cluster/heartbeat/heartbeat-2.0.8.ebuild
new file mode 100644
index 000000000000..2b94095bb187
--- /dev/null
+++ b/sys-cluster/heartbeat/heartbeat-2.0.8.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.8.ebuild,v 1.1 2007/02/28 17:29:28 xmerlin Exp $
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Heartbeat high availability cluster manager"
+HOMEPAGE="http://www.linux-ha.org"
+SRC_URI="http://www.linux-ha.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 -mips ~ppc -s390 ~x86"
+IUSE="ldirectord doc snmp management"
+
+DEPEND="
+ =dev-libs/glib-2*
+ net-libs/libnet
+ dev-util/pkgconfig
+ >=dev-lang/perl-5.8.8
+ net-misc/iputils
+ virtual/ssh
+ net-libs/gnutls
+ ldirectord? ( sys-cluster/ipvsadm
+ dev-perl/Net-DNS
+ dev-perl/libwww-perl
+ dev-perl/perl-ldap
+ perl-core/libnet
+ dev-perl/Crypt-SSLeay
+ dev-perl/HTML-Parser
+ dev-perl/perl-ldap
+ dev-perl/Mail-IMAPClient
+ dev-perl/Mail-POP3Client
+ dev-perl/MailTools
+ )
+ snmp? ( net-analyzer/net-snmp )
+ net-misc/telnet-bsd
+ dev-lang/swig
+ management? (
+ >=dev-lang/python-2.4
+ >=dev-python/pygtk-2.4
+ >=sys-libs/pam-0.78-r3
+ )
+ "
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ #epatch ${FILESDIR}/${P}-update-resources-failcount.patch || die
+ epatch ${FILESDIR}/${P}-crm-leaks.patch || die
+}
+
+src_compile() {
+ append-ldflags $(bindnow-flags)
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-group-name=cluster \
+ --with-group-id=65 \
+ --with-ccmuser-name=cluster \
+ --with-ccmuser-id=65 \
+ --enable-checkpointd \
+ --enable-crm \
+ --enable-lrm \
+ $(use_enable management mgmt) \
+ || die
+ emake -j 1 || die "compile problem"
+}
+
+pkg_preinst() {
+ # check for cluster group, if it doesn't exist make it
+ if ! grep -q cluster.*65 /etc/group ; then
+ groupadd -g 65 cluster
+ fi
+ # check for cluster user, if it doesn't exist make it
+ if ! grep -q cluster.*65 /etc/passwd ; then
+ useradd -u 65 -g cluster -s /dev/null -d /var/lib/heartbeat cluster
+ fi
+}
+
+src_install() {
+ make DESTDIR=${D} install || die
+
+ # heartbeat modules need these dirs
+ #keepdir /var/lib/heartbeat/ckpt /var/lib/heartbeat/ccm /var/lib/heartbeat
+
+ keepdir /var/lib/heartbeat/crm /var/lib/heartbeat/lrm /var/lib/heartbeat/fencing
+ keepdir /var/lib/heartbeat/cores/cluster /var/lib/heartbeat/cores/root /var/lib/heartbeat/cores/nobody
+
+ keepdir /var/run/heartbeat/ccm /var/run/heartbeat/crm
+
+ keepdir /etc/ha.d/conf
+
+ dosym /usr/sbin/ldirectord /etc/ha.d/resource.d/ldirectord || die
+
+ if use management ; then
+ keepdir /var/lib/heartbeat/mgmt
+ fi
+
+ # if ! USE="ldirectord" then don't install it
+ if ! use ldirectord ; then
+ rm ${D}/etc/init.d/ldirectord
+ rm ${D}/etc/logrotate.d/ldirectord
+ rm ${D}/etc/ha.d/resource.d/ldirectord
+ rm ${D}/usr/share/man/man8/supervise-ldirectord-config.8
+ rm ${D}/usr/share/man/man8/ldirectord.8
+ rm ${D}/usr/sbin/ldirectord
+ rm ${D}/usr/sbin/supervise-ldirectord-config
+ fi
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/heartbeat-init heartbeat
+
+ dodoc ldirectord/ldirectord.cf doc/*.cf doc/haresources doc/authkeys || die
+ if use doc ; then
+ dodoc README doc/*.txt doc/AUTHORS doc/COPYING || die
+ fi
+}