File pacemaker#3608-0001-Log-pacemaker-based-client-name-can-be-NULL.patch of Package pacemaker.38493

From 78e350275174883f64ca36ffd0523735a3ece2b2 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 30 Jul 2024 17:27:14 -0500
Subject: [PATCH] Log: pacemaker-based: client name can be NULL

---
 daemons/based/based_callbacks.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: pacemaker-2.1.5+20221208.a3f44794f/daemons/based/based_callbacks.c
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/daemons/based/based_callbacks.c
+++ pacemaker-2.1.5+20221208.a3f44794f/daemons/based/based_callbacks.c
@@ -968,10 +968,12 @@ cib_process_request(xmlNode *request, gb
 
     if (cib_client == NULL) {
         crm_trace("Processing peer %s operation from %s/%s on %s intended for %s (reply=%s)",
-                  op, client_name, call_id, originator, target, reply_to);
+                  op, pcmk__s(client_name, "client"), call_id, originator,
+                  target, reply_to);
     } else {
         crm_xml_add(request, F_ORIG, cib_our_uname);
-        crm_trace("Processing local %s operation from %s/%s intended for %s", op, client_name, call_id, target);
+        crm_trace("Processing local %s operation from %s/%s intended for %s",
+                  op, pcmk__s(client_name, "client"), call_id, target);
     }
 
     rc = cib_get_operation_id(op, &call_type);
@@ -1073,7 +1075,8 @@ cib_process_request(xmlNode *request, gb
         do_crm_log(level,
                    "Completed %s operation for section %s: %s (rc=%d, origin=%s/%s/%s, version=%s.%s.%s)",
                    op, section ? section : "'all'", pcmk_strerror(rc), rc,
-                   originator ? originator : "local", client_name, call_id,
+                   originator ? originator : "local",
+                   pcmk__s(client_name, "client"), call_id,
                    the_cib ? crm_element_value(the_cib, XML_ATTR_GENERATION_ADMIN) : "0",
                    the_cib ? crm_element_value(the_cib, XML_ATTR_GENERATION) : "0",
                    the_cib ? crm_element_value(the_cib, XML_ATTR_NUMUPDATES) : "0");
@@ -1094,7 +1097,8 @@ cib_process_request(xmlNode *request, gb
 
     if (is_update && !cib_legacy_mode()) {
         crm_trace("Completed pre-sync update from %s/%s/%s%s",
-                  originator ? originator : "local", client_name, call_id,
+                  originator ? originator : "local",
+                  pcmk__s(client_name, "client"), call_id,
                   local_notify?" with local notification":"");
 
     } else if (!needs_reply || stand_alone) {
openSUSE Build Service is sponsored by