xace: add hooks + new access codes: core protocol window requests
This commit is contained in:
parent
d744df32a1
commit
2763056ab5
|
@ -556,12 +556,12 @@ ProcCreateWindow(ClientPtr client)
|
||||||
{
|
{
|
||||||
WindowPtr pParent, pWin;
|
WindowPtr pParent, pWin;
|
||||||
REQUEST(xCreateWindowReq);
|
REQUEST(xCreateWindowReq);
|
||||||
int result, len, rc;
|
int len, rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->wid, client);
|
LEGAL_NEW_RESOURCE(stuff->wid, client);
|
||||||
rc = dixLookupWindow(&pParent, stuff->parent, client, DixWriteAccess);
|
rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
|
len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
|
||||||
|
@ -577,7 +577,7 @@ ProcCreateWindow(ClientPtr client)
|
||||||
stuff->borderWidth, stuff->class,
|
stuff->borderWidth, stuff->class,
|
||||||
stuff->mask, (XID *) &stuff[1],
|
stuff->mask, (XID *) &stuff[1],
|
||||||
(int)stuff->depth,
|
(int)stuff->depth,
|
||||||
client, stuff->visual, &result);
|
client, stuff->visual, &rc);
|
||||||
if (pWin)
|
if (pWin)
|
||||||
{
|
{
|
||||||
Mask mask = pWin->eventMask;
|
Mask mask = pWin->eventMask;
|
||||||
|
@ -590,7 +590,7 @@ ProcCreateWindow(ClientPtr client)
|
||||||
if (client->noClientException != Success)
|
if (client->noClientException != Success)
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
else
|
else
|
||||||
return(result);
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -602,7 +602,7 @@ ProcChangeWindowAttributes(ClientPtr client)
|
||||||
int len, rc;
|
int len, rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
|
len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
|
||||||
|
@ -627,7 +627,7 @@ ProcGetWindowAttributes(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
GetWindowAttributes(pWin, client, &wa);
|
GetWindowAttributes(pWin, client, &wa);
|
||||||
|
@ -646,8 +646,13 @@ ProcDestroyWindow(ClientPtr client)
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixDestroyAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (pWin->parent)
|
if (pWin->parent) {
|
||||||
|
rc = dixLookupWindow(&pWin, pWin->parent->drawable.id, client,
|
||||||
|
DixRemoveAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
FreeResource(stuff->id, RT_NONE);
|
FreeResource(stuff->id, RT_NONE);
|
||||||
|
}
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -659,7 +664,7 @@ ProcDestroySubwindows(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixDestroyAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixRemoveAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
DestroySubwindows(pWin, client);
|
DestroySubwindows(pWin, client);
|
||||||
|
@ -674,7 +679,7 @@ ProcChangeSaveSet(ClientPtr client)
|
||||||
int result, rc;
|
int result, rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xChangeSaveSetReq);
|
REQUEST_SIZE_MATCH(xChangeSaveSetReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
|
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
|
||||||
|
@ -702,10 +707,10 @@ ProcReparentWindow(ClientPtr client)
|
||||||
int result, rc;
|
int result, rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReparentWindowReq);
|
REQUEST_SIZE_MATCH(xReparentWindowReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rc = dixLookupWindow(&pParent, stuff->parent, client, DixWriteAccess);
|
rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (SAME_SCREENS(pWin->drawable, pParent->drawable))
|
if (SAME_SCREENS(pWin->drawable, pParent->drawable))
|
||||||
|
@ -735,7 +740,7 @@ ProcMapWindow(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixShowAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
MapWindow(pWin, client);
|
MapWindow(pWin, client);
|
||||||
|
@ -751,7 +756,7 @@ ProcMapSubwindows(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
MapSubwindows(pWin, client);
|
MapSubwindows(pWin, client);
|
||||||
|
@ -767,7 +772,7 @@ ProcUnmapWindow(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixHideAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
UnmapWindow(pWin, FALSE);
|
UnmapWindow(pWin, FALSE);
|
||||||
|
@ -783,7 +788,7 @@ ProcUnmapSubwindows(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
UnmapSubwindows(pWin);
|
UnmapSubwindows(pWin);
|
||||||
|
@ -799,7 +804,8 @@ ProcConfigureWindow(ClientPtr client)
|
||||||
int len, rc;
|
int len, rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client,
|
||||||
|
DixManageAccess|DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
|
len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
|
||||||
|
@ -827,7 +833,7 @@ ProcCirculateWindow(ClientPtr client)
|
||||||
client->errorValue = stuff->direction;
|
client->errorValue = stuff->direction;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
CirculateWindow(pWin, (int)stuff->direction, client);
|
CirculateWindow(pWin, (int)stuff->direction, client);
|
||||||
|
@ -842,7 +848,7 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixReadAccess);
|
rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -903,7 +909,7 @@ ProcQueryTree(ClientPtr client)
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
reply.type = X_Reply;
|
reply.type = X_Reply;
|
||||||
|
@ -1260,10 +1266,10 @@ ProcTranslateCoords(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
|
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
|
@ -3233,12 +3239,15 @@ ProcQueryBestSize (ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
|
||||||
DixReadAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW)
|
if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW)
|
||||||
return (BadMatch);
|
return (BadMatch);
|
||||||
pScreen = pDraw->pScreen;
|
pScreen = pDraw->pScreen;
|
||||||
|
rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
(* pScreen->QueryBestSize)(stuff->class, &stuff->width,
|
(* pScreen->QueryBestSize)(stuff->class, &stuff->width,
|
||||||
&stuff->height, pScreen);
|
&stuff->height, pScreen);
|
||||||
reply.type = X_Reply;
|
reply.type = X_Reply;
|
||||||
|
|
166
dix/window.c
166
dix/window.c
|
@ -733,20 +733,14 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
||||||
/* security creation/labeling check
|
/* security creation/labeling check
|
||||||
*/
|
*/
|
||||||
*error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW,
|
*error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW,
|
||||||
DixCreateAccess, pWin);
|
DixCreateAccess|DixSetAttrAccess, pWin);
|
||||||
if (*error != Success) {
|
if (*error != Success) {
|
||||||
xfree(pWin);
|
xfree(pWin);
|
||||||
return NullWindow;
|
return NullWindow;
|
||||||
}
|
}
|
||||||
/* can't let untrusted clients have background None windows;
|
|
||||||
* they make it too easy to steal window contents
|
pWin->backgroundState = BackgroundPixel;
|
||||||
*/
|
pWin->background.pixel = 0;
|
||||||
if (XaceHook(XACE_BACKGRND_ACCESS, client, pWin) == Success)
|
|
||||||
pWin->backgroundState = None;
|
|
||||||
else {
|
|
||||||
pWin->backgroundState = BackgroundPixel;
|
|
||||||
pWin->background.pixel = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pWin->borderIsPixel = pParent->borderIsPixel;
|
pWin->borderIsPixel = pParent->borderIsPixel;
|
||||||
pWin->border = pParent->border;
|
pWin->border = pParent->border;
|
||||||
|
@ -980,7 +974,7 @@ DeleteWindow(pointer value, XID wid)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||||
{
|
{
|
||||||
/* XXX
|
/* XXX
|
||||||
|
@ -992,8 +986,15 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||||
* If you care, simply delete the call to UnmapSubwindows.
|
* If you care, simply delete the call to UnmapSubwindows.
|
||||||
*/
|
*/
|
||||||
UnmapSubwindows(pWin);
|
UnmapSubwindows(pWin);
|
||||||
while (pWin->lastChild)
|
while (pWin->lastChild) {
|
||||||
|
int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||||
|
pWin->lastChild->drawable.id, RT_WINDOW,
|
||||||
|
DixDestroyAccess, pWin->lastChild);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
FreeResource(pWin->lastChild->drawable.id, RT_NONE);
|
FreeResource(pWin->lastChild->drawable.id, RT_NONE);
|
||||||
|
}
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
|
#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
|
||||||
|
@ -1010,25 +1011,20 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
{
|
{
|
||||||
Mask index2;
|
|
||||||
XID *pVlist;
|
XID *pVlist;
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
Pixmap pixID;
|
Pixmap pixID;
|
||||||
CursorPtr pCursor, pOldCursor;
|
CursorPtr pCursor, pOldCursor;
|
||||||
Cursor cursorID;
|
Cursor cursorID;
|
||||||
WindowPtr pChild;
|
WindowPtr pChild, pLayerWin;
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
xEvent xE;
|
xEvent xE;
|
||||||
int result;
|
int error, rc;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
Mask vmaskCopy = 0;
|
Mask index2, tmask, vmaskCopy = 0;
|
||||||
Mask tmask;
|
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
int error;
|
Bool checkOptional = FALSE, borderRelative = FALSE;
|
||||||
Bool checkOptional = FALSE;
|
|
||||||
Bool borderRelative = FALSE;
|
|
||||||
WindowPtr pLayerWin;
|
|
||||||
|
|
||||||
if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK)))
|
if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK)))
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
@ -1050,17 +1046,13 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
borderRelative = TRUE;
|
borderRelative = TRUE;
|
||||||
if (pixID == None)
|
if (pixID == None)
|
||||||
{
|
{
|
||||||
/* can't let untrusted clients have background None windows */
|
if (pWin->backgroundState == BackgroundPixmap)
|
||||||
if (XaceHook(XACE_BACKGRND_ACCESS, client, pWin) == Success) {
|
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
||||||
if (pWin->backgroundState == BackgroundPixmap)
|
if (!pWin->parent)
|
||||||
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
|
MakeRootTile(pWin);
|
||||||
if (!pWin->parent)
|
else {
|
||||||
MakeRootTile(pWin);
|
pWin->backgroundState = BackgroundPixel;
|
||||||
else
|
pWin->background.pixel = 0;
|
||||||
pWin->backgroundState = None;
|
|
||||||
} else {
|
|
||||||
/* didn't change the backgrnd to None, so don't tell ddx */
|
|
||||||
index2 = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pixID == ParentRelative)
|
else if (pixID == ParentRelative)
|
||||||
|
@ -1083,9 +1075,9 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
|
rc = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||||
RT_PIXMAP, DixReadAccess);
|
client, DixReadAccess);
|
||||||
if (pPixmap != (PixmapPtr) NULL)
|
if (rc == Success)
|
||||||
{
|
{
|
||||||
if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
|
if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
|
||||||
(pPixmap->drawable.pScreen != pScreen))
|
(pPixmap->drawable.pScreen != pScreen))
|
||||||
|
@ -1101,7 +1093,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = BadPixmap;
|
error = (rc == BadValue) ? BadPixmap : rc;
|
||||||
client->errorValue = pixID;
|
client->errorValue = pixID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1130,42 +1122,40 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
error = BadMatch;
|
error = BadMatch;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
if (pWin->borderIsPixel == FALSE)
|
if (pWin->parent->borderIsPixel == TRUE) {
|
||||||
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
|
||||||
pWin->border = pWin->parent->border;
|
|
||||||
if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE)
|
|
||||||
{
|
|
||||||
index2 = CWBorderPixel;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pWin->parent->border.pixmap->refcnt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
|
|
||||||
RT_PIXMAP, DixReadAccess);
|
|
||||||
if (pPixmap)
|
|
||||||
{
|
|
||||||
if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
|
|
||||||
(pPixmap->drawable.pScreen != pScreen))
|
|
||||||
{
|
|
||||||
error = BadMatch;
|
|
||||||
goto PatchUp;
|
|
||||||
}
|
|
||||||
if (pWin->borderIsPixel == FALSE)
|
if (pWin->borderIsPixel == FALSE)
|
||||||
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
||||||
pWin->borderIsPixel = FALSE;
|
pWin->border = pWin->parent->border;
|
||||||
pWin->border.pixmap = pPixmap;
|
pWin->borderIsPixel = TRUE;
|
||||||
pPixmap->refcnt++;
|
index2 = CWBorderPixel;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = BadPixmap;
|
pixID = pWin->parent->border.pixmap->drawable.id;
|
||||||
client->errorValue = pixID;
|
}
|
||||||
|
}
|
||||||
|
rc = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||||
|
client, DixReadAccess);
|
||||||
|
if (rc == Success)
|
||||||
|
{
|
||||||
|
if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
|
||||||
|
(pPixmap->drawable.pScreen != pScreen))
|
||||||
|
{
|
||||||
|
error = BadMatch;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
if (pWin->borderIsPixel == FALSE)
|
||||||
|
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
||||||
|
pWin->borderIsPixel = FALSE;
|
||||||
|
pWin->border.pixmap = pPixmap;
|
||||||
|
pPixmap->refcnt++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error = (rc == BadValue) ? BadPixmap : rc;
|
||||||
|
client->errorValue = pixID;
|
||||||
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CWBorderPixel:
|
case CWBorderPixel:
|
||||||
|
@ -1290,20 +1280,20 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
#endif /* DO_SAVE_UNDERS */
|
#endif /* DO_SAVE_UNDERS */
|
||||||
break;
|
break;
|
||||||
case CWEventMask:
|
case CWEventMask:
|
||||||
result = EventSelectForWindow(pWin, client, (Mask )*pVlist);
|
rc = EventSelectForWindow(pWin, client, (Mask )*pVlist);
|
||||||
if (result)
|
if (rc)
|
||||||
{
|
{
|
||||||
error = result;
|
error = rc;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
pVlist++;
|
pVlist++;
|
||||||
break;
|
break;
|
||||||
case CWDontPropagate:
|
case CWDontPropagate:
|
||||||
result = EventSuppressForWindow(pWin, client, (Mask )*pVlist,
|
rc = EventSuppressForWindow(pWin, client, (Mask )*pVlist,
|
||||||
&checkOptional);
|
&checkOptional);
|
||||||
if (result)
|
if (rc)
|
||||||
{
|
{
|
||||||
error = result;
|
error = rc;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
pVlist++;
|
pVlist++;
|
||||||
|
@ -1317,6 +1307,15 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
client->errorValue = val;
|
client->errorValue = val;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
if (val == xTrue) {
|
||||||
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
|
||||||
|
RT_WINDOW, DixGrabAccess, pWin);
|
||||||
|
if (rc != Success) {
|
||||||
|
error = rc;
|
||||||
|
client->errorValue = pWin->drawable.id;
|
||||||
|
goto PatchUp;
|
||||||
|
}
|
||||||
|
}
|
||||||
pWin->overrideRedirect = val;
|
pWin->overrideRedirect = val;
|
||||||
break;
|
break;
|
||||||
case CWColormap:
|
case CWColormap:
|
||||||
|
@ -1354,11 +1353,11 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
error = BadMatch;
|
error = BadMatch;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap,
|
rc = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP,
|
||||||
RT_COLORMAP, DixReadAccess);
|
client, DixUseAccess);
|
||||||
if (!pCmap)
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
error = BadColor;
|
error = (rc == BadValue) ? BadColor : rc;
|
||||||
client->errorValue = cmap;
|
client->errorValue = cmap;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1430,11 +1429,11 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID,
|
rc = dixLookupResource((pointer *)&pCursor, cursorID,
|
||||||
RT_CURSOR, DixReadAccess);
|
RT_CURSOR, client, DixReadAccess);
|
||||||
if (!pCursor)
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
error = BadCursor;
|
error = (rc == BadValue) ? BadCursor : rc;
|
||||||
client->errorValue = cursorID;
|
client->errorValue = cursorID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -2267,7 +2266,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
|
||||||
unsigned short w = pWin->drawable.width,
|
unsigned short w = pWin->drawable.width,
|
||||||
h = pWin->drawable.height,
|
h = pWin->drawable.height,
|
||||||
bw = pWin->borderWidth;
|
bw = pWin->borderWidth;
|
||||||
int action, smode = Above;
|
int rc, action, smode = Above;
|
||||||
#ifdef XAPPGROUP
|
#ifdef XAPPGROUP
|
||||||
ClientPtr win_owner;
|
ClientPtr win_owner;
|
||||||
ClientPtr ag_leader = NULL;
|
ClientPtr ag_leader = NULL;
|
||||||
|
@ -2328,12 +2327,11 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
|
||||||
case CWSibling:
|
case CWSibling:
|
||||||
sibwid = (Window ) *pVlist;
|
sibwid = (Window ) *pVlist;
|
||||||
pVlist++;
|
pVlist++;
|
||||||
pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid,
|
rc = dixLookupWindow(&pSib, sibwid, client, DixGetAttrAccess);
|
||||||
RT_WINDOW, DixReadAccess);
|
if (rc != Success)
|
||||||
if (!pSib)
|
|
||||||
{
|
{
|
||||||
client->errorValue = sibwid;
|
client->errorValue = sibwid;
|
||||||
return(BadWindow);
|
return rc;
|
||||||
}
|
}
|
||||||
if (pSib->parent != pParent)
|
if (pSib->parent != pParent)
|
||||||
return(BadMatch);
|
return(BadMatch);
|
||||||
|
|
|
@ -119,7 +119,7 @@ extern int DeleteWindow(
|
||||||
pointer /*pWin*/,
|
pointer /*pWin*/,
|
||||||
XID /*wid*/);
|
XID /*wid*/);
|
||||||
|
|
||||||
extern void DestroySubwindows(
|
extern int DestroySubwindows(
|
||||||
WindowPtr /*pWin*/,
|
WindowPtr /*pWin*/,
|
||||||
ClientPtr /*client*/);
|
ClientPtr /*client*/);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue