Blame SOURCES/018-rhbz1907726.patch

a216ed
From c3e2edb78e6d0b6ffc8acbe8fc7caef058b35d76 Mon Sep 17 00:00:00 2001
a216ed
From: Reid Wahl <nrwahl@protonmail.com>
a216ed
Date: Tue, 22 Dec 2020 22:28:46 -0800
a216ed
Subject: [PATCH] Fix: liblrmd: Limit node name addition to proxied attrd
a216ed
 update commands
a216ed
a216ed
remote_proxy_cb() currently adds the remote node's name as
a216ed
PCMK__XA_ATTR_NODE_NAME if that attribute is not explicitly set. This is
a216ed
necessary for attrd update commands. For those, lack of an explicit node
a216ed
name means to use the local node. Since requests are proxied to full
a216ed
nodes, the node hosting the remote resource would be incorrectly treated
a216ed
as the "local node", causing the attribute to be updated for the wrong
a216ed
node.
a216ed
a216ed
However, for other commands, this is not the case. Lack of an explicit
a216ed
node name can mean "all nodes" (as for CLEAR_FAILURE and QUERY), or a
a216ed
node name may be ignored (as for REFRESH). In these cases (the
a216ed
non-update commands), we don't want to add a node name automatically if
a216ed
it's not explicitly set.
a216ed
a216ed
Resolves: RHBZ#1907726
a216ed
a216ed
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
a216ed
---
a216ed
 lib/lrmd/proxy_common.c | 6 +++++-
a216ed
 1 file changed, 5 insertions(+), 1 deletion(-)
a216ed
a216ed
diff --git a/lib/lrmd/proxy_common.c b/lib/lrmd/proxy_common.c
a216ed
index b8d889e..0f1e76a 100644
a216ed
--- a/lib/lrmd/proxy_common.c
a216ed
+++ b/lib/lrmd/proxy_common.c
a216ed
@@ -259,7 +259,11 @@ remote_proxy_cb(lrmd_t *lrmd, const char *node_name, xmlNode *msg)
a216ed
 
a216ed
             if (pcmk__str_eq(type, T_ATTRD, pcmk__str_casei)
a216ed
                 && crm_element_value(request,
a216ed
-                                     PCMK__XA_ATTR_NODE_NAME) == NULL) {
a216ed
+                                     PCMK__XA_ATTR_NODE_NAME) == NULL
a216ed
+                && pcmk__str_any_of(crm_element_value(request, PCMK__XA_TASK),
a216ed
+                                    PCMK__ATTRD_CMD_UPDATE,
a216ed
+                                    PCMK__ATTRD_CMD_UPDATE_BOTH,
a216ed
+                                    PCMK__ATTRD_CMD_UPDATE_DELAY, NULL)) {
a216ed
                 crm_xml_add(request, PCMK__XA_ATTR_NODE_NAME, proxy->node_name);
a216ed
             }
a216ed
 
a216ed
-- 
a216ed
1.8.3.1
a216ed