Remove instances of macro SECURITY_VERIFY_DRAWABLE.
This commit is contained in:
parent
0cf75e7432
commit
51b69ff499
|
@ -1069,6 +1069,7 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
DrawablePtr pDst = NULL, pSrc = NULL;
|
DrawablePtr pDst = NULL, pSrc = NULL;
|
||||||
GCPtr pGC = NULL;
|
GCPtr pGC = NULL;
|
||||||
RegionPtr pRgn[MAXSCREENS];
|
RegionPtr pRgn[MAXSCREENS];
|
||||||
|
int rc;
|
||||||
|
|
||||||
FOR_NSCREENS_BACKWARD(j) {
|
FOR_NSCREENS_BACKWARD(j) {
|
||||||
stuff->dstDrawable = dst->info[j].id;
|
stuff->dstDrawable = dst->info[j].id;
|
||||||
|
@ -1085,8 +1086,11 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||||
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
|
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if ((pDst->pScreen != pSrc->pScreen) ||
|
if ((pDst->pScreen != pSrc->pScreen) ||
|
||||||
(pDst->depth != pSrc->depth)) {
|
(pDst->depth != pSrc->depth)) {
|
||||||
client->errorValue = stuff->dstDrawable;
|
client->errorValue = stuff->dstDrawable;
|
||||||
|
@ -1137,7 +1141,7 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
|
|
||||||
int PanoramiXCopyPlane(ClientPtr client)
|
int PanoramiXCopyPlane(ClientPtr client)
|
||||||
{
|
{
|
||||||
int j, srcx, srcy, dstx, dsty;
|
int j, srcx, srcy, dstx, dsty, rc;
|
||||||
PanoramiXRes *gc, *src, *dst;
|
PanoramiXRes *gc, *src, *dst;
|
||||||
Bool srcIsRoot = FALSE;
|
Bool srcIsRoot = FALSE;
|
||||||
Bool dstIsRoot = FALSE;
|
Bool dstIsRoot = FALSE;
|
||||||
|
@ -1191,8 +1195,11 @@ int PanoramiXCopyPlane(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||||
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
|
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if (pdstDraw->pScreen != psrcDraw->pScreen) {
|
if (pdstDraw->pScreen != psrcDraw->pScreen) {
|
||||||
client->errorValue = stuff->dstDrawable;
|
client->errorValue = stuff->dstDrawable;
|
||||||
return (BadMatch);
|
return (BadMatch);
|
||||||
|
|
|
@ -173,13 +173,17 @@ ProcDamageCreate (ClientPtr client)
|
||||||
DamageExtPtr pDamageExt;
|
DamageExtPtr pDamageExt;
|
||||||
DamageReportLevel level;
|
DamageReportLevel level;
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xDamageCreateReq);
|
REQUEST(xDamageCreateReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDamageCreateReq);
|
REQUEST_SIZE_MATCH(xDamageCreateReq);
|
||||||
LEGAL_NEW_RESOURCE(stuff->damage, client);
|
LEGAL_NEW_RESOURCE(stuff->damage, client);
|
||||||
SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client,
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
switch (stuff->level) {
|
switch (stuff->level) {
|
||||||
case XDamageReportRawRectangles:
|
case XDamageReportRawRectangles:
|
||||||
level = DamageReportRawRegion;
|
level = DamageReportRawRegion;
|
||||||
|
|
|
@ -1597,17 +1597,19 @@ ProcFreePixmap(register ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcCreateGC(register ClientPtr client)
|
ProcCreateGC(register ClientPtr client)
|
||||||
{
|
{
|
||||||
int error;
|
int error, rc;
|
||||||
GC *pGC;
|
GC *pGC;
|
||||||
register DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
unsigned len;
|
unsigned len;
|
||||||
REQUEST(xCreateGCReq);
|
REQUEST(xCreateGCReq);
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
||||||
client->errorValue = stuff->gc;
|
client->errorValue = stuff->gc;
|
||||||
LEGAL_NEW_RESOURCE(stuff->gc, client);
|
LEGAL_NEW_RESOURCE(stuff->gc, client);
|
||||||
SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
|
||||||
DixReadAccess);
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xCreateGCReq) >> 2);
|
len = client->req_len - (sizeof(xCreateGCReq) >> 2);
|
||||||
if (len != Ones(stuff->mask))
|
if (len != Ones(stuff->mask))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -1766,18 +1768,21 @@ int
|
||||||
ProcCopyArea(register ClientPtr client)
|
ProcCopyArea(register ClientPtr client)
|
||||||
{
|
{
|
||||||
register DrawablePtr pDst;
|
register DrawablePtr pDst;
|
||||||
register DrawablePtr pSrc;
|
DrawablePtr pSrc;
|
||||||
register GC *pGC;
|
register GC *pGC;
|
||||||
REQUEST(xCopyAreaReq);
|
REQUEST(xCopyAreaReq);
|
||||||
RegionPtr pRgn;
|
RegionPtr pRgn;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xCopyAreaReq);
|
REQUEST_SIZE_MATCH(xCopyAreaReq);
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable)
|
if (stuff->dstDrawable != stuff->srcDrawable)
|
||||||
{
|
{
|
||||||
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
|
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth))
|
if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth))
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->dstDrawable;
|
client->errorValue = stuff->dstDrawable;
|
||||||
|
@ -1806,18 +1811,22 @@ ProcCopyArea(register ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcCopyPlane(register ClientPtr client)
|
ProcCopyPlane(register ClientPtr client)
|
||||||
{
|
{
|
||||||
register DrawablePtr psrcDraw, pdstDraw;
|
DrawablePtr psrcDraw, pdstDraw;
|
||||||
register GC *pGC;
|
register GC *pGC;
|
||||||
REQUEST(xCopyPlaneReq);
|
REQUEST(xCopyPlaneReq);
|
||||||
RegionPtr pRgn;
|
RegionPtr pRgn;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xCopyPlaneReq);
|
REQUEST_SIZE_MATCH(xCopyPlaneReq);
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable)
|
if (stuff->dstDrawable != stuff->srcDrawable)
|
||||||
{
|
{
|
||||||
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
|
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if (pdstDraw->pScreen != psrcDraw->pScreen)
|
if (pdstDraw->pScreen != psrcDraw->pScreen)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->dstDrawable;
|
client->errorValue = stuff->dstDrawable;
|
||||||
|
@ -2142,8 +2151,8 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
|
||||||
int x, int y, int width, int height,
|
int x, int y, int width, int height,
|
||||||
Mask planemask, xGetImageReply **im_return)
|
Mask planemask, xGetImageReply **im_return)
|
||||||
{
|
{
|
||||||
register DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int nlines, linesPerBuf;
|
int nlines, linesPerBuf, rc;
|
||||||
register int linesDone;
|
register int linesDone;
|
||||||
long widthBytesLine, length;
|
long widthBytesLine, length;
|
||||||
Mask plane = 0;
|
Mask plane = 0;
|
||||||
|
@ -2156,7 +2165,10 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
|
||||||
client->errorValue = format;
|
client->errorValue = format;
|
||||||
return(BadValue);
|
return(BadValue);
|
||||||
}
|
}
|
||||||
SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess);
|
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if(pDraw->type == DRAWABLE_WINDOW)
|
if(pDraw->type == DRAWABLE_WINDOW)
|
||||||
{
|
{
|
||||||
if( /* check for being viewable */
|
if( /* check for being viewable */
|
||||||
|
|
|
@ -703,7 +703,7 @@ ProcRRSetScreenConfig (ClientPtr client)
|
||||||
REQUEST(xRRSetScreenConfigReq);
|
REQUEST(xRRSetScreenConfigReq);
|
||||||
xRRSetScreenConfigReply rep;
|
xRRSetScreenConfigReply rep;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int n;
|
int n, rc;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
rrScrPrivPtr pScrPriv;
|
rrScrPrivPtr pScrPriv;
|
||||||
TimeStamp configTime;
|
TimeStamp configTime;
|
||||||
|
@ -730,8 +730,9 @@ ProcRRSetScreenConfig (ClientPtr client)
|
||||||
has_rate = FALSE;
|
has_rate = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
||||||
DixWriteAccess);
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
pScreen = pDraw->pScreen;
|
pScreen = pDraw->pScreen;
|
||||||
|
|
||||||
|
|
|
@ -614,15 +614,17 @@ ProcRenderCreatePicture (ClientPtr client)
|
||||||
PicturePtr pPicture;
|
PicturePtr pPicture;
|
||||||
DrawablePtr pDrawable;
|
DrawablePtr pDrawable;
|
||||||
PictFormatPtr pFormat;
|
PictFormatPtr pFormat;
|
||||||
int len;
|
int len, error, rc;
|
||||||
int error;
|
|
||||||
REQUEST(xRenderCreatePictureReq);
|
REQUEST(xRenderCreatePictureReq);
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
|
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||||
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client,
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
DixWriteAccess);
|
DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||||
stuff->format,
|
stuff->format,
|
||||||
PictFormatType,
|
PictFormatType,
|
||||||
|
@ -1687,14 +1689,15 @@ ProcRenderQueryFilters (ClientPtr client)
|
||||||
int nnames;
|
int nnames;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
PictureScreenPtr ps;
|
PictureScreenPtr ps;
|
||||||
int i, j;
|
int i, j, len, total_bytes, rc;
|
||||||
int len;
|
|
||||||
int total_bytes;
|
|
||||||
INT16 *aliases;
|
INT16 *aliases;
|
||||||
char *names;
|
char *names;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
|
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
|
||||||
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, DixReadAccess);
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
pScreen = pDrawable->pScreen;
|
pScreen = pDrawable->pScreen;
|
||||||
nbytesName = 0;
|
nbytesName = 0;
|
||||||
|
|
Loading…
Reference in New Issue