summaryrefslogtreecommitdiff
path: root/daemon/gdm-dbus-util.c
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2021-03-10 11:43:00 +0100
committerRay Strode <halfline@gmail.com>2021-03-15 13:35:30 +0000
commit527186cef3d87c641e0f767a59a6f23d24118e72 (patch)
tree4e7cd57ff865bbfc6e00f1f106212e7b4c50e4ee /daemon/gdm-dbus-util.c
parent6e0d2d74b4ba8fe003e0e0e4528adfd14435df92 (diff)
downloadgdm-527186cef3d87c641e0f767a59a6f23d24118e72.tar.gz
session: Initialize DBus error domain before resolving errors
We would not initialize the DBus error domain before we retrieved the first error, but only did so to compare the error after receiving them. This means that the first error we received will not be resolved correctly, while all subsequent ones are resolved. Fix this by calling GDM_SESSION_WORKER_ERROR from gdm_session_class_init and add gdm_dbus_error_ensure to make sure this can never be optimized away.
Diffstat (limited to 'daemon/gdm-dbus-util.c')
-rw-r--r--daemon/gdm-dbus-util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/daemon/gdm-dbus-util.c b/daemon/gdm-dbus-util.c
index b71da7fd..844d60ab 100644
--- a/daemon/gdm-dbus-util.c
+++ b/daemon/gdm-dbus-util.c
@@ -183,3 +183,17 @@ gdm_dbus_get_uid_for_name (const char *system_bus_name,
return retval;
}
+
+void
+gdm_dbus_error_ensure (GQuark domain)
+{
+ /* The primary purpose of this function is to make sure the error quark
+ * is registered internally with gdbus before any bus traffic occurs,
+ * so we get remote errors mapped correctly to their local counterparts.
+ * This error quark registration happens implicitly the first time the
+ * quark is used.
+ * Note that g_debug is never optimized away, only the output is suppressed.
+ */
+ g_debug ("GdmDBusUtils: Registered DBus error domain '%s'",
+ g_quark_to_string (domain));
+}