From dfc2001b3f681cbd1377a3096781182727f13d24 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 12 Oct 2017 17:06:18 +0200 Subject: Don't validate timestamp on clipboard request The normal Xorg server doesn't check this field, so neither can we as there are applications relying on this leniancy. --- unix/xserver/hw/vnc/vncSelection.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'unix') diff --git a/unix/xserver/hw/vnc/vncSelection.c b/unix/xserver/hw/vnc/vncSelection.c index 6a8fdc31..02a1cd1e 100644 --- a/unix/xserver/hw/vnc/vncSelection.c +++ b/unix/xserver/hw/vnc/vncSelection.c @@ -195,7 +195,7 @@ static int vncOwnSelection(Atom selection) static int vncConvertSelection(ClientPtr client, Atom selection, Atom target, Atom property, - Window requestor, TimeStamp time) + Window requestor, CARD32 time) { Selection *pSel; WindowPtr pWin; @@ -212,8 +212,8 @@ static int vncConvertSelection(ClientPtr client, Atom selection, if (rc != Success) return rc; - if (CompareTimeStamps(time, pSel->lastTimeChanged) != LATER) - return BadMatch; + /* We do not validate the time argument because neither does + * dix/selection.c and some clients (e.g. Qt) relies on this */ rc = dixLookupWindow(&pWin, requestor, client, DixSetAttrAccess); if (rc != Success) @@ -291,7 +291,7 @@ static int vncConvertSelection(ClientPtr client, Atom selection, } event.u.u.type = SelectionNotify; - event.u.selectionNotify.time = time.milliseconds; + event.u.selectionNotify.time = time; event.u.selectionNotify.requestor = requestor; event.u.selectionNotify.selection = selection; event.u.selectionNotify.target = target; @@ -324,11 +324,9 @@ static int vncProcConvertSelection(ClientPtr client) rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess); if (rc == Success && pSel->client == serverClient && pSel->window == wid) { - TimeStamp time; - time = ClientTimeToServerTime(stuff->time); rc = vncConvertSelection(client, stuff->selection, stuff->target, stuff->property, - stuff->requestor, time); + stuff->requestor, stuff->time); if (rc != Success) { xEvent event; -- cgit v1.2.3