xace: add hooks + new access codes: core protocol selection requests
This commit is contained in:
parent
3ef2e9e623
commit
0a994d4f85
|
@ -980,9 +980,10 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
|
int rc;
|
||||||
REQUEST(xSetSelectionOwnerReq);
|
REQUEST(xSetSelectionOwnerReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
|
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
|
||||||
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
time = ClientTimeToServerTime(stuff->time);
|
||||||
|
|
||||||
|
@ -992,7 +993,7 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
if (stuff->window != None)
|
if (stuff->window != None)
|
||||||
{
|
{
|
||||||
int rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -1012,6 +1013,10 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
{
|
{
|
||||||
xEvent event;
|
xEvent event;
|
||||||
|
|
||||||
|
rc = XaceHook(XACE_SELECTION_ACCESS, client, CurrentSelections[i],
|
||||||
|
DixSetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
/* If the timestamp in client's request is in the past relative
|
/* If the timestamp in client's request is in the past relative
|
||||||
to the time stamp indicating the last time the owner of the
|
to the time stamp indicating the last time the owner of the
|
||||||
selection was set, do not set the selection, just return
|
selection was set, do not set the selection, just return
|
||||||
|
@ -1049,6 +1054,10 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
CurrentSelections = newsels;
|
CurrentSelections = newsels;
|
||||||
CurrentSelections[i].selection = stuff->selection;
|
CurrentSelections[i].selection = stuff->selection;
|
||||||
CurrentSelections[i].devPrivates = NULL;
|
CurrentSelections[i].devPrivates = NULL;
|
||||||
|
rc = XaceHook(XACE_SELECTION_ACCESS, CurrentSelections[i],
|
||||||
|
DixSetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
dixFreePrivates(CurrentSelections[i].devPrivates);
|
dixFreePrivates(CurrentSelections[i].devPrivates);
|
||||||
CurrentSelections[i].lastTimeChanged = time;
|
CurrentSelections[i].lastTimeChanged = time;
|
||||||
|
@ -1094,7 +1103,7 @@ ProcGetSelectionOwner(ClientPtr client)
|
||||||
reply.sequenceNumber = client->sequence;
|
reply.sequenceNumber = client->sequence;
|
||||||
if (i < NumCurrentSelections &&
|
if (i < NumCurrentSelections &&
|
||||||
XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i],
|
XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i],
|
||||||
DixReadAccess) == Success)
|
DixGetAttrAccess) == Success)
|
||||||
reply.owner = CurrentSelections[i].destwindow;
|
reply.owner = CurrentSelections[i].destwindow;
|
||||||
else
|
else
|
||||||
reply.owner = None;
|
reply.owner = None;
|
||||||
|
@ -1118,7 +1127,7 @@ ProcConvertSelection(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xConvertSelectionReq);
|
REQUEST_SIZE_MATCH(xConvertSelectionReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->requestor, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->requestor, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue