summary refs log tree commit diff stats
path: root/ui/dbus.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2025-01-13 23:31:33 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2025-02-03 21:15:57 +0400
commitccf86c392c5b8949bafd363e44d3abb112578044 (patch)
tree353a7745e2a5ca81fdde3166264606e4e2b94916 /ui/dbus.c
parentaeb6b818c1816304cdfdf846041e2b2ba0e73aca (diff)
downloadfocaccia-qemu-ccf86c392c5b8949bafd363e44d3abb112578044.tar.gz
focaccia-qemu-ccf86c392c5b8949bafd363e44d3abb112578044.zip
ui/dbus: on win32, allow ANONYMOUS with p2p
GLib doesn't implement EXTERNAL on win32 at the moment, and disables
ANONYMOUS by default. zbus dropped support for COOKIE_SHA1 in 5.0,
making it no longer possible to connect to qemu -display dbus.

Since p2p connections are gated by existing QMP (or a D-Bus connection),
qemu -display dbus p2p can accept authentication with ANONYMOUS.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'ui/dbus.c')
-rw-r--r--ui/dbus.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/dbus.c b/ui/dbus.c
index 7b258c6823..2eb03aa247 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -317,11 +317,17 @@ dbus_display_add_client(int csock, Error **errp)
     conn = g_socket_connection_factory_create_connection(socket);
 
     dbus_display->add_client_cancellable = g_cancellable_new();
+    GDBusConnectionFlags flags =
+        G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER |
+        G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING;
+
+#ifdef WIN32
+    flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
+#endif
 
     g_dbus_connection_new(G_IO_STREAM(conn),
                           guid,
-                          G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER |
-                          G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING,
+                          flags,
                           NULL,
                           dbus_display->add_client_cancellable,
                           dbus_display_add_client_ready,