mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xace: add new fields to resource access hook to allow parent resource objects
to be passed in at create time. Also added a missing devPrivates initializer.
This commit is contained in:
@@ -397,7 +397,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
|
||||
* Security creation/labeling check
|
||||
*/
|
||||
i = XaceHook(XACE_RESOURCE_ACCESS, clients[client], mid, RT_COLORMAP,
|
||||
DixCreateAccess, pmap);
|
||||
pmap, RT_NONE, NULL, DixCreateAccess);
|
||||
if (i != Success) {
|
||||
FreeResource(mid, RT_NONE);
|
||||
return i;
|
||||
|
||||
@@ -212,12 +212,12 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
|
||||
pCurs->backGreen = backGreen;
|
||||
pCurs->backBlue = backBlue;
|
||||
|
||||
pCurs->devPrivates = NULL;
|
||||
pCurs->id = cid;
|
||||
pCurs->devPrivates = NULL;
|
||||
|
||||
/* security creation/labeling check */
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR,
|
||||
DixCreateAccess, pCurs);
|
||||
pCurs, RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
dixFreePrivates(pCurs->devPrivates);
|
||||
FreeCursorBits(bits);
|
||||
@@ -365,6 +365,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||
bits->height = cm.height;
|
||||
bits->xhot = cm.xhot;
|
||||
bits->yhot = cm.yhot;
|
||||
bits->devPrivates = NULL;
|
||||
if (sourcefont != maskfont)
|
||||
bits->refcnt = -1;
|
||||
else
|
||||
@@ -406,7 +407,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||
|
||||
/* security creation/labeling check */
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR,
|
||||
DixCreateAccess, pCurs);
|
||||
pCurs, RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
dixFreePrivates(pCurs->devPrivates);
|
||||
FreeCursorBits(bits);
|
||||
|
||||
@@ -1558,7 +1558,7 @@ CreatePmap:
|
||||
pMap->drawable.id = stuff->pid;
|
||||
/* security creation/labeling check */
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||
DixCreateAccess, pMap);
|
||||
pMap, RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
(*pDraw->pScreen->DestroyPixmap)(pMap);
|
||||
return rc;
|
||||
|
||||
4
dix/gc.c
4
dix/gc.c
@@ -638,8 +638,8 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
|
||||
pGC->stipple->refcnt++;
|
||||
|
||||
/* security creation/labeling check */
|
||||
*pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC,
|
||||
DixCreateAccess|DixSetAttrAccess, pGC);
|
||||
*pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC,
|
||||
RT_NONE, NULL, DixCreateAccess|DixSetAttrAccess);
|
||||
if (*pStatus != Success)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -901,7 +901,7 @@ dixLookupResource(pointer *result, XID id, RESTYPE rtype,
|
||||
if (client) {
|
||||
client->errorValue = id;
|
||||
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
|
||||
mode, res->value);
|
||||
res->value, RT_NONE, NULL, mode);
|
||||
if (cid != Success)
|
||||
return cid;
|
||||
}
|
||||
|
||||
10
dix/window.c
10
dix/window.c
@@ -698,8 +698,8 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
||||
|
||||
/* security creation/labeling check
|
||||
*/
|
||||
*error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW,
|
||||
DixCreateAccess|DixSetAttrAccess, pWin);
|
||||
*error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW, pWin,
|
||||
RT_WINDOW, pWin->parent, DixCreateAccess|DixSetAttrAccess);
|
||||
if (*error != Success) {
|
||||
xfree(pWin);
|
||||
return NullWindow;
|
||||
@@ -955,7 +955,7 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||
while (pWin->lastChild) {
|
||||
int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||
pWin->lastChild->drawable.id, RT_WINDOW,
|
||||
DixDestroyAccess, pWin->lastChild);
|
||||
pWin->lastChild, RT_NONE, NULL, DixDestroyAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
FreeResource(pWin->lastChild->drawable.id, RT_NONE);
|
||||
@@ -1275,7 +1275,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||
}
|
||||
if (val == xTrue) {
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||
RT_WINDOW, DixGrabAccess, pWin);
|
||||
RT_WINDOW, pWin, RT_NONE, NULL, DixGrabAccess);
|
||||
if (rc != Success) {
|
||||
error = rc;
|
||||
client->errorValue = pWin->drawable.id;
|
||||
@@ -2745,7 +2745,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
|
||||
|
||||
/* general check for permission to map window */
|
||||
if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW,
|
||||
DixShowAccess, pWin) != Success)
|
||||
pWin, RT_NONE, NULL, DixShowAccess) != Success)
|
||||
return Success;
|
||||
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
||||
Reference in New Issue
Block a user