File pacemaker#3841-0002-Refactor-libcrmservices-Unref-the-dbus-connection.patch of Package pacemaker.38495
From fc0ef6cd7a35c8a38957e1f0a5353cfa5c397979 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Mon, 3 Feb 2025 12:46:41 -0500
Subject: [PATCH 2/2] Refactor: libcrmservices: Unref the dbus connection...
...when we disconnect from the bus. We aren't allowed to close the
connection since we acquired it with dbus_bus_get which makes it a
shared connection. So, this is the best cleanup we can do.
---
lib/services/dbus.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/services/dbus.c b/lib/services/dbus.c
index 0f98ddbd29..44e2386701 100644
--- a/lib/services/dbus.c
+++ b/lib/services/dbus.c
@@ -294,12 +294,12 @@ pcmk_dbus_connect(void)
void
pcmk_dbus_disconnect(DBusConnection *connection)
{
- /* Per the DBus documentation, connections created with
- * dbus_connection_open() are owned by libdbus and should never be closed.
- *
- * @TODO Should we call dbus_connection_unref() here?
+ /* We acquire our dbus connection with dbus_bus_get(), which makes it a
+ * shared connection. Therefore, we can't close or free it here. The
+ * best we can do is decrement the reference count so dbus knows when
+ * there are no more clients connected to it.
*/
- return;
+ dbus_connection_unref(connection);
}
// Custom DBus error names to use
--
2.43.0