From 9da1e56ee334270a63cd1e9c97fc1c27ab335598 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Oct 07 2025 18:53:50 +0000 Subject: Initialize UID/PID when using a private listening socket When using a private socket certmonger has to directly read the UID and PID from the client rather than querying the dbus connection. The variable passed into the method calls was not being initialized with these values. Confusingly the values that the memory pointed to were the two reversed (uid=pid/pid=uid). This broke the pre_certsave_uid and post_certsave_uid options by saving invalid values therefore they could not be triggered. Fixes: https://pagure.io/certmonger/issue/298 Signed-off-by: Rob Crittenden --- diff --git a/src/tdbush.c b/src/tdbush.c index d440863..b2413c3 100644 --- a/src/tdbush.c +++ b/src/tdbush.c @@ -8035,7 +8035,6 @@ cm_tdbush_handle_method_call(DBusConnection *conn, DBusMessage *msg, struct cm_tdbush_interface *iface; struct cm_tdbush_interface_item *item; struct cm_tdbush_method *meth; - struct cm_client_info self; unsigned int i; memset(&pending, 0, sizeof(pending)); @@ -8075,6 +8074,7 @@ cm_tdbush_handle_method_call(DBusConnection *conn, DBusMessage *msg, /* "private": no bus daemon, so identify the client */ if (bus == cm_tdbus_private) { + struct cm_client_info self; /* just run the method */ if (cm_tdbush_read_conn_id(conn, &pending.cm_uid, @@ -8089,6 +8089,8 @@ cm_tdbush_handle_method_call(DBusConnection *conn, DBusMessage *msg, "not the same as ours, " "ignoring.\n"); } else { + self.uid = pending.cm_uid; + self.pid = pending.cm_pid; cm_log(4, "User ID %lu PID %lu " "called %s:%s.%s.\n", (unsigned long) pending.cm_uid,