mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xace: typesafe hook function for XACE_RESOURCE_ACCESS
The generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556>
(cherry picked from commit ae3c573337)
This commit is contained in:
committed by
Alan Coopersmith
parent
9af1201dad
commit
bd324c0c2a
10
dix/window.c
10
dix/window.c
@@ -636,7 +636,7 @@ CreateRootWindow(ScreenPtr pScreen)
|
||||
|
||||
/* security creation/labeling check
|
||||
*/
|
||||
if (XaceHook(XACE_RESOURCE_ACCESS, serverClient, pWin->drawable.id,
|
||||
if (XaceHookResourceAccess(serverClient, pWin->drawable.id,
|
||||
X11_RESTYPE_WINDOW, pWin, X11_RESTYPE_NONE, NULL, DixCreateAccess))
|
||||
return FALSE;
|
||||
|
||||
@@ -865,7 +865,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
||||
|
||||
/* security creation/labeling check
|
||||
*/
|
||||
*error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, X11_RESTYPE_WINDOW, pWin,
|
||||
*error = XaceHookResourceAccess(client, wid, X11_RESTYPE_WINDOW, pWin,
|
||||
X11_RESTYPE_WINDOW, pWin->parent,
|
||||
DixCreateAccess | DixSetAttrAccess);
|
||||
if (*error != Success) {
|
||||
@@ -1113,7 +1113,7 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||
*/
|
||||
UnmapSubwindows(pWin);
|
||||
while (pWin->lastChild) {
|
||||
int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||
int rc = XaceHookResourceAccess(client,
|
||||
pWin->lastChild->drawable.id, X11_RESTYPE_WINDOW,
|
||||
pWin->lastChild, X11_RESTYPE_NONE, NULL, DixDestroyAccess);
|
||||
|
||||
@@ -1395,7 +1395,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||
goto PatchUp;
|
||||
}
|
||||
if (val == xTrue) {
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||
rc = XaceHookResourceAccess(client, pWin->drawable.id,
|
||||
X11_RESTYPE_WINDOW, pWin, X11_RESTYPE_NONE, NULL, DixGrabAccess);
|
||||
if (rc != Success) {
|
||||
error = rc;
|
||||
@@ -2662,7 +2662,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
|
||||
return Success;
|
||||
|
||||
/* general check for permission to map window */
|
||||
if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, X11_RESTYPE_WINDOW,
|
||||
if (XaceHookResourceAccess(client, pWin->drawable.id, X11_RESTYPE_WINDOW,
|
||||
pWin, X11_RESTYPE_NONE, NULL, DixShowAccess) != Success)
|
||||
return Success;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user