xace: Add a "manage" access check when setting the Redirect event bits.
This commit is contained in:
parent
7d14ca59c5
commit
8c6923018c
10
dix/events.c
10
dix/events.c
|
@ -3330,6 +3330,8 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
|
||||||
|
|
||||||
#define AtMostOneClient \
|
#define AtMostOneClient \
|
||||||
(SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask)
|
(SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask)
|
||||||
|
#define ManagerMask \
|
||||||
|
(SubstructureRedirectMask | ResizeRedirectMask)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculate which events may be deliverable for the given window.
|
* Recalculate which events may be deliverable for the given window.
|
||||||
|
@ -3418,12 +3420,20 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask)
|
||||||
{
|
{
|
||||||
Mask check;
|
Mask check;
|
||||||
OtherClients * others;
|
OtherClients * others;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (mask & ~AllEventMasks)
|
if (mask & ~AllEventMasks)
|
||||||
{
|
{
|
||||||
client->errorValue = mask;
|
client->errorValue = mask;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
check = (mask & ManagerMask);
|
||||||
|
if (check) {
|
||||||
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||||
|
RT_WINDOW, pWin, RT_NONE, NULL, DixManageAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
check = (mask & AtMostOneClient);
|
check = (mask & AtMostOneClient);
|
||||||
if (check & (pWin->eventMask|wOtherEventMasks(pWin)))
|
if (check & (pWin->eventMask|wOtherEventMasks(pWin)))
|
||||||
{ /* It is illegal for two different
|
{ /* It is illegal for two different
|
||||||
|
|
Loading…
Reference in New Issue