summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-10-23 13:35:30 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-10-23 13:35:30 -0400
commit9e0a468af19d8e46330bcff37c9adc5e11d3aee7 (patch)
tree475aecda244d28657f26e6fb31ab88a2c97f2c41 /dix
parentce7f6fe1268fef4f89aa21c7b44d73ecd98efe24 (diff)
xace: try to pretend events were sent when a denial occurs.
Probably need to redo the error return paths in these functions at some point.
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/dix/events.c b/dix/events.c
index 246220f59..24de94767 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1754,7 +1754,7 @@ DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count,
!((wOtherEventMasks(pWin)|pWin->eventMask) & filter))
return 0;
if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
- nondeliveries--;
+ /* do nothing */;
else if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count,
pWin->eventMask, filter, grab)) )
{
@@ -1785,7 +1785,7 @@ DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count,
{
if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents,
count))
- nondeliveries--;
+ /* do nothing */;
else if ( (attempt = TryClientEvents(rClient(other), pEvents, count,
other->mask[mskidx], filter, grab)) )
{
@@ -1884,7 +1884,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
wClient(pWin), NullGrab, pWin->eventMask, filter);
#endif
if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
- return 0;
+ return 1; /* don't send, but pretend we did */
return TryClientEvents(wClient(pWin), pEvents, count,
pWin->eventMask, filter, NullGrab);
}
@@ -1901,7 +1901,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
#endif
if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents,
count))
- return 0;
+ return 1; /* don't send, but pretend we did */
return TryClientEvents(rClient(other), pEvents, count,
other->mask, filter, NullGrab);
}
@@ -2896,9 +2896,9 @@ DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count)
if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count))
return;
}
- /* just deliver it to the focus window */
if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, xE, count))
return;
+ /* just deliver it to the focus window */
FixUpEventFromWindow(xE, focus, None, FALSE);
if (xE->u.u.type & EXTENSION_EVENT_BASE)
mskidx = keybd->id;
@@ -2947,9 +2947,11 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
if (!deliveries)
{
FixUpEventFromWindow(xE, grab->window, None, TRUE);
- if (!XaceHook(XACE_SEND_ACCESS, 0, thisDev, grab->window, xE, count) &&
- !XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), grab->window, xE,
- count))
+ if (XaceHook(XACE_SEND_ACCESS, 0, thisDev, grab->window, xE, count) ||
+ XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), grab->window, xE,
+ count))
+ deliveries = 1; /* don't send, but pretend we did */
+ else
deliveries = TryClientEvents(rClient(grab), xE, count,
(Mask)grab->eventMask,
filters[xE->u.u.type], grab);