[glib] gdbusaddress: Disable proxy support for D-Bus addresses
- From: Philip Withnall <pwithnall src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [glib] gdbusaddress: Disable proxy support for D-Bus addresses
 
- Date: Wed, 31 Jan 2018 22:32:55 +0000 (UTC)
 
commit 4752d72a601787ef5a2249674a3ff887f42320e6
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jan 31 22:21:55 2018 +0000
    gdbusaddress: Disable proxy support for D-Bus addresses
    
    See the discussion in the bug report: with proxy support enabled, a
    proxy resolver is created. Doing that will load all the GIO modules, and
    typically at least one of them will try to use GDBus during
    initialisation, which will cause a deadlock.
    
    Using a TCP address with GDBusAddress is still supported, but accessing
    it over a proxy is not.
    
    Document this.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792499
 gio/gdbusaddress.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
index faee800..2191c11 100644
--- a/gio/gdbusaddress.c
+++ b/gio/gdbusaddress.c
@@ -66,6 +66,9 @@
  * like `unix:tmpdir=/tmp/my-app-name`. The exact format of addresses
  * is explained in detail in the
  * [D-Bus specification](http://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
+ *
+ * TCP D-Bus connections are supported, but accessing them via a proxy is
+ * currently not supported.
  */
 
 static gchar *get_session_address_platform_specific (GError **error);
@@ -675,6 +678,13 @@ g_dbus_address_connect (const gchar   *address_entry,
 
       g_assert (ret == NULL);
       client = g_socket_client_new ();
+
+      /* Disable proxy support to prevent a deadlock on startup, since loading a
+       * proxy resolver causes the GIO modules to be loaded, and there will
+       * almost certainly be one of them which then tries to use GDBus.
+       * See: https://bugzilla.gnome.org/show_bug.cgi?id=792499 */
+      g_socket_client_set_enable_proxy (client, FALSE);
+
       connection = g_socket_client_connect (client,
                                             connectable,
                                             cancellable,
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]