Convert callers of SecurityLookupDrawable() to dixLookupDrawable().

This commit is contained in:
Eamon Walsh 2006-12-15 16:51:58 -05:00 committed by Eamon Walsh
parent 10aabb729d
commit f11dafaafc
3 changed files with 31 additions and 36 deletions

View File

@ -865,7 +865,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
xDbeGetVisualInfoReply rep; xDbeGetVisualInfoReply rep;
Drawable *drawables; Drawable *drawables;
DrawablePtr *pDrawables = NULL; DrawablePtr *pDrawables = NULL;
register int i, j, n; register int i, j, n, rc;
register int count; /* number of visual infos in reply */ register int count; /* number of visual infos in reply */
register int length; /* length of reply */ register int length; /* length of reply */
ScreenPtr pScreen; ScreenPtr pScreen;
@ -887,11 +887,11 @@ ProcDbeGetVisualInfo(ClientPtr client)
for (i = 0; i < stuff->n; i++) for (i = 0; i < stuff->n; i++)
{ {
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(pDrawables+i, drawables[i], client, 0,
drawables[i], client, DixReadAccess))) DixReadAccess);
{ if (rc != Success) {
DEALLOCATE_LOCAL(pDrawables); DEALLOCATE_LOCAL(pDrawables);
return(BadDrawable); return rc;
} }
} }
} }

View File

@ -213,6 +213,7 @@ ProcAppleDRICreateSurface(
DrawablePtr pDrawable; DrawablePtr pDrawable;
xp_surface_id sid; xp_surface_id sid;
unsigned int key[2]; unsigned int key[2];
int rc;
REQUEST(xAppleDRICreateSurfaceReq); REQUEST(xAppleDRICreateSurfaceReq);
REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq); REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
@ -220,12 +221,10 @@ ProcAppleDRICreateSurface(
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
(Drawable)stuff->drawable, DixReadAccess);
client, if (rc != Success)
DixReadAccess))) { return rc;
return BadValue;
}
rep.key_0 = rep.key_1 = rep.uid = 0; rep.key_0 = rep.key_1 = rep.uid = 0;
@ -252,13 +251,12 @@ ProcAppleDRIDestroySurface(
REQUEST(xAppleDRIDestroySurfaceReq); REQUEST(xAppleDRIDestroySurfaceReq);
DrawablePtr pDrawable; DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq); REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
int rc;
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
(Drawable)stuff->drawable, DixReadAccess);
client, if (rc != Success)
DixReadAccess))) { return rc;
return BadValue;
}
if (!DRIDestroySurface( screenInfo.screens[stuff->screen], if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
(Drawable)stuff->drawable, (Drawable)stuff->drawable,

View File

@ -386,6 +386,7 @@ ProcXF86DRICreateDrawable(
{ {
xXF86DRICreateDrawableReply rep; xXF86DRICreateDrawableReply rep;
DrawablePtr pDrawable; DrawablePtr pDrawable;
int rc;
REQUEST(xXF86DRICreateDrawableReq); REQUEST(xXF86DRICreateDrawableReq);
REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
@ -398,12 +399,10 @@ ProcXF86DRICreateDrawable(
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
(Drawable)stuff->drawable, DixReadAccess);
client, if (rc != Success)
DixReadAccess))) { return rc;
return BadValue;
}
if (!DRICreateDrawable( screenInfo.screens[stuff->screen], if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
@ -424,17 +423,17 @@ ProcXF86DRIDestroyDrawable(
REQUEST(xXF86DRIDestroyDrawableReq); REQUEST(xXF86DRIDestroyDrawableReq);
DrawablePtr pDrawable; DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
int rc;
if (stuff->screen >= screenInfo.numScreens) { if (stuff->screen >= screenInfo.numScreens) {
client->errorValue = stuff->screen; client->errorValue = stuff->screen;
return BadValue; return BadValue;
} }
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
(Drawable)stuff->drawable, DixReadAccess);
client, if (rc != Success)
DixReadAccess))) { return rc;
return BadValue;
}
if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen],
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
@ -455,7 +454,7 @@ ProcXF86DRIGetDrawableInfo(
int X, Y, W, H; int X, Y, W, H;
drm_clip_rect_t * pClipRects; drm_clip_rect_t * pClipRects;
drm_clip_rect_t * pBackClipRects; drm_clip_rect_t * pBackClipRects;
int backX, backY; int backX, backY, rc;
REQUEST(xXF86DRIGetDrawableInfoReq); REQUEST(xXF86DRIGetDrawableInfoReq);
REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
@ -468,12 +467,10 @@ ProcXF86DRIGetDrawableInfo(
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
(Drawable)stuff->drawable, DixReadAccess);
client, if (rc != Success)
DixReadAccess))) { return rc;
return BadValue;
}
if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen], if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen],
pDrawable, pDrawable,