Blame SOURCES/0109-Fix-attrd-Hook-up-the-client-name-so-we-can-track-re.patch

0240e4
From 6968a8b8c48a63af8c813ed47652662cbce837be Mon Sep 17 00:00:00 2001
0240e4
From: Andrew Beekhof <andrew@beekhof.net>
0240e4
Date: Thu, 7 Jan 2016 11:28:14 +1100
0240e4
Subject: [PATCH] Fix: attrd: Hook up the client name so we can track requests
0240e4
0240e4
---
0240e4
 attrd/main.c | 5 +++++
0240e4
 1 file changed, 5 insertions(+)
0240e4
0240e4
diff --git a/attrd/main.c b/attrd/main.c
0240e4
index 069e9fa..0198396 100644
0240e4
--- a/attrd/main.c
0240e4
+++ b/attrd/main.c
0240e4
@@ -226,6 +226,11 @@ attrd_ipc_dispatch(qb_ipcs_connection_t * c, void *data, size_t size)
0240e4
 
0240e4
     op = crm_element_value(xml, F_ATTRD_TASK);
0240e4
 
0240e4
+    if (client->name == NULL) {
0240e4
+        const char *value = crm_element_value(xml, F_ORIG);
0240e4
+        client->name = crm_strdup_printf("%s.%d", value?value:"unknown", client->pid);
0240e4
+    }
0240e4
+
0240e4
     if (safe_str_eq(op, ATTRD_OP_PEER_REMOVE)) {
0240e4
         attrd_send_ack(client, id, flags);
0240e4
         attrd_client_peer_remove(client->name, xml);
0240e4
-- 
0240e4
1.8.3.1
0240e4