ui/dbus: forward guest clipboard grabs that lack a serial
PATCH 1/1 ui/dbus: forward guest clipboard grabs that lack a serial
dbus_clipboard_update_info() drops any incoming grab whose QemuClipboardInfo has no serial number:
if (self_update || !info->has_serial) {
return;
}For grabs coming from ui/vdagent.c, has_serial is only set when the guest's vdagent client has negotiated VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL (see vdagent_clipboard_recv_grab()). When the guest doesn't negotiate it, the grab is silently dropped here and never forwarded to the D-Bus display client via Clipboard.Grab.
It seems other protocols (ui/gtk-clipboard.c, ui/vnc-clipboard.c) do not incorporate a validation on has_serial, so this patch matches their behavior.
--- ui/dbus-clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ui/dbus-clipboard.c +1 -1
@@ -72,7 +72,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, QemuClipboardInfo *info)return ; } -if (self_update || !info->has_serial) { +if (self_update) {return ; }
Signature · 1 line
2.55.0
Hi
Quoted 14 lines · Rick Vernam
dbus_clipboard_update_info()drops any incoming grab whose QemuClipboardInfo has no serial number:if (self_update || !info->has_serial) { return; }For grabs coming from
ui/vdagent.c,has_serialis only set when the guest's vdagent client has negotiatedVD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL(seevdagent_clipboard_recv_grab()). When the guest doesn't negotiate it, the grab is silently dropped here and never forwarded to the D-Bus display client via Clipboard.Grab.
Quoted 3 lines
It seems other protocols (
ui/gtk-clipboard.c,ui/vnc-clipboard.c) do not incorporate a validation onhas_serial, so this patch matches their behavior.
But dbus display relies on "serial" being valid. The client has no way to check !info->serial. Iow, the agent must support VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL. When not supported, the clipboard state get out of sync due to races.
Quoted 22 lines
Signed-off-by Rick Vernam <[email protected]>--- ui/dbus-clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ui/dbus-clipboard.c +1
-2@@ -72,7 +72,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, QemuClipboardInfo *info)return ; } -if (self_update || !info->has_serial) { +if (self_update) {return ; } --2.55.0