Blame SOURCES/018-rhbz1907726.patch

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