summaryrefslogtreecommitdiff
path: root/xfixes/region.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-30 11:48:45 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-30 11:48:45 -0400
commitcda92bbf12107865e93c03c71b901ef51466dc31 (patch)
treebdf01af62041494641280badc88b2fec197856b6 /xfixes/region.c
parent47ab4d648b31ea1d5800e0bc84cf5f25025bffe3 (diff)
xace: add hooks + new access codes: XFixes extension.
Required a new name argument to the selection access hook to handle XFixesSelectSelectionInput.
Diffstat (limited to 'xfixes/region.c')
-rwxr-xr-xxfixes/region.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/xfixes/region.c b/xfixes/region.c
index d4316be78..d90b1e0ff 100755
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -109,18 +109,18 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
{
RegionPtr pRegion;
PixmapPtr pPixmap;
+ int rc;
REQUEST (xXFixesCreateRegionFromBitmapReq);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq);
LEGAL_NEW_RESOURCE (stuff->region, client);
- pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap,
- RT_PIXMAP,
- DixReadAccess);
- if (!pPixmap)
+ rc = dixLookupResource((pointer *)&pPixmap, stuff->bitmap, RT_PIXMAP,
+ client, DixReadAccess);
+ if (rc != Success)
{
client->errorValue = stuff->bitmap;
- return BadPixmap;
+ return (rc == BadValue) ? BadPixmap : rc;
}
if (pPixmap->drawable.depth != 1)
return BadMatch;
@@ -155,15 +155,17 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
RegionPtr pRegion;
Bool copy = TRUE;
WindowPtr pWin;
+ int rc;
REQUEST (xXFixesCreateRegionFromWindowReq);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq);
LEGAL_NEW_RESOURCE (stuff->region, client);
- pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
- if (!pWin)
+ rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW,
+ client, DixGetAttrAccess);
+ if (rc != Success)
{
client->errorValue = stuff->window;
- return BadWindow;
+ return (rc == BadValue) ? BadWindow : rc;
}
switch (stuff->kind) {
case WindowRegionBounding:
@@ -224,7 +226,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq);
LEGAL_NEW_RESOURCE (stuff->region, client);
- rc = dixLookupGC(&pGC, stuff->gc, client, DixReadAccess);
+ rc = dixLookupGC(&pGC, stuff->gc, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -274,7 +276,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq);
LEGAL_NEW_RESOURCE (stuff->region, client);
- VERIFY_PICTURE(pPicture, stuff->picture, client, DixReadAccess,
+ VERIFY_PICTURE(pPicture, stuff->picture, client, DixGetAttrAccess,
RenderErrBase + BadPicture);
switch (pPicture->clientClipType) {
@@ -635,7 +637,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
REQUEST(xXFixesSetGCClipRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
- rc = dixLookupGC(&pGC, stuff->gc, client, DixWriteAccess);
+ rc = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess);
if (rc != Success)
return rc;
@@ -681,14 +683,16 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
ScreenPtr pScreen;
RegionPtr pRegion;
RegionPtr *pDestRegion;
+ int rc;
REQUEST(xXFixesSetWindowShapeRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
- pWin = (WindowPtr) LookupIDByType (stuff->dest, RT_WINDOW);
- if (!pWin)
+ rc = dixLookupResource((pointer *)&pWin, stuff->dest, RT_WINDOW,
+ client, DixSetAttrAccess);
+ if (rc != Success)
{
client->errorValue = stuff->dest;
- return BadWindow;
+ return (rc == BadValue) ? BadWindow : rc;
}
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
pScreen = pWin->drawable.pScreen;
@@ -780,7 +784,7 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
REQUEST(xXFixesSetPictureClipRegionReq);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
- VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess,
+ VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess,
RenderErrBase + BadPicture);
pScreen = pPicture->pDrawable->pScreen;
ps = GetPictureScreen (pScreen);