0440703030
- PE: Demote from Master does not clear previous errors - crmd: Prevent secondary DC fencing resulting from CIB updates that are lost due to elections - crmd: Log duplicate DC detection as a WARNING not ERROR - crmd: Bug lf#2632 - Correctly handle nodes that return faster than stonith - Core: Treat GNUTLS_E_UNEXPECTED_PACKET_LENGTH as normal termination of a TLS session - cib: Call gnutls_bye() and shutdown() when disconnecting from remote TLS connections - cib: Remove disconnected remote connections from mainloop - cib: Attempt a graceful sign-off for remote TLS connections - Core: Ensure there is sufficient space for EOS when building short-form option strings (prevents segfault) - Core: Fix variable expansion in pkg-config files - PE: Resolve memory leak reported by valgrind - PE: Fix memory leak for re-allocated resources reported by valgrind - PE: Improve the merging with template's operations - crmd: Allow nodes to fence themselves if they're the last one standing (lf#2584) - stonith: Add an API call for listing installed agents - stonith: Allow the fencing history to be queried - stonith: Ensure completed operations are recorded as such in the history - stonith: Support --quiet to display just the seconds since epoch at which a node was last shot - stonith: Serialize actions for a given device - stonith: Add missing entries to stonith_error2string() (missing OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=18
164 lines
4.7 KiB
Diff
164 lines
4.7 KiB
Diff
# HG changeset patch
|
|
# User Andrew Beekhof <andrew@beekhof.net>
|
|
# Date 1314251944 -36000
|
|
# Node ID d44ff2711662517d91b542b122218cffa2af3eb1
|
|
# Parent 4cc8fdf2827a31d41b48b8c97d784c75c9418eda
|
|
Low: cib: Remove the remaining uses of the xml_child_iter() macro
|
|
|
|
diff --git a/lib/cib/cib_acl.c b/lib/cib/cib_acl.c
|
|
--- a/lib/cib/cib_acl.c
|
|
+++ b/lib/cib/cib_acl.c
|
|
@@ -159,8 +159,7 @@ acl_check_diff(xmlNode *request, xmlNode
|
|
|
|
orig_diff = diff_xml_object_orig(current_cib, result_cib, FALSE, diff);
|
|
|
|
- xml_child_iter(
|
|
- orig_diff, diff_child,
|
|
+ for (diff_child = __xml_first_child(orig_diff); diff_child; diff_child = __xml_next(diff_child)) {
|
|
const char *tag = crm_element_name(diff_child);
|
|
GListPtr parsed_acl = NULL;
|
|
|
|
@@ -176,8 +175,7 @@ acl_check_diff(xmlNode *request, xmlNode
|
|
continue;
|
|
}
|
|
|
|
- xml_child_iter(
|
|
- diff_child, diff_cib,
|
|
+ for (diff_cib = __xml_first_child(diff_child); diff_cib; diff_child = __xml_next(diff_cib)) {
|
|
GHashTable *xml_perms = NULL;
|
|
|
|
gen_xml_perms(diff_cib, parsed_acl, &xml_perms);
|
|
@@ -188,9 +186,9 @@ acl_check_diff(xmlNode *request, xmlNode
|
|
crm_warn("User '%s' doesn't have enough permission to modify the CIB objects", user);
|
|
goto done;
|
|
}
|
|
- );
|
|
+ }
|
|
free_acl(parsed_acl);
|
|
- );
|
|
+ }
|
|
|
|
done:
|
|
free_xml(orig_diff);
|
|
@@ -264,8 +262,7 @@ unpack_user_acl(xmlNode *xml_acls, const
|
|
return FALSE;
|
|
}
|
|
|
|
- xml_child_iter(
|
|
- xml_acls, xml_acl,
|
|
+ for (xml_acl = __xml_first_child(xml_acls); xml_acl; xml_acl = __xml_next(xml_acl)) {
|
|
const char *tag = crm_element_name(xml_acl);
|
|
const char *id = crm_element_value(xml_acl, XML_ATTR_ID);
|
|
|
|
@@ -276,7 +273,7 @@ unpack_user_acl(xmlNode *xml_acls, const
|
|
return TRUE;
|
|
}
|
|
}
|
|
- );
|
|
+ }
|
|
return FALSE;
|
|
}
|
|
|
|
@@ -296,8 +293,7 @@ user_match(const char *user, const char
|
|
static gboolean
|
|
unpack_acl(xmlNode *xml_acls, xmlNode *xml_acl, GListPtr *acl)
|
|
{
|
|
- xml_child_iter(
|
|
- xml_acl, acl_child,
|
|
+ for (acl_child = __xml_first_child(xml_acl); acl_child; acl_child = __xml_next(acl_child)) {
|
|
const char *tag = crm_element_name(acl_child);
|
|
|
|
if (crm_str_eq(XML_ACL_TAG_ROLE_REF, tag, TRUE)) {
|
|
@@ -316,8 +312,8 @@ unpack_acl(xmlNode *xml_acls, xmlNode *x
|
|
static gboolean
|
|
unpack_role_acl(xmlNode *xml_acls, const char *role, GListPtr *acl)
|
|
{
|
|
- xml_child_iter_filter(
|
|
- xml_acls, xml_acl, XML_ACL_TAG_ROLE,
|
|
+ for (xml_acl = __xml_first_child(xml_acls); xml_acl; xml_acl = __xml_next(xml_acl)) {
|
|
+ if(crm_str_eq(XML_ACL_TAG_ROLE, (const char *)child->name, TRUE)) {
|
|
const char *role_id = crm_element_value(xml_acl, XML_ATTR_ID);
|
|
|
|
if (role_id && crm_str_eq(role, role_id, TRUE)) {
|
|
@@ -325,7 +321,8 @@ unpack_role_acl(xmlNode *xml_acls, const
|
|
unpack_acl(xml_acls, xml_acl, acl);
|
|
return TRUE;
|
|
}
|
|
- );
|
|
+ }
|
|
+ }
|
|
return FALSE;
|
|
}
|
|
|
|
@@ -495,12 +492,11 @@ search_xml_children(GListPtr *children,
|
|
}
|
|
|
|
if(search_matches || match_found == 0) {
|
|
- xml_child_iter(
|
|
- root, child,
|
|
+ for (child = __xml_first_child(root); child; child = __xml_next(child)) {
|
|
match_found += search_xml_children(
|
|
children, child, tag, field, value,
|
|
search_matches);
|
|
- );
|
|
+ }
|
|
}
|
|
|
|
return match_found;
|
|
@@ -563,10 +559,9 @@ update_xml_perms(xmlNode *xml, acl_obj_t
|
|
crm_debug_3("Permission for element: element_mode=%s, tag=%s, id=%s",
|
|
perm->mode, crm_element_name(xml), crm_element_value(xml, XML_ATTR_ID));
|
|
|
|
- xml_child_iter(
|
|
- xml, child,
|
|
+ for (child = __xml_first_child(root); child; child = __xml_next(child)) {
|
|
update_xml_children_perms(child, perm->mode, xml_perms);
|
|
- );
|
|
+ }
|
|
|
|
} else {
|
|
if (perm->attribute_perms == NULL
|
|
@@ -610,10 +605,9 @@ update_xml_children_perms(xmlNode *xml,
|
|
crm_debug_4("Permission for child element: element_mode=%s, tag=%s, id=%s",
|
|
mode, crm_element_name(xml), crm_element_value(xml, XML_ATTR_ID));
|
|
|
|
- xml_child_iter(
|
|
- xml, child,
|
|
+ for (child = __xml_first_child(root); child; child = __xml_next(child)) {
|
|
update_xml_children_perms(child, mode, xml_perms);
|
|
- );
|
|
+ }
|
|
|
|
return TRUE;
|
|
}
|
|
@@ -647,12 +641,11 @@ acl_filter_xml(xmlNode *xml, GHashTable
|
|
xml_perm_t *perm = NULL;
|
|
int allow_counter = 0;
|
|
|
|
- xml_child_iter(
|
|
- xml, child,
|
|
+ for (child = __xml_first_child(xml); child; child = __xml_next(child)) {
|
|
if (acl_filter_xml(child, xml_perms) == FALSE) {
|
|
children_counter++;
|
|
}
|
|
- );
|
|
+ }
|
|
|
|
g_hash_table_lookup_extended(xml_perms, xml, NULL, (gpointer)&perm);
|
|
|
|
@@ -720,12 +713,11 @@ acl_check_diff_xml(xmlNode *xml, GHashTa
|
|
{
|
|
xml_perm_t *perm = NULL;
|
|
|
|
- xml_child_iter(
|
|
- xml, child,
|
|
+ for (child = __xml_first_child(xml); child; child = __xml_next(child)) {
|
|
if (acl_check_diff_xml(child, xml_perms) == FALSE) {
|
|
return FALSE;
|
|
}
|
|
- );
|
|
+ }
|
|
|
|
g_hash_table_lookup_extended(xml_perms, xml, NULL, (gpointer)&perm);
|
|
|