mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
aeb6b818c1
commit
ccf86c392c
3 changed files with 22 additions and 4 deletions
|
@ -524,11 +524,17 @@ dbus_audio_register_listener(AudioState *s,
|
|||
);
|
||||
}
|
||||
|
||||
GDBusConnectionFlags flags =
|
||||
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER;
|
||||
#ifdef WIN32
|
||||
flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
|
||||
#endif
|
||||
|
||||
listener_conn =
|
||||
g_dbus_connection_new_sync(
|
||||
G_IO_STREAM(socket_conn),
|
||||
guid,
|
||||
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER,
|
||||
flags,
|
||||
NULL, NULL, &err);
|
||||
if (err) {
|
||||
error_report("Failed to setup peer connection: %s", err->message);
|
||||
|
|
|
@ -305,10 +305,16 @@ dbus_console_register_listener(DBusDisplayConsole *ddc,
|
|||
#endif
|
||||
);
|
||||
|
||||
GDBusConnectionFlags flags =
|
||||
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER;
|
||||
#ifdef WIN32
|
||||
flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
|
||||
#endif
|
||||
|
||||
listener_conn = g_dbus_connection_new_sync(
|
||||
G_IO_STREAM(socket_conn),
|
||||
guid,
|
||||
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER,
|
||||
flags,
|
||||
NULL, NULL, &err);
|
||||
if (err) {
|
||||
error_report("Failed to setup peer connection: %s", err->message);
|
||||
|
|
10
ui/dbus.c
10
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue