pacemaker/SOURCES/018-rhbz1907726.patch
2021-08-28 18:45:44 +00:00

48 lines
2.0 KiB
Diff

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