summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-25 09:33:51 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-25 09:33:51 -0400
commit9bd04055a2175ec16756d3bf73ae03b5e163a28a (patch)
tree7b06855d79cc96e03f86e9f09257bd333b0dacae
parenta247886b082cea93fa8f8980616a9c388ba70111 (diff)
xace: change prototype of VALIDATE_DRAWABLE_AND_GC macro to allow access
mode to be passed to dixLookupDrawable.
-rw-r--r--Xext/panoramiXprocs.c8
-rw-r--r--Xext/shm.c2
-rw-r--r--Xext/xvdisp.c12
-rw-r--r--dix/dispatch.c28
-rw-r--r--include/dix.h6
5 files changed, 27 insertions, 29 deletions
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 1c53a1e1a..5933c02bc 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1049,8 +1049,7 @@ int PanoramiXCopyArea(ClientPtr client)
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id;
- VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, pGC, client);
-
+ VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess);
if(drawables[0]->depth != pDst->depth) {
client->errorValue = stuff->dstDrawable;
xfree(data);
@@ -1086,7 +1085,8 @@ int PanoramiXCopyArea(ClientPtr client)
stuff->dstY = dsty - panoramiXdataPtr[j].y;
}
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
+
if (stuff->dstDrawable != stuff->srcDrawable) {
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
DixReadAccess);
@@ -1195,7 +1195,7 @@ int PanoramiXCopyPlane(ClientPtr client)
stuff->dstY = dsty - panoramiXdataPtr[j].y;
}
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
if (stuff->dstDrawable != stuff->srcDrawable) {
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
DixReadAccess);
diff --git a/Xext/shm.c b/Xext/shm.c
index 2afe055bc..ee4c34035 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -795,7 +795,7 @@ ProcShmPutImage(client)
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
return BadValue;
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index af2e09b82..a2dac7584 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -535,7 +535,7 @@ ProcXvPutVideo(ClientPtr client)
REQUEST(xvPutVideoReq);
REQUEST_SIZE_MATCH(xvPutVideoReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
@@ -581,7 +581,7 @@ ProcXvPutStill(ClientPtr client)
REQUEST(xvPutStillReq);
REQUEST_SIZE_MATCH(xvPutStillReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
@@ -628,7 +628,7 @@ ProcXvGetVideo(ClientPtr client)
REQUEST(xvGetVideoReq);
REQUEST_SIZE_MATCH(xvGetVideoReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
@@ -675,7 +675,7 @@ ProcXvGetStill(ClientPtr client)
REQUEST(xvGetStillReq);
REQUEST_SIZE_MATCH(xvGetStillReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
@@ -1036,7 +1036,7 @@ ProcXvPutImage(ClientPtr client)
REQUEST(xvPutImageReq);
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
@@ -1124,7 +1124,7 @@ ProcXvShmPutImage(ClientPtr client)
REQUEST(xvShmPutImageReq);
REQUEST_SIZE_MATCH(xvShmPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
{
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 952ef6004..65eb8cc41 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1791,7 +1791,7 @@ ProcCopyArea(ClientPtr client)
REQUEST_SIZE_MATCH(xCopyAreaReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
if (stuff->dstDrawable != stuff->srcDrawable)
{
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
@@ -1832,7 +1832,7 @@ ProcCopyPlane(ClientPtr client)
REQUEST_SIZE_MATCH(xCopyPlaneReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
if (stuff->dstDrawable != stuff->srcDrawable)
{
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
@@ -1885,7 +1885,7 @@ ProcPolyPoint(ClientPtr client)
client->errorValue = stuff->coordMode;
return BadValue;
}
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
if (npoint)
(*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint,
@@ -1908,7 +1908,7 @@ ProcPolyLine(ClientPtr client)
client->errorValue = stuff->coordMode;
return BadValue;
}
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
if (npoint > 1)
(*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint,
@@ -1925,7 +1925,7 @@ ProcPolySegment(ClientPtr client)
REQUEST(xPolySegmentReq);
REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
if (nsegs & 4)
return(BadLength);
@@ -1944,7 +1944,7 @@ ProcPolyRectangle (ClientPtr client)
REQUEST(xPolyRectangleReq);
REQUEST_AT_LEAST_SIZE(xPolyRectangleReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
if (nrects & 4)
return(BadLength);
@@ -1964,7 +1964,7 @@ ProcPolyArc(ClientPtr client)
REQUEST(xPolyArcReq);
REQUEST_AT_LEAST_SIZE(xPolyArcReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
if (narcs % sizeof(xArc))
return(BadLength);
@@ -1996,7 +1996,7 @@ ProcFillPoly(ClientPtr client)
return BadValue;
}
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
if (things)
(*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
@@ -2014,7 +2014,7 @@ ProcPolyFillRectangle(ClientPtr client)
REQUEST(xPolyFillRectangleReq);
REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
if (things & 4)
return(BadLength);
@@ -2035,7 +2035,7 @@ ProcPolyFillArc(ClientPtr client)
REQUEST(xPolyFillArcReq);
REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
if (narcs % sizeof(xArc))
return(BadLength);
@@ -2110,7 +2110,7 @@ ProcPutImage(ClientPtr client)
REQUEST(xPutImageReq);
REQUEST_AT_LEAST_SIZE(xPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
if (stuff->format == XYBitmap)
{
if ((stuff->depth != 1) ||
@@ -2396,7 +2396,7 @@ ProcPolyText(ClientPtr client)
GC *pGC;
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
err = PolyText(client,
pDraw,
@@ -2426,7 +2426,7 @@ ProcImageText8(ClientPtr client)
REQUEST(xImageTextReq);
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
err = ImageText(client,
pDraw,
@@ -2456,7 +2456,7 @@ ProcImageText16(ClientPtr client)
REQUEST(xImageTextReq);
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
err = ImageText(client,
pDraw,
diff --git a/include/dix.h b/include/dix.h
index 54629cd14..59533bae7 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -81,11 +81,9 @@ SOFTWARE.
return(BadIDChoice);\
}
-#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
+#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\
{\
- int rc;\
- rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY,\
- DixWriteAccess);\
+ int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
if (rc != Success)\
return rc;\
rc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\