Naming change: Security*Access -> Dix*Access

This commit is contained in:
Eamon Walsh 2006-12-14 14:45:42 -05:00 committed by Eamon Walsh
parent b88ad820fa
commit 6c46645cfc
45 changed files with 439 additions and 438 deletions

View File

@ -432,7 +432,7 @@ int ProcXagDestroy(
REQUEST_SIZE_MATCH (xXagDestroyReq); REQUEST_SIZE_MATCH (xXagDestroyReq);
pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client, pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client,
(XID)stuff->app_group, RT_APPGROUP, SecurityReadAccess); (XID)stuff->app_group, RT_APPGROUP, DixReadAccess);
if (!pAppGrp) return XagBadAppGroup; if (!pAppGrp) return XagBadAppGroup;
FreeResource ((XID)stuff->app_group, RT_NONE); FreeResource ((XID)stuff->app_group, RT_NONE);
if (--XagCallbackRefCount == 0) if (--XagCallbackRefCount == 0)
@ -451,7 +451,7 @@ int ProcXagGetAttr(
REQUEST_SIZE_MATCH (xXagGetAttrReq); REQUEST_SIZE_MATCH (xXagGetAttrReq);
pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client, pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client,
(XID)stuff->app_group, RT_APPGROUP, SecurityReadAccess); (XID)stuff->app_group, RT_APPGROUP, DixReadAccess);
if (!pAppGrp) return XagBadAppGroup; if (!pAppGrp) return XagBadAppGroup;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;

View File

@ -227,7 +227,7 @@ int ProcStoreColors(
REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq); REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
pcmp = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap, pcmp = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) { if (pcmp) {
int ncolors, n; int ncolors, n;

View File

@ -91,7 +91,7 @@ int PanoramiXCreateWindow(ClientPtr client)
return BadLength; return BadLength;
if (!(parent = (PanoramiXRes *)SecurityLookupIDByType( if (!(parent = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) client, stuff->parent, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if(stuff->class == CopyFromParent) if(stuff->class == CopyFromParent)
@ -105,7 +105,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pback_offset); tmp = *((CARD32 *) &stuff[1] + pback_offset);
if ((tmp != None) && (tmp != ParentRelative)) { if ((tmp != None) && (tmp != ParentRelative)) {
if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -114,7 +114,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pbord_offset); tmp = *((CARD32 *) &stuff[1] + pbord_offset);
if (tmp != CopyFromParent) { if (tmp != CopyFromParent) {
if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -123,7 +123,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + cmap_offset); tmp = *((CARD32 *) &stuff[1] + cmap_offset);
if ((tmp != CopyFromParent) && (tmp != None)) { if ((tmp != CopyFromParent) && (tmp != None)) {
if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_COLORMAP, SecurityReadAccess))) client, tmp, XRT_COLORMAP, DixReadAccess)))
return BadColor; return BadColor;
} }
} }
@ -192,7 +192,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
return BadLength; return BadLength;
if (!(win = (PanoramiXRes *)SecurityLookupIDByType( if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) client, stuff->window, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if((win->u.win.class == InputOnly) && if((win->u.win.class == InputOnly) &&
@ -204,7 +204,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pback_offset); tmp = *((CARD32 *) &stuff[1] + pback_offset);
if ((tmp != None) && (tmp != ParentRelative)) { if ((tmp != None) && (tmp != ParentRelative)) {
if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -213,7 +213,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pbord_offset); tmp = *((CARD32 *) &stuff[1] + pbord_offset);
if (tmp != CopyFromParent) { if (tmp != CopyFromParent) {
if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -222,7 +222,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + cmap_offset); tmp = *((CARD32 *) &stuff[1] + cmap_offset);
if ((tmp != CopyFromParent) && (tmp != None)) { if ((tmp != CopyFromParent) && (tmp != None)) {
if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_COLORMAP, SecurityReadAccess))) client, tmp, XRT_COLORMAP, DixReadAccess)))
return BadColor; return BadColor;
} }
} }
@ -251,7 +251,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) client, stuff->id, XRT_WINDOW, DixDestroyAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -276,7 +276,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) client, stuff->id, XRT_WINDOW, DixDestroyAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -301,7 +301,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
REQUEST_SIZE_MATCH(xChangeSaveSetReq); REQUEST_SIZE_MATCH(xChangeSaveSetReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityReadAccess))) client, stuff->window, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -325,11 +325,11 @@ int PanoramiXReparentWindow(ClientPtr client)
REQUEST_SIZE_MATCH(xReparentWindowReq); REQUEST_SIZE_MATCH(xReparentWindowReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) client, stuff->window, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if(!(parent = (PanoramiXRes *)SecurityLookupIDByType( if(!(parent = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) client, stuff->parent, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
x = stuff->x; x = stuff->x;
@ -360,7 +360,7 @@ int PanoramiXMapWindow(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityReadAccess))) client, stuff->id, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
@ -382,7 +382,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityReadAccess))) client, stuff->id, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
@ -404,7 +404,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityReadAccess))) client, stuff->id, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
@ -426,7 +426,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_WINDOW, SecurityReadAccess))) client, stuff->id, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
@ -457,11 +457,11 @@ int PanoramiXConfigureWindow(ClientPtr client)
/* because we need the parent */ /* because we need the parent */
if (!(pWin = (WindowPtr)SecurityLookupIDByType( if (!(pWin = (WindowPtr)SecurityLookupIDByType(
client, stuff->window, RT_WINDOW, SecurityWriteAccess))) client, stuff->window, RT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if (!(win = (PanoramiXRes *)SecurityLookupIDByType( if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) client, stuff->window, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if ((Mask)stuff->mask & CWSibling) { if ((Mask)stuff->mask & CWSibling) {
@ -469,7 +469,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1)); sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1));
if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) {
if(!(sib = (PanoramiXRes*) SecurityLookupIDByType( if(!(sib = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_WINDOW, SecurityReadAccess))) client, tmp, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
} }
} }
@ -514,7 +514,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
REQUEST_SIZE_MATCH(xCirculateWindowReq); REQUEST_SIZE_MATCH(xCirculateWindowReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) client, stuff->window, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
@ -579,11 +579,11 @@ int PanoramiXTranslateCoords(ClientPtr client)
REQUEST_SIZE_MATCH(xTranslateCoordsReq); REQUEST_SIZE_MATCH(xTranslateCoordsReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client,
SecurityReadAccess); DixReadAccess);
if (!pDst) if (!pDst)
return(BadWindow); return(BadWindow);
rep.type = X_Reply; rep.type = X_Reply;
@ -655,7 +655,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
client->errorValue = stuff->pid; client->errorValue = stuff->pid;
if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) client, stuff->drawable, XRC_DRAWABLE, DixReadAccess)))
return BadDrawable; return BadDrawable;
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
@ -694,7 +694,7 @@ int PanoramiXFreePixmap(ClientPtr client)
client->errorValue = stuff->id; client->errorValue = stuff->id;
if(!(pix = (PanoramiXRes *)SecurityLookupIDByType( if(!(pix = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_PIXMAP, SecurityDestroyAccess))) client, stuff->id, XRT_PIXMAP, DixDestroyAccess)))
return BadPixmap; return BadPixmap;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -730,14 +730,14 @@ int PanoramiXCreateGC(ClientPtr client)
return BadLength; return BadLength;
if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) client, stuff->drawable, XRC_DRAWABLE, DixReadAccess)))
return BadDrawable; return BadDrawable;
if ((Mask)stuff->mask & GCTile) { if ((Mask)stuff->mask & GCTile) {
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -745,7 +745,7 @@ int PanoramiXCreateGC(ClientPtr client)
stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -753,7 +753,7 @@ int PanoramiXCreateGC(ClientPtr client)
clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -805,14 +805,14 @@ int PanoramiXChangeGC(ClientPtr client)
return BadLength; return BadLength;
if (!(gc = (PanoramiXRes *)SecurityLookupIDByType( if (!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if ((Mask)stuff->mask & GCTile) { if ((Mask)stuff->mask & GCTile) {
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -820,7 +820,7 @@ int PanoramiXChangeGC(ClientPtr client)
stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -828,7 +828,7 @@ int PanoramiXChangeGC(ClientPtr client)
clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -859,11 +859,11 @@ int PanoramiXCopyGC(ClientPtr client)
REQUEST_SIZE_MATCH(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq);
if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType( if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->srcGC, XRT_GC, SecurityReadAccess))) client, stuff->srcGC, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType( if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->dstGC, XRT_GC, SecurityWriteAccess))) client, stuff->dstGC, XRT_GC, DixWriteAccess)))
return BadGC; return BadGC;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
@ -886,7 +886,7 @@ int PanoramiXSetDashes(ClientPtr client)
REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityWriteAccess))) client, stuff->gc, XRT_GC, DixWriteAccess)))
return BadGC; return BadGC;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -908,7 +908,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityWriteAccess))) client, stuff->gc, XRT_GC, DixWriteAccess)))
return BadGC; return BadGC;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -930,7 +930,7 @@ int PanoramiXFreeGC(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_GC, SecurityDestroyAccess))) client, stuff->id, XRT_GC, DixDestroyAccess)))
return BadGC; return BadGC;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -956,7 +956,7 @@ int PanoramiXClearToBackground(ClientPtr client)
REQUEST_SIZE_MATCH(xClearAreaReq); REQUEST_SIZE_MATCH(xClearAreaReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) client, stuff->window, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
x = stuff->x; x = stuff->x;
@ -998,13 +998,13 @@ int PanoramiXCopyArea(ClientPtr client)
REQUEST_SIZE_MATCH(xCopyAreaReq); REQUEST_SIZE_MATCH(xCopyAreaReq);
if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess)))
return BadDrawable; return BadDrawable;
srcShared = IS_SHARED_PIXMAP(src); srcShared = IS_SHARED_PIXMAP(src);
if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
dstShared = IS_SHARED_PIXMAP(dst); dstShared = IS_SHARED_PIXMAP(dst);
@ -1013,7 +1013,7 @@ int PanoramiXCopyArea(ClientPtr client)
return (* SavedProcVector[X_CopyArea])(client); return (* SavedProcVector[X_CopyArea])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if((dst->type == XRT_WINDOW) && dst->u.win.root) if((dst->type == XRT_WINDOW) && dst->u.win.root)
@ -1082,7 +1082,7 @@ 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, SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
SecurityReadAccess); DixReadAccess);
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;
@ -1146,13 +1146,13 @@ int PanoramiXCopyPlane(ClientPtr client)
REQUEST_SIZE_MATCH(xCopyPlaneReq); REQUEST_SIZE_MATCH(xCopyPlaneReq);
if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess)))
return BadDrawable; return BadDrawable;
srcShared = IS_SHARED_PIXMAP(src); srcShared = IS_SHARED_PIXMAP(src);
if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
dstShared = IS_SHARED_PIXMAP(dst); dstShared = IS_SHARED_PIXMAP(dst);
@ -1161,7 +1161,7 @@ int PanoramiXCopyPlane(ClientPtr client)
return (* SavedProcVector[X_CopyPlane])(client); return (* SavedProcVector[X_CopyPlane])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if((dst->type == XRT_WINDOW) && dst->u.win.root) if((dst->type == XRT_WINDOW) && dst->u.win.root)
@ -1188,7 +1188,7 @@ 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, SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
SecurityReadAccess); DixReadAccess);
if (pdstDraw->pScreen != psrcDraw->pScreen) { if (pdstDraw->pScreen != psrcDraw->pScreen) {
client->errorValue = stuff->dstDrawable; client->errorValue = stuff->dstDrawable;
return (BadMatch); return (BadMatch);
@ -1246,14 +1246,14 @@ int PanoramiXPolyPoint(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyPointReq); REQUEST_AT_LEAST_SIZE(xPolyPointReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyPoint])(client); return (*SavedProcVector[X_PolyPoint])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1304,14 +1304,14 @@ int PanoramiXPolyLine(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyLineReq); REQUEST_AT_LEAST_SIZE(xPolyLineReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyLine])(client); return (*SavedProcVector[X_PolyLine])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1362,14 +1362,14 @@ int PanoramiXPolySegment(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolySegmentReq); REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolySegment])(client); return (*SavedProcVector[X_PolySegment])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1424,14 +1424,14 @@ int PanoramiXPolyRectangle(ClientPtr client)
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyRectangle])(client); return (*SavedProcVector[X_PolyRectangle])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1484,14 +1484,14 @@ int PanoramiXPolyArc(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyArcReq); REQUEST_AT_LEAST_SIZE(xPolyArcReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyArc])(client); return (*SavedProcVector[X_PolyArc])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1542,14 +1542,14 @@ int PanoramiXFillPoly(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xFillPolyReq); REQUEST_AT_LEAST_SIZE(xFillPolyReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_FillPoly])(client); return (*SavedProcVector[X_FillPoly])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1601,14 +1601,14 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyFillRectangle])(client); return (*SavedProcVector[X_PolyFillRectangle])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1660,14 +1660,14 @@ int PanoramiXPolyFillArc(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyFillArc])(client); return (*SavedProcVector[X_PolyFillArc])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1718,14 +1718,14 @@ int PanoramiXPutImage(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PutImage])(client); return (*SavedProcVector[X_PutImage])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1769,7 +1769,7 @@ int PanoramiXGetImage(ClientPtr client)
} }
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(draw->type == XRT_PIXMAP) if(draw->type == XRT_PIXMAP)
@ -1909,14 +1909,14 @@ PanoramiXPolyText8(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyTextReq); REQUEST_AT_LEAST_SIZE(xPolyTextReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyText8])(client); return (*SavedProcVector[X_PolyText8])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1948,14 +1948,14 @@ PanoramiXPolyText16(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xPolyTextReq); REQUEST_AT_LEAST_SIZE(xPolyTextReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_PolyText16])(client); return (*SavedProcVector[X_PolyText16])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1987,14 +1987,14 @@ int PanoramiXImageText8(ClientPtr client)
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_ImageText8])(client); return (*SavedProcVector[X_ImageText8])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2026,14 +2026,14 @@ int PanoramiXImageText16(ClientPtr client)
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(IS_SHARED_PIXMAP(draw)) if(IS_SHARED_PIXMAP(draw))
return (*SavedProcVector[X_ImageText16])(client); return (*SavedProcVector[X_ImageText16])(client);
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2064,7 +2064,7 @@ int PanoramiXCreateColormap(ClientPtr client)
REQUEST_SIZE_MATCH(xCreateColormapReq); REQUEST_SIZE_MATCH(xCreateColormapReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->window, XRT_WINDOW, SecurityReadAccess))) client, stuff->window, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
if(!stuff->visual || (stuff->visual > 255)) if(!stuff->visual || (stuff->visual > 255))
@ -2107,7 +2107,7 @@ int PanoramiXFreeColormap(ClientPtr client)
client->errorValue = stuff->id; client->errorValue = stuff->id;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_COLORMAP, SecurityDestroyAccess))) client, stuff->id, XRT_COLORMAP, DixDestroyAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2136,7 +2136,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->srcCmap, XRT_COLORMAP, client, stuff->srcCmap, XRT_COLORMAP,
SecurityReadAccess | SecurityWriteAccess))) DixReadAccess | DixWriteAccess)))
return BadColor; return BadColor;
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
@ -2174,7 +2174,7 @@ int PanoramiXInstallColormap(ClientPtr client)
client->errorValue = stuff->id; client->errorValue = stuff->id;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) client, stuff->id, XRT_COLORMAP, DixReadAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2197,7 +2197,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
client->errorValue = stuff->id; client->errorValue = stuff->id;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) client, stuff->id, XRT_COLORMAP, DixReadAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2220,7 +2220,7 @@ int PanoramiXAllocColor(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2243,7 +2243,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2266,7 +2266,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2289,7 +2289,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2313,7 +2313,7 @@ int PanoramiXFreeColors(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2335,7 +2335,7 @@ int PanoramiXStoreColors(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
@ -2358,7 +2358,7 @@ int PanoramiXStoreNamedColor(ClientPtr client)
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) client, stuff->cmap, XRT_COLORMAP, DixWriteAccess)))
return BadColor; return BadColor;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){

View File

@ -1279,7 +1279,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2); len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
@ -1291,7 +1291,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pback_offset); tmp = *((CARD32 *) &stuff[1] + pback_offset);
if ((tmp != None) && (tmp != ParentRelative)) { if ((tmp != None) && (tmp != ParentRelative)) {
if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -1301,7 +1301,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + pbord_offset); tmp = *((CARD32 *) &stuff[1] + pbord_offset);
if (tmp != CopyFromParent) { if (tmp != CopyFromParent) {
if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_PIXMAP, SecurityReadAccess))) client, tmp, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} }
} }
@ -1311,7 +1311,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp = *((CARD32 *) &stuff[1] + cmap_offset); tmp = *((CARD32 *) &stuff[1] + cmap_offset);
if ((tmp != CopyFromParent) && (tmp != None)) { if ((tmp != CopyFromParent) && (tmp != None)) {
if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
client, tmp, XRT_COLORMAP, SecurityReadAccess))) client, tmp, XRT_COLORMAP, DixReadAccess)))
return BadColor; return BadColor;
} }
} }
@ -1351,7 +1351,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client)
int i; int i;
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
for(i = PanoramiXNumScreens - 1; i > 0; i--) { for(i = PanoramiXNumScreens - 1; i > 0; i--) {

View File

@ -600,7 +600,7 @@ ProcSecurityRevokeAuthorization(
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client, pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client,
stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess); stuff->authId, SecurityAuthorizationResType, DixDestroyAccess);
if (!pAuth) if (!pAuth)
return SecurityErrorBase + XSecurityBadAuthorization; return SecurityErrorBase + XSecurityBadAuthorization;
@ -966,7 +966,7 @@ CALLBACK(SecurityCheckResourceIDAccess)
int cid, reqtype; int cid, reqtype;
if (TRUSTLEVEL(client) == XSecurityClientTrusted || if (TRUSTLEVEL(client) == XSecurityClientTrusted ||
SecurityUnknownAccess == access_mode) DixUnknownAccess == access_mode)
return; /* for compatibility, we have to allow access */ return; /* for compatibility, we have to allow access */
cid = CLIENT_ID(id); cid = CLIENT_ID(id);
@ -1217,7 +1217,7 @@ CALLBACK(SecurityCheckHostlistAccess)
if (TRUSTLEVEL(rec->client) != XSecurityClientTrusted) if (TRUSTLEVEL(rec->client) != XSecurityClientTrusted)
{ {
rec->rval = FALSE; rec->rval = FALSE;
if (rec->access_mode == SecurityWriteAccess) if (rec->access_mode == DixWriteAccess)
SecurityAudit("client %d attempted to change host access\n", SecurityAudit("client %d attempted to change host access\n",
rec->client->index); rec->client->index);
else else
@ -1798,11 +1798,11 @@ CALLBACK(SecurityCheckPropertyAccess)
* executed a continue, which will skip the follwing code. * executed a continue, which will skip the follwing code.
*/ */
action = XaceAllowOperation; action = XaceAllowOperation;
if (access_mode & SecurityReadAccess) if (access_mode & DixReadAccess)
action = max(action, pacl->readAction); action = max(action, pacl->readAction);
if (access_mode & SecurityWriteAccess) if (access_mode & DixWriteAccess)
action = max(action, pacl->writeAction); action = max(action, pacl->writeAction);
if (access_mode & SecurityDestroyAccess) if (access_mode & DixDestroyAccess)
action = max(action, pacl->destroyAction); action = max(action, pacl->destroyAction);
break; break;
} /* end for each pacl */ } /* end for each pacl */

View File

@ -390,7 +390,7 @@ ProcPanoramiXShapeRectangles(
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) client, stuff->dest, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
@ -422,7 +422,7 @@ ProcShapeMask (client)
REQUEST_SIZE_MATCH (xShapeMaskReq); REQUEST_SIZE_MATCH (xShapeMaskReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess); pWin = SecurityLookupWindow (stuff->dest, client, DixWriteAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
switch (stuff->destKind) { switch (stuff->destKind) {
@ -444,7 +444,7 @@ ProcShapeMask (client)
srcRgn = 0; srcRgn = 0;
else { else {
pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src, pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src,
RT_PIXMAP, SecurityReadAccess); RT_PIXMAP, DixReadAccess);
if (!pPixmap) if (!pPixmap)
return BadPixmap; return BadPixmap;
if (pPixmap->drawable.pScreen != pScreen || if (pPixmap->drawable.pScreen != pScreen ||
@ -488,12 +488,12 @@ ProcPanoramiXShapeMask(
REQUEST_SIZE_MATCH (xShapeMaskReq); REQUEST_SIZE_MATCH (xShapeMaskReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) client, stuff->dest, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if(stuff->src != None) { if(stuff->src != None) {
if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType( if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->src, XRT_PIXMAP, SecurityReadAccess))) client, stuff->src, XRT_PIXMAP, DixReadAccess)))
return BadPixmap; return BadPixmap;
} else } else
pmap = NULL; pmap = NULL;
@ -616,11 +616,11 @@ ProcPanoramiXShapeCombine(
REQUEST_AT_LEAST_SIZE (xShapeCombineReq); REQUEST_AT_LEAST_SIZE (xShapeCombineReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) client, stuff->dest, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType( if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->src, XRT_WINDOW, SecurityReadAccess))) client, stuff->src, XRT_WINDOW, DixReadAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
@ -688,7 +688,7 @@ ProcPanoramiXShapeOffset(
REQUEST_AT_LEAST_SIZE (xShapeOffsetReq); REQUEST_AT_LEAST_SIZE (xShapeOffsetReq);
if(!(win = (PanoramiXRes *)SecurityLookupIDByType( if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) client, stuff->dest, XRT_WINDOW, DixWriteAccess)))
return BadWindow; return BadWindow;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
@ -822,11 +822,11 @@ ProcShapeSelectInput (client)
XID clientResource; XID clientResource;
REQUEST_SIZE_MATCH (xShapeSelectInputReq); REQUEST_SIZE_MATCH (xShapeSelectInputReq);
pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); pWin = SecurityLookupWindow (stuff->window, client, DixWriteAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
pHead = (ShapeEventPtr *)SecurityLookupIDByType(client, pHead = (ShapeEventPtr *)SecurityLookupIDByType(client,
pWin->drawable.id, EventType, SecurityWriteAccess); pWin->drawable.id, EventType, DixWriteAccess);
switch (stuff->enable) { switch (stuff->enable) {
case xTrue: case xTrue:
if (pHead) { if (pHead) {
@ -999,7 +999,7 @@ ProcShapeInputSelected (client)
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
pHead = (ShapeEventPtr *) SecurityLookupIDByType(client, pHead = (ShapeEventPtr *) SecurityLookupIDByType(client,
pWin->drawable.id, EventType, SecurityReadAccess); pWin->drawable.id, EventType, DixReadAccess);
enabled = xFalse; enabled = xFalse;
if (pHead) { if (pHead) {
for (pShapeEvent = *pHead; for (pShapeEvent = *pHead;

View File

@ -571,11 +571,11 @@ ProcPanoramiXShmPutImage(register ClientPtr client)
REQUEST_SIZE_MATCH(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -621,7 +621,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
} }
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if (draw->type == XRT_PIXMAP) if (draw->type == XRT_PIXMAP)

View File

@ -436,7 +436,7 @@ SyncInitTrigger(client, pTrigger, counter, changes)
if (counter == None) if (counter == None)
pCounter = NULL; pCounter = NULL;
else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType( else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType(
client, counter, RTCounter, SecurityReadAccess))) client, counter, RTCounter, DixReadAccess)))
{ {
client->errorValue = counter; client->errorValue = counter;
return SyncErrorBase + XSyncBadCounter; return SyncErrorBase + XSyncBadCounter;
@ -1550,7 +1550,7 @@ ProcSyncSetCounter(client)
REQUEST_SIZE_MATCH(xSyncSetCounterReq); REQUEST_SIZE_MATCH(xSyncSetCounterReq);
pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid, pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid,
RTCounter, SecurityWriteAccess); RTCounter, DixWriteAccess);
if (pCounter == NULL) if (pCounter == NULL)
{ {
client->errorValue = stuff->cid; client->errorValue = stuff->cid;
@ -1583,7 +1583,7 @@ ProcSyncChangeCounter(client)
REQUEST_SIZE_MATCH(xSyncChangeCounterReq); REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid, pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid,
RTCounter, SecurityWriteAccess); RTCounter, DixWriteAccess);
if (pCounter == NULL) if (pCounter == NULL)
{ {
client->errorValue = stuff->cid; client->errorValue = stuff->cid;
@ -1621,7 +1621,7 @@ ProcSyncDestroyCounter(client)
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter,
RTCounter, SecurityDestroyAccess); RTCounter, DixDestroyAccess);
if (pCounter == NULL) if (pCounter == NULL)
{ {
client->errorValue = stuff->counter; client->errorValue = stuff->counter;
@ -1767,7 +1767,7 @@ ProcSyncQueryCounter(client)
REQUEST_SIZE_MATCH(xSyncQueryCounterReq); REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter,
RTCounter, SecurityReadAccess); RTCounter, DixReadAccess);
if (pCounter == NULL) if (pCounter == NULL)
{ {
client->errorValue = stuff->counter; client->errorValue = stuff->counter;
@ -1896,7 +1896,7 @@ ProcSyncChangeAlarm(client)
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
RTAlarm, SecurityWriteAccess))) RTAlarm, DixWriteAccess)))
{ {
client->errorValue = stuff->alarm; client->errorValue = stuff->alarm;
return SyncErrorBase + XSyncBadAlarm; return SyncErrorBase + XSyncBadAlarm;
@ -1937,7 +1937,7 @@ ProcSyncQueryAlarm(client)
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
RTAlarm, SecurityReadAccess); RTAlarm, DixReadAccess);
if (!pAlarm) if (!pAlarm)
{ {
client->errorValue = stuff->alarm; client->errorValue = stuff->alarm;
@ -1997,7 +1997,7 @@ ProcSyncDestroyAlarm(client)
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
RTAlarm, SecurityDestroyAccess))) RTAlarm, DixDestroyAccess)))
{ {
client->errorValue = stuff->alarm; client->errorValue = stuff->alarm;
return SyncErrorBase + XSyncBadAlarm; return SyncErrorBase + XSyncBadAlarm;

View File

@ -445,11 +445,11 @@ ProcXF86BigfontQueryFont(
#endif #endif
client->errorValue = stuff->id; /* EITHER font or gc */ client->errorValue = stuff->id; /* EITHER font or gc */
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
SecurityReadAccess); DixReadAccess);
if (!pFont) { if (!pFont) {
/* can't use VERIFY_GC because it might return BadGC */ /* can't use VERIFY_GC because it might return BadGC */
GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
SecurityReadAccess); DixReadAccess);
if (!pGC) { if (!pGC) {
client->errorValue = stuff->id; client->errorValue = stuff->id;
return BadFont; /* procotol spec says only error is BadFont */ return BadFont; /* procotol spec says only error is BadFont */

View File

@ -749,7 +749,7 @@ ProcXpGetPageDimensions(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -811,7 +811,7 @@ ProcXpSetImageResolution(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityWriteAccess)) DixWriteAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -859,7 +859,7 @@ ProcXpGetImageResolution(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -1068,7 +1068,7 @@ ProcXpSetContext(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityWriteAccess)) DixWriteAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -1141,7 +1141,7 @@ ProcXpDestroyContext(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityDestroyAccess)) DixDestroyAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -1167,7 +1167,7 @@ ProcXpGetContextScreen(ClientPtr client)
if((pContext =(XpContextPtr)SecurityLookupIDByType(client, if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
return XpErrorBase+XPBadContext; return XpErrorBase+XPBadContext;
@ -1853,7 +1853,7 @@ ProcXpStartPage(ClientPtr client)
return XpErrorBase+XPBadSequence; return XpErrorBase+XPBadSequence;
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin || pWin->drawable.pScreen->myNum != pContext->screenNum) if (!pWin || pWin->drawable.pScreen->myNum != pContext->screenNum)
return BadWindow; return BadWindow;
@ -1994,7 +1994,7 @@ ProcXpGetDocumentData(ClientPtr client)
if((pContext = (XpContextPtr)SecurityLookupIDByType(client, if((pContext = (XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityWriteAccess)) DixWriteAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -2077,7 +2077,7 @@ ProcXpGetAttributes(ClientPtr client)
client, client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -2149,7 +2149,7 @@ ProcXpSetAttributes(ClientPtr client)
client, client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityWriteAccess)) DixWriteAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -2229,7 +2229,7 @@ ProcXpGetOneAttribute(ClientPtr client)
client, client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -2300,7 +2300,7 @@ ProcXpSelectInput(ClientPtr client)
if((pContext=(XpContextPtr)SecurityLookupIDByType(client, if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityWriteAccess)) DixWriteAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;
@ -2336,7 +2336,7 @@ ProcXpInputSelected(ClientPtr client)
if((pContext=(XpContextPtr)SecurityLookupIDByType(client, if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
stuff->printContext, stuff->printContext,
RTcontext, RTcontext,
SecurityReadAccess)) DixReadAccess))
== (XpContextPtr)NULL) == (XpContextPtr)NULL)
{ {
client->errorValue = stuff->printContext; client->errorValue = stuff->printContext;

View File

@ -1877,11 +1877,11 @@ XineramaXvStopVideo(ClientPtr client)
REQUEST_SIZE_MATCH(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
FOR_NSCREENS_BACKWARD(i) { FOR_NSCREENS_BACKWARD(i) {
@ -1905,7 +1905,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
REQUEST_SIZE_MATCH(xvSetPortAttributeReq); REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
FOR_NSCREENS_BACKWARD(i) { FOR_NSCREENS_BACKWARD(i) {
@ -1931,15 +1931,15 @@ XineramaXvShmPutImage(ClientPtr client)
REQUEST_SIZE_MATCH(xvShmPutImageReq); REQUEST_SIZE_MATCH(xvShmPutImageReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1978,15 +1978,15 @@ XineramaXvPutImage(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2023,15 +2023,15 @@ XineramaXvPutVideo(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xvPutVideoReq); REQUEST_AT_LEAST_SIZE(xvPutVideoReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2068,15 +2068,15 @@ XineramaXvPutStill(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq);
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->gc, XRT_GC, SecurityReadAccess))) client, stuff->gc, XRT_GC, DixReadAccess)))
return BadGC; return BadGC;
if(!(port = (PanoramiXRes *)SecurityLookupIDByType( if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
client, stuff->port, XvXRTPort, SecurityReadAccess))) client, stuff->port, XvXRTPort, DixReadAccess)))
return _XvBadPort; return _XvBadPort;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;

View File

@ -179,7 +179,7 @@ ProcDamageCreate (ClientPtr client)
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, SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client,
SecurityReadAccess); DixReadAccess);
switch (stuff->level) { switch (stuff->level) {
case XDamageReportRawRectangles: case XDamageReportRawRectangles:
level = DamageReportRawRegion; level = DamageReportRawRegion;
@ -237,7 +237,7 @@ ProcDamageDestroy (ClientPtr client)
DamageExtPtr pDamageExt; DamageExtPtr pDamageExt;
REQUEST_SIZE_MATCH(xDamageDestroyReq); REQUEST_SIZE_MATCH(xDamageDestroyReq);
VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess);
FreeResource (stuff->damage, RT_NONE); FreeResource (stuff->damage, RT_NONE);
return (client->noClientException); return (client->noClientException);
} }
@ -251,9 +251,9 @@ ProcDamageSubtract (ClientPtr client)
RegionPtr pParts; RegionPtr pParts;
REQUEST_SIZE_MATCH(xDamageSubtractReq); REQUEST_SIZE_MATCH(xDamageSubtractReq);
VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess);
VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, SecurityWriteAccess); VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, DixWriteAccess);
VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, SecurityWriteAccess); VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, DixWriteAccess);
if (pDamageExt->level != DamageReportRawRegion) if (pDamageExt->level != DamageReportRawRegion)
{ {

View File

@ -406,7 +406,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* The window must be valid. */ /* The window must be valid. */
if (!(pWin = SecurityLookupWindow(stuff->window, client, if (!(pWin = SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess))) DixWriteAccess)))
{ {
return(BadWindow); return(BadWindow);
} }
@ -633,9 +633,9 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
/* Buffer name must be valid */ /* Buffer name must be valid */
if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
stuff->buffer, dbeWindowPrivResType, SecurityDestroyAccess)) || stuff->buffer, dbeWindowPrivResType, DixDestroyAccess)) ||
!(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType, !(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType,
SecurityDestroyAccess))) DixDestroyAccess)))
{ {
client->errorValue = stuff->buffer; client->errorValue = stuff->buffer;
return(dbeErrorBase + DbeBadBuffer); return(dbeErrorBase + DbeBadBuffer);
@ -730,7 +730,7 @@ ProcDbeSwapBuffers(ClientPtr client)
/* Each window must be a valid window - BadWindow. */ /* Each window must be a valid window - BadWindow. */
if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
SecurityWriteAccess))) DixWriteAccess)))
{ {
DEALLOCATE_LOCAL(swapInfo); DEALLOCATE_LOCAL(swapInfo);
return(BadWindow); return(BadWindow);
@ -890,7 +890,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
for (i = 0; i < stuff->n; i++) for (i = 0; i < stuff->n; i++)
{ {
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
drawables[i], client, SecurityReadAccess))) drawables[i], client, DixReadAccess)))
{ {
DEALLOCATE_LOCAL(pDrawables); DEALLOCATE_LOCAL(pDrawables);
return(BadDrawable); return(BadDrawable);
@ -1047,7 +1047,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
stuff->buffer, dbeWindowPrivResType, SecurityReadAccess))) stuff->buffer, dbeWindowPrivResType, DixReadAccess)))
{ {
rep.attributes = None; rep.attributes = None;
} }

View File

@ -903,7 +903,7 @@ AllocColor (ColormapPtr pmap,
{ {
ColormapPtr prootmap = (ColormapPtr) ColormapPtr prootmap = (ColormapPtr)
SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pmap->class == prootmap->class) if (pmap->class == prootmap->class)
FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb, FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb,
@ -920,7 +920,7 @@ AllocColor (ColormapPtr pmap,
{ {
ColormapPtr prootmap = (ColormapPtr) ColormapPtr prootmap = (ColormapPtr)
SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pmap->class == prootmap->class) if (pmap->class == prootmap->class)
{ {

View File

@ -262,9 +262,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
GlyphSharePtr pShare; GlyphSharePtr pShare;
sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT, sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT,
SecurityReadAccess); DixReadAccess);
maskfont = (FontPtr) SecurityLookupIDByType(client, mask, RT_FONT, maskfont = (FontPtr) SecurityLookupIDByType(client, mask, RT_FONT,
SecurityReadAccess); DixReadAccess);
if (!sourcefont) if (!sourcefont)
{ {

View File

@ -563,7 +563,7 @@ ProcCreateWindow(ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->wid, client); LEGAL_NEW_RESOURCE(stuff->wid, client);
if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client,
SecurityWriteAccess))) DixWriteAccess)))
return BadWindow; return BadWindow;
len = client->req_len - (sizeof(xCreateWindowReq) >> 2); len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
if (Ones(stuff->mask) != len) if (Ones(stuff->mask) != len)
@ -604,7 +604,7 @@ ProcChangeWindowAttributes(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
@ -629,7 +629,7 @@ ProcGetWindowAttributes(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
GetWindowAttributes(pWin, client, &wa); GetWindowAttributes(pWin, client, &wa);
@ -645,7 +645,7 @@ ProcDestroyWindow(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityDestroyAccess); DixDestroyAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (pWin->parent) if (pWin->parent)
@ -661,7 +661,7 @@ ProcDestroySubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityDestroyAccess); DixDestroyAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
DestroySubwindows(pWin, client); DestroySubwindows(pWin, client);
@ -677,7 +677,7 @@ ProcChangeSaveSet(register ClientPtr client)
REQUEST_SIZE_MATCH(xChangeSaveSetReq); REQUEST_SIZE_MATCH(xChangeSaveSetReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
@ -706,11 +706,11 @@ ProcReparentWindow(register ClientPtr client)
REQUEST_SIZE_MATCH(xReparentWindowReq); REQUEST_SIZE_MATCH(xReparentWindowReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client,
SecurityWriteAccess); DixWriteAccess);
if (!pParent) if (!pParent)
return(BadWindow); return(BadWindow);
if (SAME_SCREENS(pWin->drawable, pParent->drawable)) if (SAME_SCREENS(pWin->drawable, pParent->drawable))
@ -740,7 +740,7 @@ ProcMapWindow(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
MapWindow(pWin, client); MapWindow(pWin, client);
@ -756,7 +756,7 @@ ProcMapSubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
MapSubwindows(pWin, client); MapSubwindows(pWin, client);
@ -772,7 +772,7 @@ ProcUnmapWindow(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
UnmapWindow(pWin, FALSE); UnmapWindow(pWin, FALSE);
@ -788,7 +788,7 @@ ProcUnmapSubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
UnmapSubwindows(pWin); UnmapSubwindows(pWin);
@ -805,7 +805,7 @@ ProcConfigureWindow(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
@ -833,7 +833,7 @@ ProcCirculateWindow(register ClientPtr client)
return BadValue; return BadValue;
} }
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
CirculateWindow(pWin, (int)stuff->direction, client); CirculateWindow(pWin, (int)stuff->direction, client);
@ -847,7 +847,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep)
REQUEST(xResourceReq); REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, DixReadAccess);
rep->type = X_Reply; rep->type = X_Reply;
rep->length = 0; rep->length = 0;
rep->sequenceNumber = client->sequence; rep->sequenceNumber = client->sequence;
@ -906,7 +906,7 @@ ProcQueryTree(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
reply.type = X_Reply; reply.type = X_Reply;
@ -1022,7 +1022,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if (stuff->window != None) if (stuff->window != None)
{ {
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
} }
@ -1141,7 +1141,7 @@ ProcConvertSelection(register ClientPtr client)
REQUEST_SIZE_MATCH(xConvertSelectionReq); REQUEST_SIZE_MATCH(xConvertSelectionReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
@ -1159,7 +1159,7 @@ ProcConvertSelection(register ClientPtr client)
(CurrentSelections[i].window != None) && (CurrentSelections[i].window != None) &&
XaceHook(XACE_RESOURCE_ACCESS, client, XaceHook(XACE_RESOURCE_ACCESS, client,
CurrentSelections[i].window, RT_WINDOW, CurrentSelections[i].window, RT_WINDOW,
SecurityReadAccess, CurrentSelections[i].pWin)) DixReadAccess, CurrentSelections[i].pWin))
{ {
event.u.u.type = SelectionRequest; event.u.u.type = SelectionRequest;
event.u.selectionRequest.time = stuff->time; event.u.selectionRequest.time = stuff->time;
@ -1263,11 +1263,11 @@ ProcTranslateCoords(register ClientPtr client)
REQUEST_SIZE_MATCH(xTranslateCoordsReq); REQUEST_SIZE_MATCH(xTranslateCoordsReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client,
SecurityReadAccess); DixReadAccess);
if (!pDst) if (!pDst)
return(BadWindow); return(BadWindow);
rep.type = X_Reply; rep.type = X_Reply;
@ -1358,7 +1358,7 @@ ProcCloseFont(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
SecurityDestroyAccess); DixDestroyAccess);
if ( pFont != (FontPtr)NULL) /* id was valid */ if ( pFont != (FontPtr)NULL) /* id was valid */
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
@ -1382,12 +1382,12 @@ ProcQueryFont(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
client->errorValue = stuff->id; /* EITHER font or gc */ client->errorValue = stuff->id; /* EITHER font or gc */
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
SecurityReadAccess); DixReadAccess);
if (!pFont) if (!pFont)
{ {
/* can't use VERIFY_GC because it might return BadGC */ /* can't use VERIFY_GC because it might return BadGC */
pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
SecurityReadAccess); DixReadAccess);
if (!pGC) if (!pGC)
{ {
client->errorValue = stuff->id; client->errorValue = stuff->id;
@ -1443,11 +1443,11 @@ ProcQueryTextExtents(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq);
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT,
SecurityReadAccess); DixReadAccess);
if (!pFont) if (!pFont)
{ {
pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC,
SecurityReadAccess); DixReadAccess);
if (!pGC) if (!pGC)
{ {
client->errorValue = stuff->fid; client->errorValue = stuff->fid;
@ -1526,7 +1526,7 @@ ProcCreatePixmap(register ClientPtr client)
client->errorValue = stuff->pid; client->errorValue = stuff->pid;
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client,
SecurityReadAccess); DixReadAccess);
if (!stuff->width || !stuff->height) if (!stuff->width || !stuff->height)
{ {
client->errorValue = 0; client->errorValue = 0;
@ -1581,7 +1581,7 @@ ProcFreePixmap(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP,
SecurityDestroyAccess); DixDestroyAccess);
if (pMap) if (pMap)
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
@ -1607,7 +1607,7 @@ ProcCreateGC(register ClientPtr client)
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, SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client,
SecurityReadAccess); DixReadAccess);
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;
@ -1629,7 +1629,7 @@ ProcChangeGC(register ClientPtr client)
unsigned len; unsigned len;
REQUEST_AT_LEAST_SIZE(xChangeGCReq); REQUEST_AT_LEAST_SIZE(xChangeGCReq);
SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess);
len = client->req_len - (sizeof(xChangeGCReq) >> 2); len = client->req_len - (sizeof(xChangeGCReq) >> 2);
if (len != Ones(stuff->mask)) if (len != Ones(stuff->mask))
return BadLength; return BadLength;
@ -1653,8 +1653,8 @@ ProcCopyGC(register ClientPtr client)
REQUEST(xCopyGCReq); REQUEST(xCopyGCReq);
REQUEST_SIZE_MATCH(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq);
SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, DixReadAccess);
SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, DixWriteAccess);
if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth))
return (BadMatch); return (BadMatch);
result = CopyGC(pGC, dstGC, stuff->mask); result = CopyGC(pGC, dstGC, stuff->mask);
@ -1681,7 +1681,7 @@ ProcSetDashes(register ClientPtr client)
return BadValue; return BadValue;
} }
SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess);
result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes,
(unsigned char *)&stuff[1]); (unsigned char *)&stuff[1]);
@ -1709,7 +1709,7 @@ ProcSetClipRectangles(register ClientPtr client)
client->errorValue = stuff->ordering; client->errorValue = stuff->ordering;
return BadValue; return BadValue;
} }
SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess);
nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq);
if (nr & 4) if (nr & 4)
@ -1730,7 +1730,7 @@ ProcFreeGC(register ClientPtr client)
REQUEST(xResourceReq); REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); SECURITY_VERIFY_GC(pGC, stuff->id, client, DixDestroyAccess);
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return(client->noClientException); return(client->noClientException);
} }
@ -1743,7 +1743,7 @@ ProcClearToBackground(register ClientPtr client)
REQUEST_SIZE_MATCH(xClearAreaReq); REQUEST_SIZE_MATCH(xClearAreaReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (pWin->drawable.class == InputOnly) if (pWin->drawable.class == InputOnly)
@ -1777,7 +1777,7 @@ ProcCopyArea(register ClientPtr client)
if (stuff->dstDrawable != stuff->srcDrawable) if (stuff->dstDrawable != stuff->srcDrawable)
{ {
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
SecurityReadAccess); DixReadAccess);
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;
@ -1817,7 +1817,7 @@ ProcCopyPlane(register ClientPtr client)
if (stuff->dstDrawable != stuff->srcDrawable) if (stuff->dstDrawable != stuff->srcDrawable)
{ {
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
SecurityReadAccess); DixReadAccess);
if (pdstDraw->pScreen != psrcDraw->pScreen) if (pdstDraw->pScreen != psrcDraw->pScreen)
{ {
client->errorValue = stuff->dstDrawable; client->errorValue = stuff->dstDrawable;
@ -2156,7 +2156,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
client->errorValue = format; client->errorValue = format;
return(BadValue); return(BadValue);
} }
SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess);
if(pDraw->type == DRAWABLE_WINDOW) if(pDraw->type == DRAWABLE_WINDOW)
{ {
if( /* check for being viewable */ if( /* check for being viewable */
@ -2478,7 +2478,7 @@ ProcCreateColormap(register ClientPtr client)
mid = stuff->mid; mid = stuff->mid;
LEGAL_NEW_RESOURCE(mid, client); LEGAL_NEW_RESOURCE(mid, client);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
@ -2508,7 +2508,7 @@ ProcFreeColormap(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP,
SecurityDestroyAccess); DixDestroyAccess);
if (pmap) if (pmap)
{ {
/* Freeing a default colormap is a no-op */ /* Freeing a default colormap is a no-op */
@ -2536,7 +2536,7 @@ ProcCopyColormapAndFree(register ClientPtr client)
mid = stuff->mid; mid = stuff->mid;
LEGAL_NEW_RESOURCE(mid, client); LEGAL_NEW_RESOURCE(mid, client);
if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap,
RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) RT_COLORMAP, DixReadAccess|DixWriteAccess)) )
{ {
result = CopyColormapAndFree(mid, pSrcMap, client->index); result = CopyColormapAndFree(mid, pSrcMap, client->index);
if (client->noClientException != Success) if (client->noClientException != Success)
@ -2559,7 +2559,7 @@ ProcInstallColormap(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pcmp) if (pcmp)
{ {
(*(pcmp->pScreen->InstallColormap)) (pcmp); (*(pcmp->pScreen->InstallColormap)) (pcmp);
@ -2580,7 +2580,7 @@ ProcUninstallColormap(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pcmp) if (pcmp)
{ {
if(pcmp->mid != pcmp->pScreen->defColormap) if(pcmp->mid != pcmp->pScreen->defColormap)
@ -2604,7 +2604,7 @@ ProcListInstalledColormaps(register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
@ -2639,7 +2639,7 @@ ProcAllocColor (register ClientPtr client)
REQUEST_SIZE_MATCH(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq);
pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pmap) if (pmap)
{ {
acr.type = X_Reply; acr.type = X_Reply;
@ -2679,7 +2679,7 @@ ProcAllocNamedColor (register ClientPtr client)
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
int retval; int retval;
@ -2731,7 +2731,7 @@ ProcAllocColorCells (register ClientPtr client)
REQUEST_SIZE_MATCH(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xAllocColorCellsReply accr; xAllocColorCellsReply accr;
@ -2797,7 +2797,7 @@ ProcAllocColorPlanes(register ClientPtr client)
REQUEST_SIZE_MATCH(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xAllocColorPlanesReply acpr; xAllocColorPlanesReply acpr;
@ -2861,7 +2861,7 @@ ProcFreeColors(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
int count; int count;
@ -2896,7 +2896,7 @@ ProcStoreColors (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
int count; int count;
@ -2930,7 +2930,7 @@ ProcStoreNamedColor (register ClientPtr client)
REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityWriteAccess); RT_COLORMAP, DixWriteAccess);
if (pcmp) if (pcmp)
{ {
xColorItem def; xColorItem def;
@ -2964,7 +2964,7 @@ ProcQueryColors(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xQueryColorsReq); REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pcmp) if (pcmp)
{ {
int count, retval; int count, retval;
@ -3015,7 +3015,7 @@ ProcLookupColor(register ClientPtr client)
REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes);
pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (pcmp) if (pcmp)
{ {
xLookupColorReply lcr; xLookupColorReply lcr;
@ -3065,9 +3065,9 @@ ProcCreateCursor (register ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->cid, client); LEGAL_NEW_RESOURCE(stuff->cid, client);
src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source,
RT_PIXMAP, SecurityReadAccess); RT_PIXMAP, DixReadAccess);
msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask,
RT_PIXMAP, SecurityReadAccess); RT_PIXMAP, DixReadAccess);
if ( src == (PixmapPtr)NULL) if ( src == (PixmapPtr)NULL)
{ {
client->errorValue = stuff->source; client->errorValue = stuff->source;
@ -3167,7 +3167,7 @@ ProcFreeCursor (register ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id,
RT_CURSOR, SecurityDestroyAccess); RT_CURSOR, DixDestroyAccess);
if (pCursor) if (pCursor)
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
@ -3197,7 +3197,7 @@ ProcQueryBestSize (register ClientPtr client)
return(BadValue); return(BadValue);
} }
SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client,
SecurityReadAccess); DixReadAccess);
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;
@ -3321,7 +3321,7 @@ ProcListHosts(register ClientPtr client)
REQUEST_SIZE_MATCH(xListHostsReq); REQUEST_SIZE_MATCH(xListHostsReq);
/* untrusted clients can't list hosts */ /* untrusted clients can't list hosts */
if (!XaceHook(XACE_HOSTLIST_ACCESS, client, SecurityReadAccess)) if (!XaceHook(XACE_HOSTLIST_ACCESS, client, DixReadAccess))
return BadAccess; return BadAccess;
result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); result = GetHosts(&pdata, &nHosts, &len, &reply.enabled);

View File

@ -1178,7 +1178,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
if (c->slept && if (c->slept &&
c->pDraw && c->pDraw &&
c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did,
RC_DRAWABLE, SecurityWriteAccess)) RC_DRAWABLE, DixWriteAccess))
{ {
/* Our drawable has disappeared. Treat like client died... ask /* Our drawable has disappeared. Treat like client died... ask
the FPE code to clean up after client and avoid further the FPE code to clean up after client and avoid further
@ -1208,7 +1208,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
| ((Font)*(c->pElt+2)) << 16 | ((Font)*(c->pElt+2)) << 16
| ((Font)*(c->pElt+1)) << 24; | ((Font)*(c->pElt+1)) << 24;
pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT,
SecurityReadAccess); DixReadAccess);
if (!pFont) if (!pFont)
{ {
client->errorValue = fid; client->errorValue = fid;
@ -1463,7 +1463,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
if (c->slept && if (c->slept &&
c->pDraw && c->pDraw &&
c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did,
RC_DRAWABLE, SecurityWriteAccess)) RC_DRAWABLE, DixWriteAccess))
{ {
/* Our drawable has disappeared. Treat like client died... ask /* Our drawable has disappeared. Treat like client died... ask
the FPE code to clean up after client. */ the FPE code to clean up after client. */
@ -2016,7 +2016,7 @@ FontPtr
find_old_font(XID id) find_old_font(XID id)
{ {
return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE,
SecurityUnknownAccess); DixUnknownAccess);
} }
Font Font

View File

@ -236,13 +236,13 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode)
_X_EXPORT WindowPtr _X_EXPORT WindowPtr
LookupWindow(XID rid, ClientPtr client) LookupWindow(XID rid, ClientPtr client)
{ {
return SecurityLookupWindow(rid, client, SecurityUnknownAccess); return SecurityLookupWindow(rid, client, DixUnknownAccess);
} }
_X_EXPORT pointer _X_EXPORT pointer
LookupDrawable(XID rid, ClientPtr client) LookupDrawable(XID rid, ClientPtr client)
{ {
return SecurityLookupDrawable(rid, client, SecurityUnknownAccess); return SecurityLookupDrawable(rid, client, DixUnknownAccess);
} }
#else /* not XACE */ #else /* not XACE */
@ -293,7 +293,7 @@ _X_EXPORT ClientPtr
LookupClient(XID rid, ClientPtr client) LookupClient(XID rid, ClientPtr client)
{ {
pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY, pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY,
SecurityReadAccess); DixReadAccess);
int clientIndex = CLIENT_ID(rid); int clientIndex = CLIENT_ID(rid);
if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT))

View File

@ -2235,7 +2235,7 @@ XineramaWarpPointer(ClientPtr client)
if (stuff->dstWid != None) if (stuff->dstWid != None)
{ {
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess);
if (!dest) if (!dest)
return BadWindow; return BadWindow;
} }
@ -2248,7 +2248,7 @@ XineramaWarpPointer(ClientPtr client)
XID winID = stuff->srcWid; XID winID = stuff->srcWid;
WindowPtr source; WindowPtr source;
source = SecurityLookupWindow(winID, client, SecurityReadAccess); source = SecurityLookupWindow(winID, client, DixReadAccess);
if (!source) return BadWindow; if (!source) return BadWindow;
winX = source->drawable.x; winX = source->drawable.x;
@ -2315,7 +2315,7 @@ ProcWarpPointer(ClientPtr client)
if (stuff->dstWid != None) if (stuff->dstWid != None)
{ {
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess);
if (!dest) if (!dest)
return BadWindow; return BadWindow;
} }
@ -2328,7 +2328,7 @@ ProcWarpPointer(ClientPtr client)
XID winID = stuff->srcWid; XID winID = stuff->srcWid;
WindowPtr source; WindowPtr source;
source = SecurityLookupWindow(winID, client, SecurityReadAccess); source = SecurityLookupWindow(winID, client, DixReadAccess);
if (!source) return BadWindow; if (!source) return BadWindow;
winX = source->drawable.x; winX = source->drawable.x;
@ -3551,7 +3551,7 @@ SetInputFocus(
else if ((focusID == FollowKeyboard) && followOK) else if ((focusID == FollowKeyboard) && followOK)
focusWin = inputInfo.keyboard->focus->win; focusWin = inputInfo.keyboard->focus->win;
else if (!(focusWin = SecurityLookupWindow(focusID, client, else if (!(focusWin = SecurityLookupWindow(focusID, client,
SecurityReadAccess))) DixReadAccess)))
return BadWindow; return BadWindow;
else else
{ {
@ -3671,7 +3671,7 @@ ProcGrabPointer(ClientPtr client)
client->errorValue = stuff->eventMask; client->errorValue = stuff->eventMask;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if (stuff->confineTo == None) if (stuff->confineTo == None)
@ -3679,7 +3679,7 @@ ProcGrabPointer(ClientPtr client)
else else
{ {
confineTo = SecurityLookupWindow(stuff->confineTo, client, confineTo = SecurityLookupWindow(stuff->confineTo, client,
SecurityReadAccess); DixReadAccess);
if (!confineTo) if (!confineTo)
return BadWindow; return BadWindow;
} }
@ -3688,7 +3688,7 @@ ProcGrabPointer(ClientPtr client)
else else
{ {
cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
RT_CURSOR, SecurityReadAccess); RT_CURSOR, DixReadAccess);
if (!cursor) if (!cursor)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
@ -3762,7 +3762,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
else else
{ {
newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
RT_CURSOR, SecurityReadAccess); RT_CURSOR, DixReadAccess);
if (!newCursor) if (!newCursor)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
@ -3832,7 +3832,7 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
client->errorValue = ownerEvents; client->errorValue = ownerEvents;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
time = ClientTimeToServerTime(ctime); time = ClientTimeToServerTime(ctime);
@ -3920,7 +3920,7 @@ ProcQueryPointer(ClientPtr client)
DeviceIntPtr mouse = inputInfo.pointer; DeviceIntPtr mouse = inputInfo.pointer;
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->id, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if (mouse->valuator->motionHintWindow) if (mouse->valuator->motionHintWindow)
@ -4087,7 +4087,7 @@ ProcSendEvent(ClientPtr client)
} }
else else
pWin = SecurityLookupWindow(stuff->destination, client, pWin = SecurityLookupWindow(stuff->destination, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue))
@ -4125,7 +4125,7 @@ ProcUngrabKey(ClientPtr client)
DeviceIntPtr keybd = inputInfo.keyboard; DeviceIntPtr keybd = inputInfo.keyboard;
REQUEST_SIZE_MATCH(xUngrabKeyReq); REQUEST_SIZE_MATCH(xUngrabKeyReq);
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -4196,7 +4196,7 @@ ProcGrabKey(ClientPtr client)
client->errorValue = stuff->modifiers; client->errorValue = stuff->modifiers;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -4248,14 +4248,14 @@ ProcGrabButton(ClientPtr client)
client->errorValue = stuff->eventMask; client->errorValue = stuff->eventMask;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if (stuff->confineTo == None) if (stuff->confineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else { else {
confineTo = SecurityLookupWindow(stuff->confineTo, client, confineTo = SecurityLookupWindow(stuff->confineTo, client,
SecurityReadAccess); DixReadAccess);
if (!confineTo) if (!confineTo)
return BadWindow; return BadWindow;
} }
@ -4264,7 +4264,7 @@ ProcGrabButton(ClientPtr client)
else else
{ {
cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
RT_CURSOR, SecurityReadAccess); RT_CURSOR, DixReadAccess);
if (!cursor) if (!cursor)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
@ -4297,7 +4297,7 @@ ProcUngrabButton(ClientPtr client)
client->errorValue = stuff->modifiers; client->errorValue = stuff->modifiers;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
tempGrab.resource = client->clientAsMask; tempGrab.resource = client->clientAsMask;
@ -4451,7 +4451,7 @@ ProcRecolorCursor(ClientPtr client)
REQUEST_SIZE_MATCH(xRecolorCursorReq); REQUEST_SIZE_MATCH(xRecolorCursorReq);
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
RT_CURSOR, SecurityWriteAccess); RT_CURSOR, DixWriteAccess);
if ( !pCursor) if ( !pCursor)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;

View File

@ -271,7 +271,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{ {
NEXTVAL(XID, newpix); NEXTVAL(XID, newpix);
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
newpix, RT_PIXMAP, SecurityReadAccess); newpix, RT_PIXMAP, DixReadAccess);
} }
if (pPixmap) if (pPixmap)
{ {
@ -307,7 +307,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{ {
NEXTVAL(XID, newstipple) NEXTVAL(XID, newstipple)
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
newstipple, RT_PIXMAP, SecurityReadAccess); newstipple, RT_PIXMAP, DixReadAccess);
} }
if (pPixmap) if (pPixmap)
{ {
@ -349,7 +349,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{ {
NEXTVAL(XID, newfont) NEXTVAL(XID, newfont)
pFont = (FontPtr)SecurityLookupIDByType(client, newfont, pFont = (FontPtr)SecurityLookupIDByType(client, newfont,
RT_FONT, SecurityReadAccess); RT_FONT, DixReadAccess);
} }
if (pFont) if (pFont)
{ {
@ -416,7 +416,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
} }
else else
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
pid, RT_PIXMAP, SecurityReadAccess); pid, RT_PIXMAP, DixReadAccess);
} }
if (pPixmap) if (pPixmap)

View File

@ -105,7 +105,7 @@ ProcRotateProperties(ClientPtr client)
REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (!stuff->nAtoms) if (!stuff->nAtoms)
@ -117,7 +117,7 @@ ProcRotateProperties(ClientPtr client)
for (i = 0; i < stuff->nAtoms; i++) for (i = 0; i < stuff->nAtoms; i++)
{ {
char action = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, atoms[i], char action = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, atoms[i],
SecurityReadAccess|SecurityWriteAccess); DixReadAccess|DixWriteAccess);
if (!ValidAtom(atoms[i]) || (XaceErrorOperation == action)) { if (!ValidAtom(atoms[i]) || (XaceErrorOperation == action)) {
DEALLOCATE_LOCAL(props); DEALLOCATE_LOCAL(props);
@ -209,7 +209,7 @@ ProcChangeProperty(ClientPtr client)
REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
@ -224,7 +224,7 @@ ProcChangeProperty(ClientPtr client)
} }
switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property,
SecurityWriteAccess)) DixWriteAccess))
{ {
case XaceErrorOperation: case XaceErrorOperation:
client->errorValue = stuff->property; client->errorValue = stuff->property;
@ -448,14 +448,14 @@ ProcGetProperty(ClientPtr client)
unsigned long n, len, ind; unsigned long n, len, ind;
WindowPtr pWin; WindowPtr pWin;
xGetPropertyReply reply; xGetPropertyReply reply;
Mask access_mode = SecurityReadAccess; Mask access_mode = DixReadAccess;
REQUEST(xGetPropertyReq); REQUEST(xGetPropertyReq);
REQUEST_SIZE_MATCH(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq);
if (stuff->delete) if (stuff->delete)
UpdateCurrentTime(); UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -491,7 +491,7 @@ ProcGetProperty(ClientPtr client)
return NullPropertyReply(client, None, 0, &reply); return NullPropertyReply(client, None, 0, &reply);
if (stuff->delete) if (stuff->delete)
access_mode |= SecurityDestroyAccess; access_mode |= DixDestroyAccess;
switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property,
access_mode)) access_mode))
{ {
@ -592,7 +592,7 @@ ProcListProperties(ClientPtr client)
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
@ -637,7 +637,7 @@ ProcDeleteProperty(register ClientPtr client)
REQUEST_SIZE_MATCH(xDeletePropertyReq); REQUEST_SIZE_MATCH(xDeletePropertyReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityWriteAccess); DixWriteAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
@ -647,7 +647,7 @@ ProcDeleteProperty(register ClientPtr client)
} }
switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property,
SecurityDestroyAccess)) DixDestroyAccess))
{ {
case XaceErrorOperation: case XaceErrorOperation:
client->errorValue = stuff->property; client->errorValue = stuff->property;

View File

@ -944,12 +944,12 @@ _X_EXPORT pointer
LookupIDByType(XID id, RESTYPE rtype) LookupIDByType(XID id, RESTYPE rtype)
{ {
return SecurityLookupIDByType(NullClient, id, rtype, return SecurityLookupIDByType(NullClient, id, rtype,
SecurityUnknownAccess); DixUnknownAccess);
} }
_X_EXPORT pointer _X_EXPORT pointer
LookupIDByClass(XID id, RESTYPE classes) LookupIDByClass(XID id, RESTYPE classes)
{ {
return SecurityLookupIDByClass(NullClient, id, classes, return SecurityLookupIDByClass(NullClient, id, classes,
SecurityUnknownAccess); DixUnknownAccess);
} }

View File

@ -1062,7 +1062,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else else
{ {
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
RT_PIXMAP, SecurityReadAccess); RT_PIXMAP, DixReadAccess);
if (pPixmap != (PixmapPtr) NULL) if (pPixmap != (PixmapPtr) NULL)
{ {
if ((pPixmap->drawable.depth != pWin->drawable.depth) || if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
@ -1123,7 +1123,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else else
{ {
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
RT_PIXMAP, SecurityReadAccess); RT_PIXMAP, DixReadAccess);
if (pPixmap) if (pPixmap)
{ {
if ((pPixmap->drawable.depth != pWin->drawable.depth) || if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
@ -1333,7 +1333,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
goto PatchUp; goto PatchUp;
} }
pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap,
RT_COLORMAP, SecurityReadAccess); RT_COLORMAP, DixReadAccess);
if (!pCmap) if (!pCmap)
{ {
error = BadColor; error = BadColor;
@ -1409,7 +1409,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else else
{ {
pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID,
RT_CURSOR, SecurityReadAccess); RT_CURSOR, DixReadAccess);
if (!pCursor) if (!pCursor)
{ {
error = BadCursor; error = BadCursor;
@ -2299,7 +2299,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
sibwid = (Window ) *pVlist; sibwid = (Window ) *pVlist;
pVlist++; pVlist++;
pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid,
RT_WINDOW, SecurityReadAccess); RT_WINDOW, DixReadAccess);
if (!pSib) if (!pSib)
{ {
client->errorValue = sibwid; client->errorValue = sibwid;

View File

@ -268,7 +268,7 @@ ProcAppleWMSelectInput (client)
REQUEST_SIZE_MATCH (xAppleWMSelectInputReq); REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
pHead = (WMEventPtr *)SecurityLookupIDByType(client, pHead = (WMEventPtr *)SecurityLookupIDByType(client,
eventResource, EventType, SecurityWriteAccess); eventResource, EventType, DixWriteAccess);
if (stuff->mask != 0) { if (stuff->mask != 0) {
if (pHead) { if (pHead) {
/* check for existing entry. */ /* check for existing entry. */
@ -491,7 +491,7 @@ ProcAppleWMSetWindowLevel(
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
client, SecurityReadAccess))) client, DixReadAccess)))
{ {
return BadValue; return BadValue;
} }
@ -603,7 +603,7 @@ ProcAppleWMFrameDraw(
REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq); REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
client, SecurityReadAccess))) client, DixReadAccess)))
{ {
return BadValue; return BadValue;
} }

View File

@ -223,7 +223,7 @@ ProcAppleDRICreateSurface(
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
client, client,
SecurityReadAccess))) { DixReadAccess))) {
return BadValue; return BadValue;
} }
@ -256,7 +256,7 @@ ProcAppleDRIDestroySurface(
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
client, client,
SecurityReadAccess))) { DixReadAccess))) {
return BadValue; return BadValue;
} }

View File

@ -282,12 +282,12 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
int i; int i;
if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW, if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW,
SecurityReadAccess))) DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
FOR_NSCREENS(i) { FOR_NSCREENS(i) {
if (!(pWin = SecurityLookupWindow(win->info[i].id, client, if (!(pWin = SecurityLookupWindow(win->info[i].id, client,
SecurityReadAccess))) DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
dmxForceWindowCreation(pWin); dmxForceWindowCreation(pWin);
@ -297,7 +297,7 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
#endif #endif
if (!(pWin = SecurityLookupWindow(stuff->window, client, if (!(pWin = SecurityLookupWindow(stuff->window, client,
SecurityReadAccess))) DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
dmxForceWindowCreation(pWin); dmxForceWindowCreation(pWin);
@ -556,12 +556,12 @@ static int dmxPopulatePanoramiX(ClientPtr client, Window window,
DMXWindowAttributesRec attr; DMXWindowAttributesRec attr;
if (!(win = SecurityLookupIDByType(client, window, XRT_WINDOW, if (!(win = SecurityLookupIDByType(client, window, XRT_WINDOW,
SecurityReadAccess))) DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
FOR_NSCREENS(i) { FOR_NSCREENS(i) {
if (!(pWin = SecurityLookupWindow(win->info[i].id, client, if (!(pWin = SecurityLookupWindow(win->info[i].id, client,
SecurityReadAccess))) DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
if (dmxGetWindowAttributes(pWin, &attr)) { if (dmxGetWindowAttributes(pWin, &attr)) {
screens[count] = attr.screen; screens[count] = attr.screen;
@ -587,7 +587,7 @@ static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
pos, vis); pos, vis);
#endif #endif
if (!(pWin = SecurityLookupWindow(window, client, SecurityReadAccess))) if (!(pWin = SecurityLookupWindow(window, client, DixReadAccess)))
return -1; /* BadWindow */ return -1; /* BadWindow */
dmxGetWindowAttributes(pWin, &attr); dmxGetWindowAttributes(pWin, &attr);

View File

@ -247,7 +247,7 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
/* Make sure we handle all errors here!! */ /* Make sure we handle all errors here!! */
glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType, glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType,
SecurityDestroyAccess); DixDestroyAccess);
glyphPriv = xalloc(sizeof(dmxGlyphPrivRec)); glyphPriv = xalloc(sizeof(dmxGlyphPrivRec));
if (!glyphPriv) return BadAlloc; if (!glyphPriv) return BadAlloc;
glyphPriv->glyphSets = NULL; glyphPriv->glyphSets = NULL;
@ -255,7 +255,7 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv); DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv);
pFmt = SecurityLookupIDByType(client, stuff->format, PictFormatType, pFmt = SecurityLookupIDByType(client, stuff->format, PictFormatType,
SecurityReadAccess); DixReadAccess);
oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler); oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler);
@ -315,7 +315,7 @@ static int dmxProcRenderFreeGlyphSet(ClientPtr client)
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType, glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType,
SecurityDestroyAccess); DixDestroyAccess);
if (glyphSet && glyphSet->refcnt == 1) { if (glyphSet && glyphSet->refcnt == 1) {
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
@ -358,7 +358,7 @@ static int dmxProcRenderAddGlyphs(ClientPtr client)
int nbytes; int nbytes;
glyphSet = SecurityLookupIDByType(client, stuff->glyphset, glyphSet = SecurityLookupIDByType(client, stuff->glyphset,
GlyphSetType, SecurityReadAccess); GlyphSetType, DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
nglyphs = stuff->nglyphs; nglyphs = stuff->nglyphs;
@ -401,7 +401,7 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType, glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType,
SecurityWriteAccess); DixWriteAccess);
if (glyphSet) { if (glyphSet) {
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
@ -473,13 +473,13 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
dmxGlyphPrivPtr glyphPriv; dmxGlyphPrivPtr glyphPriv;
pSrc = SecurityLookupIDByType(client, stuff->src, PictureType, pSrc = SecurityLookupIDByType(client, stuff->src, PictureType,
SecurityReadAccess); DixReadAccess);
pSrcPriv = DMX_GET_PICT_PRIV(pSrc); pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
if (!pSrcPriv->pict) if (!pSrcPriv->pict)
return ret; return ret;
pDst = SecurityLookupIDByType(client, stuff->dst, PictureType, pDst = SecurityLookupIDByType(client, stuff->dst, PictureType,
SecurityWriteAccess); DixWriteAccess);
pDstPriv = DMX_GET_PICT_PRIV(pDst); pDstPriv = DMX_GET_PICT_PRIV(pDst);
if (!pDstPriv->pict) if (!pDstPriv->pict)
return ret; return ret;
@ -496,7 +496,7 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
if (stuff->maskFormat) if (stuff->maskFormat)
pFmt = SecurityLookupIDByType(client, stuff->maskFormat, pFmt = SecurityLookupIDByType(client, stuff->maskFormat,
PictFormatType, SecurityReadAccess); PictFormatType, DixReadAccess);
else else
pFmt = NULL; pFmt = NULL;
@ -547,7 +547,7 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
curElt = elts; curElt = elts;
glyphSet = SecurityLookupIDByType(client, stuff->glyphset, glyphSet = SecurityLookupIDByType(client, stuff->glyphset,
GlyphSetType, SecurityReadAccess); GlyphSetType, DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
while (buffer + sizeof(xGlyphElt) < end) { while (buffer + sizeof(xGlyphElt) < end) {
@ -558,7 +558,7 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
glyphSet = SecurityLookupIDByType(client, glyphSet = SecurityLookupIDByType(client,
*((CARD32 *)buffer), *((CARD32 *)buffer),
GlyphSetType, GlyphSetType,
SecurityReadAccess); DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
buffer += 4; buffer += 4;
} else { } else {
@ -622,7 +622,7 @@ static int dmxProcRenderSetPictureTransform(ClientPtr client)
REQUEST(xRenderSetPictureTransformReq); REQUEST(xRenderSetPictureTransformReq);
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
/* For the following to work with PanoramiX, it assumes that Render /* For the following to work with PanoramiX, it assumes that Render
@ -663,7 +663,7 @@ static int dmxProcRenderSetPictureFilter(ClientPtr client)
REQUEST(xRenderSetPictureFilterReq); REQUEST(xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
/* For the following to work with PanoramiX, it assumes that Render /* For the following to work with PanoramiX, it assumes that Render

View File

@ -1105,13 +1105,13 @@ static int MakeCurrent(__GLXclientState *cl,
if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) { if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) {
pXinDraw = (PanoramiXRes *) pXinDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
} }
if (pReadDraw && pReadDraw != pDraw && if (pReadDraw && pReadDraw != pDraw &&
new_reply.readType != GLX_PBUFFER_TYPE) { new_reply.readType != GLX_PBUFFER_TYPE) {
pXinReadDraw = (PanoramiXRes *) pXinReadDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, DixReadAccess);
} }
else { else {
pXinReadDraw = pXinDraw; pXinReadDraw = pXinDraw;
@ -1139,7 +1139,7 @@ static int MakeCurrent(__GLXclientState *cl,
else if (pXinDraw) { else if (pXinDraw) {
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id, pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id,
client, client,
SecurityReadAccess); DixReadAccess);
} }
#endif #endif
else if (pGlxWindow) { else if (pGlxWindow) {
@ -1197,7 +1197,7 @@ static int MakeCurrent(__GLXclientState *cl,
else if (pXinReadDraw) { else if (pXinReadDraw) {
pReadWin = (WindowPtr)SecurityLookupWindow(pXinReadDraw->info[s].id, pReadWin = (WindowPtr)SecurityLookupWindow(pXinReadDraw->info[s].id,
client, client,
SecurityReadAccess); DixReadAccess);
} }
#endif #endif
else if (pGlxReadWindow) { else if (pGlxReadWindow) {
@ -1768,7 +1768,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
to_screen = screenInfo.numScreens - 1; to_screen = screenInfo.numScreens - 1;
pXinDraw = (PanoramiXRes *) pXinDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
} }
#endif #endif
@ -2014,7 +2014,7 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
from_screen = 0; from_screen = 0;
to_screen = screenInfo.numScreens - 1; to_screen = screenInfo.numScreens - 1;
pXinDraw = (PanoramiXRes *) pXinDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
} }
#endif #endif
@ -2060,7 +2060,7 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
else if (pXinDraw) { else if (pXinDraw) {
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id, pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id,
client, client,
SecurityReadAccess); DixReadAccess);
} }
#endif #endif
else if (pGlxWindow) { else if (pGlxWindow) {
@ -3069,7 +3069,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
int nReplyBytes; int nReplyBytes;
req = (xGLXQueryContextInfoEXTReq *)pc; req = (xGLXQueryContextInfoEXTReq *)pc;
ctx = (__GLXcontext *) SecurityLookupIDByType(client, req->context, __glXContextRes, SecurityReadAccess); ctx = (__GLXcontext *) SecurityLookupIDByType(client, req->context, __glXContextRes, DixReadAccess);
if (!ctx) { if (!ctx) {
client->errorValue = req->context; client->errorValue = req->context;
return __glXBadContext; return __glXBadContext;
@ -3353,7 +3353,7 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX #ifdef PANORAMIX
if (!noPanoramiXExtension) { if (!noPanoramiXExtension) {
pXinDraw = (PanoramiXRes *) pXinDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
if (!pXinDraw) { if (!pXinDraw) {
client->errorValue = drawId; client->errorValue = drawId;
return __glXBadDrawable; return __glXBadDrawable;
@ -3361,7 +3361,7 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id, pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id,
client, client,
SecurityReadAccess); DixReadAccess);
} }
#endif #endif
@ -3515,7 +3515,7 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX #ifdef PANORAMIX
if (!noPanoramiXExtension) { if (!noPanoramiXExtension) {
pXinDraw = (PanoramiXRes *) pXinDraw = (PanoramiXRes *)
SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, SecurityReadAccess); SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
if (!pXinDraw) { if (!pXinDraw) {
client->errorValue = drawId; client->errorValue = drawId;
return __glXBadDrawable; return __glXBadDrawable;
@ -3523,7 +3523,7 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id, pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id,
client, client,
SecurityReadAccess); DixReadAccess);
} }
#endif #endif

View File

@ -401,7 +401,7 @@ ProcXF86DRICreateDrawable(
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
client, client,
SecurityReadAccess))) { DixReadAccess))) {
return BadValue; return BadValue;
} }
@ -432,7 +432,7 @@ ProcXF86DRIDestroyDrawable(
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
client, client,
SecurityReadAccess))) { DixReadAccess))) {
return BadValue; return BadValue;
} }
@ -471,7 +471,7 @@ ProcXF86DRIGetDrawableInfo(
if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
(Drawable)stuff->drawable, (Drawable)stuff->drawable,
client, client,
SecurityReadAccess))) { DixReadAccess))) {
return BadValue; return BadValue;
} }

View File

@ -345,7 +345,7 @@ winProcSetSelectionOwner (ClientPtr client)
{ {
/* Grab the Window from the request */ /* Grab the Window from the request */
pWindow = (WindowPtr) SecurityLookupWindow (stuff->window, client, pWindow = (WindowPtr) SecurityLookupWindow (stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWindow) if (!pWindow)
{ {
ErrorF ("winProcSetSelectionOwner - Found BadWindow, aborting.\n"); ErrorF ("winProcSetSelectionOwner - Found BadWindow, aborting.\n");

View File

@ -203,7 +203,7 @@ ProcWindowsWMSelectInput (register ClientPtr client)
REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq); REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq);
pHead = (WMEventPtr *)SecurityLookupIDByType(client, eventResource, pHead = (WMEventPtr *)SecurityLookupIDByType(client, eventResource,
EventType, SecurityWriteAccess); EventType, DixWriteAccess);
if (stuff->mask != 0) if (stuff->mask != 0)
{ {
if (pHead) if (pHead)
@ -451,7 +451,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
ErrorF ("ProcWindowsWMFrameDraw\n"); ErrorF ("ProcWindowsWMFrameDraw\n");
#endif #endif
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
client, SecurityReadAccess))) client, DixReadAccess)))
{ {
return BadValue; return BadValue;
} }
@ -546,7 +546,7 @@ ProcWindowsWMFrameSetTitle(
REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq); REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
client, SecurityReadAccess))) client, DixReadAccess)))
{ {
return BadValue; return BadValue;
} }

View File

@ -122,13 +122,13 @@ SOFTWARE.
} }
#define VERIFY_DRAWABLE(pDraw, did, client)\ #define VERIFY_DRAWABLE(pDraw, did, client)\
SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess) SECURITY_VERIFY_DRAWABLE(pDraw, did, client, DixUnknownAccess)
#define VERIFY_GEOMETRABLE(pDraw, did, client)\ #define VERIFY_GEOMETRABLE(pDraw, did, client)\
SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess) SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, DixUnknownAccess)
#define VERIFY_GC(pGC, rid, client)\ #define VERIFY_GC(pGC, rid, client)\
SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess) SECURITY_VERIFY_GC(pGC, rid, client, DixUnknownAccess)
#else /* not XACE */ #else /* not XACE */
@ -239,8 +239,8 @@ SOFTWARE.
if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\ if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
(client->lastDrawableID != drawID))\ (client->lastDrawableID != drawID))\
{\ {\
SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\ SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\
SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\ SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\
if ((pGC->depth != pDraw->depth) ||\ if ((pGC->depth != pDraw->depth) ||\
(pGC->pScreen != pDraw->pScreen))\ (pGC->pScreen != pDraw->pScreen))\
return (BadMatch);\ return (BadMatch);\

View File

@ -220,10 +220,11 @@ extern pointer LookupClientResourceComplex(
* simultaneously. * simultaneously.
*/ */
#define SecurityUnknownAccess 0 /* don't know intentions */ #define DixUnknownAccess 0 /* don't know intentions */
#define SecurityReadAccess (1<<0) /* inspecting the object */ #define DixReadAccess (1<<0) /* inspecting the object */
#define SecurityWriteAccess (1<<1) /* changing the object */ #define DixWriteAccess (1<<1) /* changing the object */
#define SecurityDestroyAccess (1<<2) /* destroying the object */ #define DixReadWriteAccess (DixReadAccess|DixWriteAccess)
#define DixDestroyAccess (1<<2) /* destroying the object */
extern pointer SecurityLookupIDByType( extern pointer SecurityLookupIDByType(
ClientPtr /*client*/, ClientPtr /*client*/,

View File

@ -1528,7 +1528,7 @@ AuthorizedClient(ClientPtr client)
return TRUE; return TRUE;
/* untrusted clients can't change host access */ /* untrusted clients can't change host access */
if (!XaceHook(XACE_HOSTLIST_ACCESS, client, SecurityWriteAccess)) if (!XaceHook(XACE_HOSTLIST_ACCESS, client, DixWriteAccess))
return FALSE; return FALSE;
return LocalClient(client); return LocalClient(client);

View File

@ -457,7 +457,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
int i, j, k, n; int i, j, k, n;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
crtc = LookupCrtc(client, stuff->crtc, SecurityReadAccess); crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
@ -766,7 +766,7 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
int n; int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
crtc = LookupCrtc (client, stuff->crtc, SecurityReadAccess); crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
@ -793,7 +793,7 @@ ProcRRGetCrtcGamma (ClientPtr client)
unsigned long len; unsigned long len;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
crtc = LookupCrtc (client, stuff->crtc, SecurityReadAccess); crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
@ -826,7 +826,7 @@ ProcRRSetCrtcGamma (ClientPtr client)
CARD16 *red, *green, *blue; CARD16 *red, *green, *blue;
REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
crtc = LookupCrtc (client, stuff->crtc, SecurityWriteAccess); crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;

View File

@ -72,12 +72,12 @@ ProcRRSelectInput (ClientPtr client)
XID clientResource; XID clientResource;
REQUEST_SIZE_MATCH(xRRSelectInputReq); REQUEST_SIZE_MATCH(xRRSelectInputReq);
pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); pWin = SecurityLookupWindow (stuff->window, client, DixWriteAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
pHead = (RREventPtr *)SecurityLookupIDByType(client, pHead = (RREventPtr *)SecurityLookupIDByType(client,
pWin->drawable.id, RREventType, pWin->drawable.id, RREventType,
SecurityWriteAccess); DixWriteAccess);
if (stuff->enable & (RRScreenChangeNotifyMask| if (stuff->enable & (RRScreenChangeNotifyMask|
RRCrtcChangeNotifyMask| RRCrtcChangeNotifyMask|

View File

@ -378,7 +378,7 @@ ProcRRGetOutputInfo (ClientPtr client)
int i, n; int i, n;
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
output = LookupOutput(client, stuff->output, SecurityReadAccess); output = LookupOutput(client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;

View File

@ -313,7 +313,7 @@ ProcRRListOutputProperties (ClientPtr client)
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
output = LookupOutput (client, stuff->output, SecurityReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
@ -358,7 +358,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
output = LookupOutput (client, stuff->output, SecurityReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
@ -398,7 +398,7 @@ ProcRRConfigureOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq); REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq);
output = LookupOutput (client, stuff->output, SecurityReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
@ -443,7 +443,7 @@ ProcRRChangeOutputProperty (ClientPtr client)
totalSize = len * sizeInBytes; totalSize = len * sizeInBytes;
REQUEST_FIXED_SIZE(xRRChangeOutputPropertyReq, totalSize); REQUEST_FIXED_SIZE(xRRChangeOutputPropertyReq, totalSize);
output = LookupOutput (client, stuff->output, SecurityWriteAccess); output = LookupOutput (client, stuff->output, DixWriteAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
@ -475,7 +475,7 @@ ProcRRDeleteOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
UpdateCurrentTime(); UpdateCurrentTime();
output = LookupOutput (client, stuff->output, SecurityWriteAccess); output = LookupOutput (client, stuff->output, DixWriteAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
@ -504,8 +504,8 @@ ProcRRGetOutputProperty (ClientPtr client)
if (stuff->delete) if (stuff->delete)
UpdateCurrentTime(); UpdateCurrentTime();
output = LookupOutput (client, stuff->output, output = LookupOutput (client, stuff->output,
stuff->delete ? SecurityWriteAccess : stuff->delete ? DixWriteAccess :
SecurityReadAccess); DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;

View File

@ -220,7 +220,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -273,7 +273,7 @@ ProcRRSetScreenSize (ClientPtr client)
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -332,7 +332,7 @@ ProcRRGetScreenResources (ClientPtr client)
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -557,7 +557,7 @@ ProcRRGetScreenInfo (ClientPtr client)
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
@ -731,7 +731,7 @@ ProcRRSetScreenConfig (ClientPtr client)
} }
SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client,
SecurityWriteAccess); DixWriteAccess);
pScreen = pDraw->pScreen; pScreen = pDraw->pScreen;

View File

@ -1209,7 +1209,7 @@ ChangePicture (PicturePtr pPicture,
pAlpha = (PicturePtr) SecurityLookupIDByType(client, pAlpha = (PicturePtr) SecurityLookupIDByType(client,
pid, pid,
PictureType, PictureType,
SecurityWriteAccess|SecurityReadAccess); DixWriteAccess|DixReadAccess);
if (!pAlpha) if (!pAlpha)
{ {
client->errorValue = pid; client->errorValue = pid;
@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture,
pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
pid, pid,
RT_PIXMAP, RT_PIXMAP,
SecurityReadAccess); DixReadAccess);
if (!pPixmap) if (!pPixmap)
{ {
client->errorValue = pid; client->errorValue = pid;

View File

@ -554,7 +554,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->format, stuff->format,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
@ -622,11 +622,11 @@ ProcRenderCreatePicture (ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client,
SecurityWriteAccess); DixWriteAccess);
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->format, stuff->format,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->format; client->errorValue = stuff->format;
@ -660,7 +660,7 @@ ProcRenderChangePicture (ClientPtr client)
int len; int len;
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
@ -680,7 +680,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
int result; int result;
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pPicture->pDrawable) if (!pPicture->pDrawable)
return BadDrawable; return BadDrawable;
@ -706,7 +706,7 @@ ProcRenderFreePicture (ClientPtr client)
REQUEST_SIZE_MATCH(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
FreeResource (stuff->picture, RT_NONE); FreeResource (stuff->picture, RT_NONE);
return(client->noClientException); return(client->noClientException);
@ -736,13 +736,13 @@ ProcRenderComposite (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
@ -782,9 +782,9 @@ ProcRenderTrapezoids (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -795,7 +795,7 @@ ProcRenderTrapezoids (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->maskFormat, stuff->maskFormat,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->maskFormat; client->errorValue = stuff->maskFormat;
@ -829,9 +829,9 @@ ProcRenderTriangles (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -842,7 +842,7 @@ ProcRenderTriangles (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->maskFormat, stuff->maskFormat,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->maskFormat; client->errorValue = stuff->maskFormat;
@ -876,9 +876,9 @@ ProcRenderTriStrip (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -889,7 +889,7 @@ ProcRenderTriStrip (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->maskFormat, stuff->maskFormat,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->maskFormat; client->errorValue = stuff->maskFormat;
@ -923,9 +923,9 @@ ProcRenderTriFan (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -936,7 +936,7 @@ ProcRenderTriFan (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->maskFormat, stuff->maskFormat,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->maskFormat; client->errorValue = stuff->maskFormat;
@ -988,7 +988,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
format = (PictFormatPtr) SecurityLookupIDByType (client, format = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->format, stuff->format,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!format) if (!format)
{ {
client->errorValue = stuff->format; client->errorValue = stuff->format;
@ -1036,7 +1036,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
stuff->existing, stuff->existing,
GlyphSetType, GlyphSetType,
SecurityWriteAccess); DixWriteAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = stuff->existing; client->errorValue = stuff->existing;
@ -1061,7 +1061,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
stuff->glyphset, stuff->glyphset,
GlyphSetType, GlyphSetType,
SecurityDestroyAccess); DixDestroyAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
@ -1095,7 +1095,7 @@ ProcRenderAddGlyphs (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
stuff->glyphset, stuff->glyphset,
GlyphSetType, GlyphSetType,
SecurityWriteAccess); DixWriteAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
@ -1196,7 +1196,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
stuff->glyphset, stuff->glyphset,
GlyphSetType, GlyphSetType,
SecurityWriteAccess); DixWriteAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
@ -1251,9 +1251,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -1264,7 +1264,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
pFormat = (PictFormatPtr) SecurityLookupIDByType (client, pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->maskFormat, stuff->maskFormat,
PictFormatType, PictFormatType,
SecurityReadAccess); DixReadAccess);
if (!pFormat) if (!pFormat)
{ {
client->errorValue = stuff->maskFormat; client->errorValue = stuff->maskFormat;
@ -1277,7 +1277,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
stuff->glyphset, stuff->glyphset,
GlyphSetType, GlyphSetType,
SecurityReadAccess); DixReadAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
@ -1339,7 +1339,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
gs, gs,
GlyphSetType, GlyphSetType,
SecurityReadAccess); DixReadAccess);
if (!glyphSet) if (!glyphSet)
{ {
client->errorValue = gs; client->errorValue = gs;
@ -1420,7 +1420,7 @@ ProcRenderFillRectangles (ClientPtr client)
client->errorValue = stuff->op; client->errorValue = stuff->op;
return BadValue; return BadValue;
} }
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pDst->pDrawable) if (!pDst->pDrawable)
return BadDrawable; return BadDrawable;
@ -1486,7 +1486,7 @@ ProcRenderCreateCursor (ClientPtr client)
REQUEST_SIZE_MATCH (xRenderCreateCursorReq); REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
LEGAL_NEW_RESOURCE(stuff->cid, client); LEGAL_NEW_RESOURCE(stuff->cid, client);
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pSrc->pDrawable) if (!pSrc->pDrawable)
return BadDrawable; return BadDrawable;
@ -1668,7 +1668,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
int result; int result;
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
if (client->noClientException != Success) if (client->noClientException != Success)
@ -1694,7 +1694,7 @@ ProcRenderQueryFilters (ClientPtr client)
char *names; char *names;
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, DixReadAccess);
pScreen = pDrawable->pScreen; pScreen = pDrawable->pScreen;
nbytesName = 0; nbytesName = 0;
@ -1797,7 +1797,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
char *name; char *name;
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
name = (char *) (stuff + 1); name = (char *) (stuff + 1);
params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
@ -1831,7 +1831,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
for (i = 0; i < ncursor; i++) for (i = 0; i < ncursor; i++)
{ {
cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor,
RT_CURSOR, SecurityReadAccess); RT_CURSOR, DixReadAccess);
if (!cursors[i]) if (!cursors[i])
{ {
xfree (cursors); xfree (cursors);
@ -1859,7 +1859,7 @@ ProcRenderAddTraps (ClientPtr client)
REQUEST(xRenderAddTrapsReq); REQUEST(xRenderAddTrapsReq);
REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (!pPicture->pDrawable) if (!pPicture->pDrawable)
return BadDrawable; return BadDrawable;
@ -2614,7 +2614,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
return BadDrawable; return BadDrawable;
if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
return BadAlloc; return BadAlloc;
@ -2656,7 +2656,7 @@ PanoramiXRenderChangePicture (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2677,7 +2677,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2698,7 +2698,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq);
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2719,7 +2719,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
@ -2742,7 +2742,7 @@ PanoramiXRenderFreePicture (ClientPtr client)
client->errorValue = stuff->picture; client->errorValue = stuff->picture;
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
@ -2768,11 +2768,11 @@ PanoramiXRenderComposite (ClientPtr client)
REQUEST_SIZE_MATCH(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
orig = *stuff; orig = *stuff;
@ -2816,9 +2816,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
INT16 xSrc, ySrc; INT16 xSrc, ySrc;
REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) +
@ -2859,7 +2859,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
int extra_len; int extra_len;
REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
if (extra_len && if (extra_len &&
@ -2906,9 +2906,9 @@ PanoramiXRenderTrapezoids(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
@ -2968,9 +2968,9 @@ PanoramiXRenderTriangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
@ -3026,9 +3026,9 @@ PanoramiXRenderTriStrip(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); REQUEST_AT_LEAST_SIZE (xRenderTriStripReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
@ -3080,9 +3080,9 @@ PanoramiXRenderTriFan(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); REQUEST_AT_LEAST_SIZE (xRenderTriFanReq);
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
@ -3136,7 +3136,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
@ -3180,7 +3180,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq);
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
@ -3226,7 +3226,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
INT16 x_off, y_off; INT16 x_off, y_off;
REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
if (extra_len && if (extra_len &&

View File

@ -242,7 +242,7 @@ ProcXFixesSelectCursorInput (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (stuff->eventMask & ~CursorAllEvents) if (stuff->eventMask & ~CursorAllEvents)
@ -415,7 +415,7 @@ ProcXFixesSetCursorName (ClientPtr client)
Atom atom; Atom atom;
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityWriteAccess); VERIFY_CURSOR(pCursor, stuff->cursor, client, DixWriteAccess);
tchar = (char *) &stuff[1]; tchar = (char *) &stuff[1];
atom = MakeAtom (tchar, stuff->nbytes, TRUE); atom = MakeAtom (tchar, stuff->nbytes, TRUE);
if (atom == BAD_RESOURCE) if (atom == BAD_RESOURCE)
@ -448,7 +448,7 @@ ProcXFixesGetCursorName (ClientPtr client)
int len; int len;
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityReadAccess); VERIFY_CURSOR(pCursor, stuff->cursor, client, DixReadAccess);
if (pCursor->name) if (pCursor->name)
str = NameForAtom (pCursor->name); str = NameForAtom (pCursor->name);
else else
@ -679,8 +679,8 @@ ProcXFixesChangeCursor (ClientPtr client)
REQUEST(xXFixesChangeCursorReq); REQUEST(xXFixesChangeCursorReq);
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); VERIFY_CURSOR (pSource, stuff->source, client, DixReadAccess);
VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_CURSOR (pDestination, stuff->destination, client, DixWriteAccess);
ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); ReplaceCursor (pSource, TestForCursor, (pointer) pDestination);
return (client->noClientException); return (client->noClientException);
@ -714,7 +714,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
REQUEST(xXFixesChangeCursorByNameReq); REQUEST(xXFixesChangeCursorByNameReq);
REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes);
VERIFY_CURSOR(pSource, stuff->source, client, SecurityReadAccess); VERIFY_CURSOR(pSource, stuff->source, client, DixReadAccess);
tchar = (char *) &stuff[1]; tchar = (char *) &stuff[1];
name = MakeAtom (tchar, stuff->nbytes, FALSE); name = MakeAtom (tchar, stuff->nbytes, FALSE);
if (name) if (name)

View File

@ -118,7 +118,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap, pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap,
RT_PIXMAP, RT_PIXMAP,
SecurityReadAccess); DixReadAccess);
if (!pPixmap) if (!pPixmap)
{ {
client->errorValue = stuff->bitmap; client->errorValue = stuff->bitmap;
@ -225,7 +225,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq);
LEGAL_NEW_RESOURCE (stuff->region, client); LEGAL_NEW_RESOURCE (stuff->region, client);
SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess); SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);
switch (pGC->clientClipType) { switch (pGC->clientClipType) {
case CT_PIXMAP: case CT_PIXMAP:
@ -273,7 +273,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq);
LEGAL_NEW_RESOURCE (stuff->region, client); LEGAL_NEW_RESOURCE (stuff->region, client);
VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityReadAccess, VERIFY_PICTURE(pPicture, stuff->picture, client, DixReadAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
switch (pPicture->clientClipType) { switch (pPicture->clientClipType) {
@ -321,7 +321,7 @@ ProcXFixesDestroyRegion (ClientPtr client)
RegionPtr pRegion; RegionPtr pRegion;
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
FreeResource (stuff->region, RT_NONE); FreeResource (stuff->region, RT_NONE);
return(client->noClientException); return(client->noClientException);
} }
@ -346,7 +346,7 @@ ProcXFixesSetRegion (ClientPtr client)
REQUEST (xXFixesSetRegionReq); REQUEST (xXFixesSetRegionReq);
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
things = (client->req_len << 2) - sizeof (xXFixesCreateRegionReq); things = (client->req_len << 2) - sizeof (xXFixesCreateRegionReq);
if (things & 4) if (things & 4)
@ -384,8 +384,8 @@ ProcXFixesCopyRegion (ClientPtr client)
RegionPtr pSource, pDestination; RegionPtr pSource, pDestination;
REQUEST (xXFixesCopyRegionReq); REQUEST (xXFixesCopyRegionReq);
VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
if (!REGION_COPY(pScreen, pDestination, pSource)) if (!REGION_COPY(pScreen, pDestination, pSource))
return BadAlloc; return BadAlloc;
@ -414,9 +414,9 @@ ProcXFixesCombineRegion (ClientPtr client)
REQUEST (xXFixesCombineRegionReq); REQUEST (xXFixesCombineRegionReq);
REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq);
VERIFY_REGION(pSource1, stuff->source1, client, SecurityReadAccess); VERIFY_REGION(pSource1, stuff->source1, client, DixReadAccess);
VERIFY_REGION(pSource2, stuff->source2, client, SecurityReadAccess); VERIFY_REGION(pSource2, stuff->source2, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
switch (stuff->xfixesReqType) { switch (stuff->xfixesReqType) {
case X_XFixesUnionRegion: case X_XFixesUnionRegion:
@ -461,8 +461,8 @@ ProcXFixesInvertRegion (ClientPtr client)
REQUEST(xXFixesInvertRegionReq); REQUEST(xXFixesInvertRegionReq);
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
/* Compute bounds, limit to 16 bits */ /* Compute bounds, limit to 16 bits */
bounds.x1 = stuff->x; bounds.x1 = stuff->x;
@ -509,7 +509,7 @@ ProcXFixesTranslateRegion (ClientPtr client)
REQUEST(xXFixesTranslateRegionReq); REQUEST(xXFixesTranslateRegionReq);
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy);
return (client->noClientException); return (client->noClientException);
@ -536,8 +536,8 @@ ProcXFixesRegionExtents (ClientPtr client)
REQUEST(xXFixesRegionExtentsReq); REQUEST(xXFixesRegionExtentsReq);
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource));
@ -569,7 +569,7 @@ ProcXFixesFetchRegion (ClientPtr client)
REQUEST(xXFixesFetchRegionReq); REQUEST(xXFixesFetchRegionReq);
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, SecurityReadAccess); VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess);
pExtent = REGION_EXTENTS (0, pRegion); pExtent = REGION_EXTENTS (0, pRegion);
pBox = REGION_RECTS (pRegion); pBox = REGION_RECTS (pRegion);
@ -633,8 +633,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
REQUEST(xXFixesSetGCClipRegionReq); REQUEST(xXFixesSetGCClipRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess);
VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, SecurityReadAccess); VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, DixReadAccess);
if (pRegion) if (pRegion)
{ {
@ -685,7 +685,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
client->errorValue = stuff->dest; client->errorValue = stuff->dest;
return BadWindow; return BadWindow;
} }
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityWriteAccess); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
switch (stuff->destKind) { switch (stuff->destKind) {
case ShapeBounding: case ShapeBounding:
@ -775,11 +775,11 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
REQUEST(xXFixesSetPictureClipRegionReq); REQUEST(xXFixesSetPictureClipRegionReq);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess,
RenderErrBase + BadPicture); RenderErrBase + BadPicture);
pScreen = pPicture->pDrawable->pScreen; pScreen = pPicture->pDrawable->pScreen;
ps = GetPictureScreen (pScreen); ps = GetPictureScreen (pScreen);
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityReadAccess); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin,
pRegion); pRegion);
@ -815,8 +815,8 @@ ProcXFixesExpandRegion (ClientPtr client)
int i; int i;
REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); REQUEST_SIZE_MATCH (xXFixesExpandRegionReq);
VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
nBoxes = REGION_NUM_RECTS(pSource); nBoxes = REGION_NUM_RECTS(pSource);
pSrc = REGION_RECTS(pSource); pSrc = REGION_RECTS(pSource);

View File

@ -38,7 +38,7 @@ ProcXFixesChangeSaveSet(ClientPtr client)
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq); REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))

View File

@ -196,7 +196,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
SecurityReadAccess); DixReadAccess);
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
if (stuff->eventMask & ~SelectionAllEvents) if (stuff->eventMask & ~SelectionAllEvents)