Xi: ProcXSetClientPointer should directly check for the client from the id.

The window ID includes the client ID anyway, so we might as well just look up
the client directly instead of trying to get the window first and the client
from the window.

This also fixes a possible issue with XACE. If the client had permission to
write on the client but not on the window, the previous approach would have
failed.
This commit is contained in:
Peter Hutterer 2008-01-03 18:47:28 +10:30
parent 521fdc28d8
commit 9cc41b88df

View File

@ -68,7 +68,6 @@ int
ProcXSetClientPointer(ClientPtr client)
{
DeviceIntPtr pDev;
WindowPtr pWin;
ClientPtr targetClient;
int rc;
@ -88,21 +87,12 @@ ProcXSetClientPointer(ClientPtr client)
if (stuff->win != None)
{
rc = dixLookupWindow(&pWin, stuff->win, client, DixWriteAccess);
rc = dixLookupClient(&targetClient, stuff->win, client,
DixWriteAccess);
if (rc != Success)
{
/* window could not be found. maybe the window ID given was a pure
client id? */
/* XXX: Needs to be fixed for XACE */
rc = dixLookupClient(&targetClient, stuff->win,
client, DixWriteAccess);
if (rc != Success)
{
client->errorValue = stuff->win;
return rc;
}
} else
targetClient= wClient(pWin);
return rc;
} else
targetClient = client;