File pacemaker#3333-0001-Low-pacemaker-attrd-properly-validate-attribute-set-.patch of Package pacemaker
From 6d959770aba8db5adfc44cb3575b3e89265efee9 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 16 Jan 2024 11:20:53 -0600
Subject: [PATCH 1/2] Low: pacemaker-attrd: properly validate attribute set
type
The sense of the test was accidentally reversed in 26471a52689
---
daemons/attrd/attrd_attributes.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Index: pacemaker-2.1.7+20231219.0f7f88312/daemons/attrd/attrd_attributes.c
===================================================================
--- pacemaker-2.1.7+20231219.0f7f88312.orig/daemons/attrd/attrd_attributes.c
+++ pacemaker-2.1.7+20231219.0f7f88312/daemons/attrd/attrd_attributes.c
@@ -40,9 +40,9 @@ attrd_create_attribute(xmlNode *xml)
* attributes are not written.
*/
crm_element_value_int(xml, PCMK__XA_ATTR_IS_PRIVATE, &is_private);
- if ((is_private != 0)
- && !pcmk__str_any_of(set_type, XML_TAG_ATTR_SETS, XML_TAG_UTILIZATION,
- NULL)) {
+ if (!is_private && !pcmk__str_any_of(set_type,
+ XML_TAG_ATTR_SETS,
+ XML_TAG_UTILIZATION, NULL)) {
crm_warn("Ignoring attribute %s with invalid set type %s",
pcmk__s(name, "(unidentified)"), set_type);
return NULL;