Skip to content

Commit 10069b4

Browse files
author
Ken Gaillot
authored
Merge pull request #2125 from kgaillot/ipc
Fix: executor: only send executor notifications to executor clients
2 parents aee2846 + f7389ac commit 10069b4

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

daemons/execd/execd_commands.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,15 @@ send_client_notify(gpointer key, gpointer value, gpointer user_data)
507507
crm_trace("Skipping notification to client without name");
508508
return;
509509
}
510+
if (is_set(client->flags, pcmk__client_to_proxy)) {
511+
/* We only want to notify clients of the executor IPC API. If we are
512+
* running as Pacemaker Remote, we may have clients proxied to other
513+
* IPC services in the cluster, so skip those.
514+
*/
515+
crm_trace("Skipping executor API notification to %s IPC client",
516+
client->name);
517+
return;
518+
}
510519

511520
rc = lrmd_server_send_notify(client, update_msg);
512521
if (rc == pcmk_rc_ok) {

daemons/execd/remoted_proxy.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ ipc_proxy_accept(qb_ipcs_connection_t * c, uid_t uid, gid_t gid, const char *ipc
8888
client->userdata = strdup(ipc_proxy->id);
8989
client->name = crm_strdup_printf("proxy-%s-%d-%.8s", ipc_channel, client->pid, client->id);
9090

91+
/* Allow remote executor to distinguish between proxied local clients and
92+
* actual executor API clients
93+
*/
94+
set_bit(client->flags, pcmk__client_to_proxy);
95+
9196
g_hash_table_insert(ipc_clients, client->id, client);
9297

9398
msg = create_xml_node(NULL, T_LRMD_IPC_PROXY);

include/crm/common/ipc_internal.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ struct pcmk__remote_s {
121121
};
122122

123123
enum pcmk__client_flags {
124-
pcmk__client_proxied = 0x00001, /* ipc_proxy code only */
125-
pcmk__client_privileged = 0x00002, /* root or cluster user */
124+
pcmk__client_proxied = (1 << 0), // Remote client behind proxy
125+
pcmk__client_privileged = (1 << 1), // root or cluster user
126+
pcmk__client_to_proxy = (1 << 2), // Local client to be proxied
126127
};
127128

128129
struct pcmk__client_s {

0 commit comments

Comments
 (0)