From ccf86c392c5b8949bafd363e44d3abb112578044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 13 Jan 2025 23:31:33 +0400 Subject: ui/dbus: on win32, allow ANONYMOUS with p2p MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/dbus.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ui/dbus.c') diff --git a/ui/dbus.c b/ui/dbus.c index 7b258c6..2eb03aa 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, -- cgit v1.1