Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
pacemaker.3577
pacemaker-libcrmcommon-xml-log-comments.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-libcrmcommon-xml-log-comments.patch of Package pacemaker.3577
commit 5271740889d5886ef1c2d622b8df876693c59a45 Author: Ken Gaillot <kgaillot@redhat.com> Date: Wed Jul 6 16:45:59 2016 -0500 Fix: libcrmcommon: log XML comments correctly Previously, the library would log spurious close tags like: trace: cib_common_callback: Client[inbound] <!-- comment -->/> diff --git a/lib/common/xml.c b/lib/common/xml.c index 3e3186e..97eb2dd 100644 --- a/lib/common/xml.c +++ b/lib/common/xml.c @@ -3488,48 +3488,47 @@ __xml_log_element(int log_level, const char *file, const char *function, int lin char *buffer = NULL; insert_prefix(options, &buffer, &offset, &max, depth); - if(data->type == XML_COMMENT_NODE) { - buffer_print(buffer, max, offset, "<!--"); - buffer_print(buffer, max, offset, "%s", data->content); - buffer_print(buffer, max, offset, "-->"); + + if (data->type == XML_COMMENT_NODE) { + buffer_print(buffer, max, offset, "<!--%s-->", data->content); } else { buffer_print(buffer, max, offset, "<%s", name); - } - hidden = crm_element_value(data, "hidden"); - for (pIter = crm_first_attr(data); pIter != NULL; pIter = pIter->next) { - xml_private_t *p = pIter->_private; - const char *p_name = (const char *)pIter->name; - const char *p_value = crm_attr_value(pIter); - char *p_copy = NULL; + hidden = crm_element_value(data, "hidden"); + for (pIter = crm_first_attr(data); pIter != NULL; pIter = pIter->next) { + xml_private_t *p = pIter->_private; + const char *p_name = (const char *)pIter->name; + const char *p_value = crm_attr_value(pIter); + char *p_copy = NULL; - if(is_set(p->flags, xpf_deleted)) { - continue; - } else if ((is_set(options, xml_log_option_diff_plus) - || is_set(options, xml_log_option_diff_minus)) - && strcmp(XML_DIFF_MARKER, p_name) == 0) { - continue; + if(is_set(p->flags, xpf_deleted)) { + continue; + } else if ((is_set(options, xml_log_option_diff_plus) + || is_set(options, xml_log_option_diff_minus)) + && strcmp(XML_DIFF_MARKER, p_name) == 0) { + continue; - } else if (hidden != NULL && p_name[0] != 0 && strstr(hidden, p_name) != NULL) { - p_copy = strdup("*****"); + } else if (hidden != NULL && p_name[0] != 0 && strstr(hidden, p_name) != NULL) { + p_copy = strdup("*****"); - } else { - p_copy = crm_xml_escape(p_value); - } + } else { + p_copy = crm_xml_escape(p_value); + } - buffer_print(buffer, max, offset, " %s=\"%s\"", p_name, p_copy); - free(p_copy); - } + buffer_print(buffer, max, offset, " %s=\"%s\"", p_name, p_copy); + free(p_copy); + } - if(xml_has_children(data) == FALSE) { - buffer_print(buffer, max, offset, "/>"); + if(xml_has_children(data) == FALSE) { + buffer_print(buffer, max, offset, "/>"); - } else if(is_set(options, xml_log_option_children)) { - buffer_print(buffer, max, offset, ">"); + } else if(is_set(options, xml_log_option_children)) { + buffer_print(buffer, max, offset, ">"); - } else { - buffer_print(buffer, max, offset, "/>"); + } else { + buffer_print(buffer, max, offset, "/>"); + } } do_crm_log_alias(log_level, file, function, line, "%s %s", prefix, buffer);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor