Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver

This commit is contained in:
Peter Hutterer 2006-12-19 10:31:40 +10:30 committed by Peter Hutterer
commit 2d0a63126b
104 changed files with 2538 additions and 1656 deletions

View File

@ -441,6 +441,7 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
__GLcontextModes *modes; __GLcontextModes *modes;
__GLXdrawable *pGlxDraw; __GLXdrawable *pGlxDraw;
__GLXpixmap *drawPixmap = NULL; __GLXpixmap *drawPixmap = NULL;
int rc;
/* This is the GLX 1.3 case - the client passes in a GLXWindow and /* This is the GLX 1.3 case - the client passes in a GLXWindow and
* we just return the __GLXdrawable. The first time a GLXPixmap * we just return the __GLXdrawable. The first time a GLXPixmap
@ -466,8 +467,8 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
* GLXWindow with the same XID as an X Window, so we wont get any * GLXWindow with the same XID as an X Window, so we wont get any
* resource ID clashes. Effectively, the X Window is now also a * resource ID clashes. Effectively, the X Window is now also a
* GLXWindow. */ * GLXWindow. */
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
VisualID vid = wVisual((WindowPtr)pDraw); VisualID vid = wVisual((WindowPtr)pDraw);
@ -1199,12 +1200,12 @@ static int ValidateCreateDrawable(ClientPtr client,
ScreenPtr pScreen; ScreenPtr pScreen;
VisualPtr pVisual; VisualPtr pVisual;
__GLXscreen *pGlxScreen; __GLXscreen *pGlxScreen;
int i; int i, rc;
LEGAL_NEW_RESOURCE(glxDrawableId, client); LEGAL_NEW_RESOURCE(glxDrawableId, client);
pDraw = (DrawablePtr) LookupDrawable(drawablId, client); rc = dixLookupDrawable(&pDraw, drawablId, client, 0, DixUnknownAccess);
if (!pDraw || pDraw->type != type) { if (rc != Success || pDraw->type != type) {
client->errorValue = drawablId; client->errorValue = drawablId;
return type == DRAWABLE_WINDOW ? BadWindow : BadPixmap; return type == DRAWABLE_WINDOW ? BadWindow : BadPixmap;
} }
@ -2034,10 +2035,11 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc; xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
XID drawable = req->drawable; XID drawable = req->drawable;
int barrier = req->barrier; int barrier = req->barrier;
DrawablePtr pDraw = (DrawablePtr) LookupDrawable(drawable, client); DrawablePtr pDraw;
int screen; int screen, rc;
if (pDraw && (pDraw->type == DRAWABLE_WINDOW)) { rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixUnknownAccess);
if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
screen = pDraw->pScreen->myNum; screen = pDraw->pScreen->myNum;
if (__glXSwapBarrierFuncs && if (__glXSwapBarrierFuncs &&
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc) { __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc) {

View File

@ -1093,8 +1093,8 @@ int XETrapRequestVector(ClientPtr client)
pdata->hdr.client = client->index; /* stuff client index in hdr */ pdata->hdr.client = client->index; /* stuff client index in hdr */
if (BitIsTrue(penv->cur.data_config_flags_data,XETrapWinXY)) if (BitIsTrue(penv->cur.data_config_flags_data,XETrapWinXY))
{ {
window_ptr = (WindowPtr) LookupDrawable(stuff->id, client); if (Success != dixLookupDrawable(&window_ptr, stuff->id,
if (window_ptr == 0L) client, 0, DixUnknownAccess))
{ /* Failed...invalidate the X and Y coordinate data. */ { /* Failed...invalidate the X and Y coordinate data. */
pdata->hdr.win_x = -1L; pdata->hdr.win_x = -1L;
pdata->hdr.win_y = -1L; pdata->hdr.win_y = -1L;

View File

@ -355,13 +355,15 @@ int AttrValidate(
AppGroupPtr pAppGrp) AppGroupPtr pAppGrp)
{ {
WindowPtr pWin; WindowPtr pWin;
int idepth, ivids, found; int idepth, ivids, found, rc;
ScreenPtr pScreen; ScreenPtr pScreen;
DepthPtr pDepth; DepthPtr pDepth;
ColormapPtr pColormap; ColormapPtr pColormap;
pWin = LookupWindow (pAppGrp->default_root, client); rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
/* XXX check that pWin is not NULL */ DixUnknownAccess);
if (rc != Success)
return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
if (WindowTable[pScreen->myNum]->drawable.id != pAppGrp->default_root) if (WindowTable[pScreen->myNum]->drawable.id != pAppGrp->default_root)
return BadWindow; return BadWindow;
@ -432,7 +434,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 +453,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;
@ -483,10 +485,13 @@ int ProcXagQuery(
ClientPtr pClient; ClientPtr pClient;
AppGroupPtr pAppGrp; AppGroupPtr pAppGrp;
REQUEST (xXagQueryReq); REQUEST (xXagQueryReq);
int n; int n, rc;
REQUEST_SIZE_MATCH (xXagQueryReq); REQUEST_SIZE_MATCH (xXagQueryReq);
pClient = LookupClient (stuff->resource, client); rc = dixLookupClient(&pClient, stuff->resource, client, DixUnknownAccess);
if (rc != Success)
return rc;
for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next) for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next)
for (n = 0; n < pAppGrp->nclients; n++) for (n = 0; n < pAppGrp->nclients; n++)
if (pAppGrp->clients[n] == pClient) { if (pAppGrp->clients[n] == pClient) {

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

@ -448,16 +448,15 @@ ProcCreateImageBuffers (client)
register int n; register int n;
WindowPtr pWin; WindowPtr pWin;
XID *ids; XID *ids;
int len, nbuf; int len, nbuf, i, err, rc;
int i;
int err;
REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq); REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq);
len = stuff->length - (sizeof(xMbufCreateImageBuffersReq) >> 2); len = stuff->length - (sizeof(xMbufCreateImageBuffersReq) >> 2);
if (len == 0) if (len == 0)
return BadLength; return BadLength;
if (!(pWin = LookupWindow (stuff->window, client))) rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
return BadWindow; if (rc != Success)
return rc;
if (pWin->drawable.class == InputOnly) if (pWin->drawable.class == InputOnly)
return BadMatch; return BadMatch;
switch (stuff->updateAction) switch (stuff->updateAction)
@ -584,10 +583,12 @@ ProcDestroyImageBuffers (client)
{ {
REQUEST (xMbufDestroyImageBuffersReq); REQUEST (xMbufDestroyImageBuffersReq);
WindowPtr pWin; WindowPtr pWin;
int rc;
REQUEST_SIZE_MATCH (xMbufDestroyImageBuffersReq); REQUEST_SIZE_MATCH (xMbufDestroyImageBuffersReq);
if (!(pWin = LookupWindow (stuff->window, client))) rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
return BadWindow; if (rc != Success)
return rc;
DestroyImageBuffers (pWin); DestroyImageBuffers (pWin);
return Success; return Success;
} }
@ -599,16 +600,16 @@ ProcSetMBufferAttributes (client)
REQUEST (xMbufSetMBufferAttributesReq); REQUEST (xMbufSetMBufferAttributesReq);
WindowPtr pWin; WindowPtr pWin;
MultibuffersPtr pMultibuffers; MultibuffersPtr pMultibuffers;
int len; int len, rc;
Mask vmask; Mask vmask;
Mask index2; Mask index2;
CARD32 updateHint; CARD32 updateHint;
XID *vlist; XID *vlist;
REQUEST_AT_LEAST_SIZE (xMbufSetMBufferAttributesReq); REQUEST_AT_LEAST_SIZE (xMbufSetMBufferAttributesReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
if (!pMultibuffers) if (!pMultibuffers)
return BadMatch; return BadMatch;
@ -655,12 +656,12 @@ ProcGetMBufferAttributes (client)
MultibuffersPtr pMultibuffers; MultibuffersPtr pMultibuffers;
XID *ids; XID *ids;
xMbufGetMBufferAttributesReply rep; xMbufGetMBufferAttributesReply rep;
int i, n; int i, n, rc;
REQUEST_SIZE_MATCH (xMbufGetMBufferAttributesReq); REQUEST_SIZE_MATCH (xMbufGetMBufferAttributesReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
if (!pMultibuffers) if (!pMultibuffers)
return BadAccess; return BadAccess;
@ -785,15 +786,15 @@ ProcGetBufferInfo (client)
DrawablePtr pDrawable; DrawablePtr pDrawable;
xMbufGetBufferInfoReply rep; xMbufGetBufferInfoReply rep;
ScreenPtr pScreen; ScreenPtr pScreen;
int i, j, k; int i, j, k, n, rc;
int n;
xMbufBufferInfo *pInfo; xMbufBufferInfo *pInfo;
int nInfo; int nInfo;
DepthPtr pDepth; DepthPtr pDepth;
pDrawable = (DrawablePtr) LookupDrawable (stuff->drawable, client); rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
if (!pDrawable) DixUnknownAccess);
return BadDrawable; if (rc != Success)
return rc;
pScreen = pDrawable->pScreen; pScreen = pDrawable->pScreen;
nInfo = 0; nInfo = 0;
for (i = 0; i < pScreen->numDepths; i++) for (i = 0; i < pScreen->numDepths; i++)

View File

@ -958,12 +958,13 @@ ProcPanoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetStateReply rep; xPanoramiXGetStateReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -984,12 +985,13 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenCountReply rep; xPanoramiXGetScreenCountReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -1009,12 +1011,13 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep; xPanoramiXGetScreenSizeReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;

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) {
@ -531,10 +531,14 @@ int PanoramiXGetGeometry(ClientPtr client)
{ {
xGetGeometryReply rep; xGetGeometryReply rep;
DrawablePtr pDraw; DrawablePtr pDraw;
int rc;
REQUEST(xResourceReq); REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
VERIFY_GEOMETRABLE (pDraw, stuff->id, client); rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixUnknownAccess);
if (rc != Success)
return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -573,19 +577,17 @@ int PanoramiXTranslateCoords(ClientPtr client)
{ {
INT16 x, y; INT16 x, y;
REQUEST(xTranslateCoordsReq); REQUEST(xTranslateCoordsReq);
int rc;
register WindowPtr pWin, pDst; WindowPtr pWin, pDst;
xTranslateCoordsReply rep; xTranslateCoordsReply rep;
REQUEST_SIZE_MATCH(xTranslateCoordsReq); REQUEST_SIZE_MATCH(xTranslateCoordsReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
if (!pWin) return rc;
return(BadWindow); rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, if (rc != Success)
SecurityReadAccess); return rc;
if (!pDst)
return(BadWindow);
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -655,7 +657,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 +696,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 +732,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 +747,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 +755,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 +807,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 +822,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 +830,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 +861,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 +888,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 +910,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 +932,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 +958,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 +1000,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 +1015,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)
@ -1028,10 +1030,14 @@ int PanoramiXCopyArea(ClientPtr client)
DrawablePtr pDst; DrawablePtr pDst;
GCPtr pGC; GCPtr pGC;
char *data; char *data;
int pitch; int pitch, rc;
FOR_NSCREENS(j) FOR_NSCREENS(j) {
VERIFY_DRAWABLE(drawables[j], src->info[j].id, client); rc = dixLookupDrawable(drawables+j, src->info[j].id, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
}
pitch = PixmapBytePad(stuff->width, drawables[0]->depth); pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
if(!(data = xcalloc(1, stuff->height * pitch))) if(!(data = xcalloc(1, stuff->height * pitch)))
@ -1065,6 +1071,7 @@ int PanoramiXCopyArea(ClientPtr client)
DrawablePtr pDst = NULL, pSrc = NULL; DrawablePtr pDst = NULL, pSrc = NULL;
GCPtr pGC = NULL; GCPtr pGC = NULL;
RegionPtr pRgn[MAXSCREENS]; RegionPtr pRgn[MAXSCREENS];
int rc;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->dstDrawable = dst->info[j].id; stuff->dstDrawable = dst->info[j].id;
@ -1081,8 +1088,11 @@ int PanoramiXCopyArea(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
if (stuff->dstDrawable != stuff->srcDrawable) { if (stuff->dstDrawable != stuff->srcDrawable) {
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
SecurityReadAccess); DixReadAccess);
if (rc != Success)
return rc;
if ((pDst->pScreen != pSrc->pScreen) || if ((pDst->pScreen != pSrc->pScreen) ||
(pDst->depth != pSrc->depth)) { (pDst->depth != pSrc->depth)) {
client->errorValue = stuff->dstDrawable; client->errorValue = stuff->dstDrawable;
@ -1133,7 +1143,7 @@ int PanoramiXCopyArea(ClientPtr client)
int PanoramiXCopyPlane(ClientPtr client) int PanoramiXCopyPlane(ClientPtr client)
{ {
int j, srcx, srcy, dstx, dsty; int j, srcx, srcy, dstx, dsty, rc;
PanoramiXRes *gc, *src, *dst; PanoramiXRes *gc, *src, *dst;
Bool srcIsRoot = FALSE; Bool srcIsRoot = FALSE;
Bool dstIsRoot = FALSE; Bool dstIsRoot = FALSE;
@ -1146,13 +1156,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 +1171,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)
@ -1187,8 +1197,11 @@ int PanoramiXCopyPlane(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
if (stuff->dstDrawable != stuff->srcDrawable) { if (stuff->dstDrawable != stuff->srcDrawable) {
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
SecurityReadAccess); DixReadAccess);
if (rc != Success)
return rc;
if (pdstDraw->pScreen != psrcDraw->pScreen) { if (pdstDraw->pScreen != psrcDraw->pScreen) {
client->errorValue = stuff->dstDrawable; client->errorValue = stuff->dstDrawable;
return (BadMatch); return (BadMatch);
@ -1246,14 +1259,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 +1317,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 +1375,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 +1437,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 +1497,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 +1555,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 +1614,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 +1673,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 +1731,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;
@ -1754,7 +1767,7 @@ int PanoramiXGetImage(ClientPtr client)
xGetImageReply xgi; xGetImageReply xgi;
Bool isRoot; Bool isRoot;
char *pBuf; char *pBuf;
int i, x, y, w, h, format; int i, x, y, w, h, format, rc;
Mask plane = 0, planemask; Mask plane = 0, planemask;
int linesDone, nlines, linesPerBuf; int linesDone, nlines, linesPerBuf;
long widthBytesLine, length; long widthBytesLine, length;
@ -1769,13 +1782,16 @@ 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)
return (*SavedProcVector[X_GetImage])(client); return (*SavedProcVector[X_GetImage])(client);
VERIFY_DRAWABLE(pDraw, stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
if(!((WindowPtr)pDraw)->realized) if(!((WindowPtr)pDraw)->realized)
return(BadMatch); return(BadMatch);
@ -1809,8 +1825,12 @@ int PanoramiXGetImage(ClientPtr client)
} }
drawables[0] = pDraw; drawables[0] = pDraw;
for(i = 1; i < PanoramiXNumScreens; i++) for(i = 1; i < PanoramiXNumScreens; i++) {
VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
}
xgi.visual = wVisual (((WindowPtr) pDraw)); xgi.visual = wVisual (((WindowPtr) pDraw));
xgi.type = X_Reply; xgi.type = X_Reply;
@ -1909,14 +1929,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 +1968,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 +2007,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 +2046,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 +2084,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 +2127,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 +2156,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 +2194,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 +2217,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 +2240,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 +2263,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 +2286,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 +2309,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 +2333,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 +2355,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 +2378,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

@ -780,16 +780,17 @@ ProcScreenSaverQueryInfo (client)
{ {
REQUEST(xScreenSaverQueryInfoReq); REQUEST(xScreenSaverQueryInfoReq);
xScreenSaverQueryInfoReply rep; xScreenSaverQueryInfoReply rep;
register int n; register int n, rc;
ScreenSaverStuffPtr pSaver; ScreenSaverStuffPtr pSaver;
DrawablePtr pDraw; DrawablePtr pDraw;
CARD32 lastInput; CARD32 lastInput;
ScreenSaverScreenPrivatePtr pPriv; ScreenSaverScreenPrivatePtr pPriv;
REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq); REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
if (!pDraw) DixUnknownAccess);
return BadDrawable; if (rc != Success)
return rc;
pSaver = &savedScreenInfo[pDraw->pScreen->myNum]; pSaver = &savedScreenInfo[pDraw->pScreen->myNum];
pPriv = GetScreenPrivate (pDraw->pScreen); pPriv = GetScreenPrivate (pDraw->pScreen);
@ -852,11 +853,13 @@ ProcScreenSaverSelectInput (client)
{ {
REQUEST(xScreenSaverSelectInputReq); REQUEST(xScreenSaverSelectInputReq);
DrawablePtr pDraw; DrawablePtr pDraw;
int rc;
REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq); REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client); rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
if (!pDraw) DixUnknownAccess);
return BadDrawable; if (rc != Success)
return rc;
if (!setEventMask (pDraw->pScreen, client, stuff->eventMask)) if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
return BadAlloc; return BadAlloc;
return Success; return Success;
@ -871,9 +874,7 @@ ScreenSaverSetAttributes (ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
ScreenSaverScreenPrivatePtr pPriv = 0; ScreenSaverScreenPrivatePtr pPriv = 0;
ScreenSaverAttrPtr pAttr = 0; ScreenSaverAttrPtr pAttr = 0;
int ret; int ret, len, class, bw, depth;
int len;
int class, bw, depth;
unsigned long visual; unsigned long visual;
int idepth, ivisual; int idepth, ivisual;
Bool fOK; Bool fOK;
@ -891,9 +892,10 @@ ScreenSaverSetAttributes (ClientPtr client)
ColormapPtr pCmap; ColormapPtr pCmap;
REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client); ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
if (!pDraw) DixUnknownAccess);
return BadDrawable; if (ret != Success)
return ret;
pScreen = pDraw->pScreen; pScreen = pDraw->pScreen;
pParent = WindowTable[pScreen->myNum]; pParent = WindowTable[pScreen->myNum];
@ -1246,11 +1248,13 @@ ScreenSaverUnsetAttributes (ClientPtr client)
REQUEST(xScreenSaverSetAttributesReq); REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw; DrawablePtr pDraw;
ScreenSaverScreenPrivatePtr pPriv; ScreenSaverScreenPrivatePtr pPriv;
int rc;
REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq); REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
if (!pDraw) DixUnknownAccess);
return BadDrawable; if (rc != Success)
return rc;
pPriv = GetScreenPrivate (pDraw->pScreen); pPriv = GetScreenPrivate (pDraw->pScreen);
if (pPriv && pPriv->attr && pPriv->attr->client == client) if (pPriv && pPriv->attr && pPriv->attr->client == client)
{ {
@ -1279,7 +1283,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 +1295,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 +1305,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 +1315,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 +1355,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

@ -316,16 +316,16 @@ ProcShapeRectangles (client)
ScreenPtr pScreen; ScreenPtr pScreen;
REQUEST(xShapeRectanglesReq); REQUEST(xShapeRectanglesReq);
xRectangle *prects; xRectangle *prects;
int nrects, ctype; int nrects, ctype, rc;
RegionPtr srcRgn; RegionPtr srcRgn;
RegionPtr *destRgn; RegionPtr *destRgn;
CreateDftPtr createDefault; CreateDftPtr createDefault;
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = LookupWindow (stuff->dest, client); rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
switch (stuff->destKind) { switch (stuff->destKind) {
case ShapeBounding: case ShapeBounding:
createDefault = CreateBoundingShape; createDefault = CreateBoundingShape;
@ -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) {
@ -419,12 +419,13 @@ ProcShapeMask (client)
RegionPtr *destRgn; RegionPtr *destRgn;
PixmapPtr pPixmap; PixmapPtr pPixmap;
CreateDftPtr createDefault; CreateDftPtr createDefault;
int rc;
REQUEST_SIZE_MATCH (xShapeMaskReq); REQUEST_SIZE_MATCH (xShapeMaskReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess); rc = dixLookupWindow(&pWin, stuff->dest, client, DixWriteAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
switch (stuff->destKind) { switch (stuff->destKind) {
case ShapeBounding: case ShapeBounding:
createDefault = CreateBoundingShape; createDefault = CreateBoundingShape;
@ -444,7 +445,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 +489,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;
@ -526,12 +527,13 @@ ProcShapeCombine (client)
CreateDftPtr createDefault; CreateDftPtr createDefault;
CreateDftPtr createSrc; CreateDftPtr createSrc;
RegionPtr tmp; RegionPtr tmp;
int rc;
REQUEST_SIZE_MATCH (xShapeCombineReq); REQUEST_SIZE_MATCH (xShapeCombineReq);
UpdateCurrentTime(); UpdateCurrentTime();
pDestWin = LookupWindow (stuff->dest, client); rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixUnknownAccess);
if (!pDestWin) if (rc != Success)
return BadWindow; return rc;
if (!pDestWin->optional) if (!pDestWin->optional)
MakeWindowOptional (pDestWin); MakeWindowOptional (pDestWin);
switch (stuff->destKind) { switch (stuff->destKind) {
@ -550,9 +552,9 @@ ProcShapeCombine (client)
} }
pScreen = pDestWin->drawable.pScreen; pScreen = pDestWin->drawable.pScreen;
pSrcWin = LookupWindow (stuff->src, client); rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixUnknownAccess);
if (!pSrcWin) if (rc != Success)
return BadWindow; return rc;
switch (stuff->srcKind) { switch (stuff->srcKind) {
case ShapeBounding: case ShapeBounding:
srcRgn = wBoundingShape (pSrcWin); srcRgn = wBoundingShape (pSrcWin);
@ -616,11 +618,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) {
@ -645,12 +647,13 @@ ProcShapeOffset (client)
ScreenPtr pScreen; ScreenPtr pScreen;
REQUEST(xShapeOffsetReq); REQUEST(xShapeOffsetReq);
RegionPtr srcRgn; RegionPtr srcRgn;
int rc;
REQUEST_SIZE_MATCH (xShapeOffsetReq); REQUEST_SIZE_MATCH (xShapeOffsetReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = LookupWindow (stuff->dest, client); rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
switch (stuff->destKind) { switch (stuff->destKind) {
case ShapeBounding: case ShapeBounding:
srcRgn = wBoundingShape (pWin); srcRgn = wBoundingShape (pWin);
@ -688,7 +691,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) {
@ -709,13 +712,13 @@ ProcShapeQueryExtents (client)
WindowPtr pWin; WindowPtr pWin;
xShapeQueryExtentsReply rep; xShapeQueryExtentsReply rep;
BoxRec extents, *pExtents; BoxRec extents, *pExtents;
register int n; register int n, rc;
RegionPtr region; RegionPtr region;
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -820,13 +823,14 @@ ProcShapeSelectInput (client)
WindowPtr pWin; WindowPtr pWin;
ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead; ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
XID clientResource; XID clientResource;
int rc;
REQUEST_SIZE_MATCH (xShapeSelectInputReq); REQUEST_SIZE_MATCH (xShapeSelectInputReq);
pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
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) {
@ -990,16 +994,16 @@ ProcShapeInputSelected (client)
REQUEST(xShapeInputSelectedReq); REQUEST(xShapeInputSelectedReq);
WindowPtr pWin; WindowPtr pWin;
ShapeEventPtr pShapeEvent, *pHead; ShapeEventPtr pShapeEvent, *pHead;
int enabled; int enabled, rc;
xShapeInputSelectedReply rep; xShapeInputSelectedReply rep;
register int n; register int n;
REQUEST_SIZE_MATCH (xShapeInputSelectedReq); REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
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;
@ -1032,14 +1036,14 @@ ProcShapeGetRectangles (client)
WindowPtr pWin; WindowPtr pWin;
xShapeGetRectanglesReply rep; xShapeGetRectanglesReply rep;
xRectangle *rects; xRectangle *rects;
int nrects, i; int nrects, i, rc;
RegionPtr region; RegionPtr region;
register int n; register int n;
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
switch (stuff->kind) { switch (stuff->kind) {
case ShapeBounding: case ShapeBounding:
region = wBoundingShape(pWin); region = wBoundingShape(pWin);

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;
@ -606,7 +606,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
DrawablePtr pDraw; DrawablePtr pDraw;
xShmGetImageReply xgi; xShmGetImageReply xgi;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
int i, x, y, w, h, format; int i, x, y, w, h, format, rc;
Mask plane = 0, planemask; Mask plane = 0, planemask;
long lenPer = 0, length, widthBytesLine; long lenPer = 0, length, widthBytesLine;
Bool isRoot; Bool isRoot;
@ -621,13 +621,16 @@ 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)
return ProcShmGetImage(client); return ProcShmGetImage(client);
VERIFY_DRAWABLE(pDraw, stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
@ -660,8 +663,12 @@ ProcPanoramiXShmGetImage(ClientPtr client)
} }
drawables[0] = pDraw; drawables[0] = pDraw;
for(i = 1; i < PanoramiXNumScreens; i++) for(i = 1; i < PanoramiXNumScreens; i++) {
VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
}
xgi.visual = wVisual(((WindowPtr)pDraw)); xgi.visual = wVisual(((WindowPtr)pDraw));
xgi.type = X_Reply; xgi.type = X_Reply;
@ -720,7 +727,7 @@ ProcPanoramiXShmCreatePixmap(
PixmapPtr pMap = NULL; PixmapPtr pMap = NULL;
DrawablePtr pDraw; DrawablePtr pDraw;
DepthPtr pDepth; DepthPtr pDepth;
int i, j, result; int i, j, result, rc;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq); REQUEST(xShmCreatePixmapReq);
PanoramiXRes *newPix; PanoramiXRes *newPix;
@ -730,7 +737,11 @@ ProcPanoramiXShmCreatePixmap(
if (!sharedPixmaps) if (!sharedPixmaps)
return BadImplementation; return BadImplementation;
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
DixUnknownAccess);
if (rc != Success)
return rc;
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height) if (!stuff->width || !stuff->height)
{ {
@ -805,8 +816,8 @@ static int
ProcShmPutImage(client) ProcShmPutImage(client)
register ClientPtr client; register ClientPtr client;
{ {
register GCPtr pGC; GCPtr pGC;
register DrawablePtr pDraw; DrawablePtr pDraw;
long length; long length;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmPutImageReq); REQUEST(xShmPutImageReq);
@ -909,12 +920,12 @@ static int
ProcShmGetImage(client) ProcShmGetImage(client)
register ClientPtr client; register ClientPtr client;
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
long lenPer = 0, length; long lenPer = 0, length;
Mask plane = 0; Mask plane = 0;
xShmGetImageReply xgi; xShmGetImageReply xgi;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
int n; int n, rc;
REQUEST(xShmGetImageReq); REQUEST(xShmGetImageReq);
@ -924,7 +935,10 @@ ProcShmGetImage(client)
client->errorValue = stuff->format; client->errorValue = stuff->format;
return(BadValue); return(BadValue);
} }
VERIFY_DRAWABLE(pDraw, stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixUnknownAccess);
if (rc != Success)
return rc;
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (pDraw->type == DRAWABLE_WINDOW) if (pDraw->type == DRAWABLE_WINDOW)
{ {
@ -1042,9 +1056,9 @@ ProcShmCreatePixmap(client)
register ClientPtr client; register ClientPtr client;
{ {
PixmapPtr pMap; PixmapPtr pMap;
register DrawablePtr pDraw; DrawablePtr pDraw;
DepthPtr pDepth; DepthPtr pDepth;
register int i; register int i, rc;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq); REQUEST(xShmCreatePixmapReq);
@ -1053,7 +1067,11 @@ ProcShmCreatePixmap(client)
if (!sharedPixmaps) if (!sharedPixmaps)
return BadImplementation; return BadImplementation;
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
DixUnknownAccess);
if (rc != Success)
return rc;
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height) if (!stuff->width || !stuff->height)
{ {

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;
@ -1452,15 +1452,17 @@ ProcSyncSetPriority(client)
{ {
REQUEST(xSyncSetPriorityReq); REQUEST(xSyncSetPriorityReq);
ClientPtr priorityclient; ClientPtr priorityclient;
int rc;
REQUEST_SIZE_MATCH(xSyncSetPriorityReq); REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
if (stuff->id == None) if (stuff->id == None)
priorityclient = client; priorityclient = client;
else if (!(priorityclient = LookupClient(stuff->id, client))) else {
{ rc = dixLookupClient(&priorityclient, stuff->id, client,
client->errorValue = stuff->id; DixUnknownAccess);
return BadMatch; if (rc != Success)
return rc;
} }
if (priorityclient->priority != stuff->priority) if (priorityclient->priority != stuff->priority)
@ -1487,15 +1489,17 @@ ProcSyncGetPriority(client)
REQUEST(xSyncGetPriorityReq); REQUEST(xSyncGetPriorityReq);
xSyncGetPriorityReply rep; xSyncGetPriorityReply rep;
ClientPtr priorityclient; ClientPtr priorityclient;
int rc;
REQUEST_SIZE_MATCH(xSyncGetPriorityReq); REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
if (stuff->id == None) if (stuff->id == None)
priorityclient = client; priorityclient = client;
else if (!(priorityclient = LookupClient(stuff->id, client))) else {
{ rc = dixLookupClient(&priorityclient, stuff->id, client,
client->errorValue = stuff->id; DixUnknownAccess);
return BadMatch; if (rc != Success)
return rc;
} }
rep.type = X_Reply; rep.type = X_Reply;
@ -1550,7 +1554,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 +1587,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 +1625,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 +1771,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 +1900,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 +1941,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 +2001,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,10 @@ 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 */
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;
@ -1852,9 +1852,10 @@ ProcXpStartPage(ClientPtr client)
if(pContext->state & PAGE_STARTED) if(pContext->state & PAGE_STARTED)
return XpErrorBase+XPBadSequence; return XpErrorBase+XPBadSequence;
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, result = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
SecurityWriteAccess); if (result != Success)
if (!pWin || pWin->drawable.pScreen->myNum != pContext->screenNum) return result;
if (pWin->drawable.pScreen->myNum != pContext->screenNum)
return BadWindow; return BadWindow;
if((c = (XpStPagePtr)xalloc(sizeof(XpStPageRec))) == (XpStPagePtr)NULL) if((c = (XpStPagePtr)xalloc(sizeof(XpStPageRec))) == (XpStPagePtr)NULL)
@ -1943,8 +1944,11 @@ ProcXpPutDocumentData(ClientPtr client)
if (stuff->drawable) { if (stuff->drawable) {
if (pContext->state & DOC_RAW_STARTED) if (pContext->state & DOC_RAW_STARTED)
return BadDrawable; return BadDrawable;
pDraw = (DrawablePtr)LookupDrawable(stuff->drawable, client); result = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
if (!pDraw || pDraw->pScreen->myNum != pContext->screenNum) DixUnknownAccess);
if (result != Success)
return result;
if (pDraw->pScreen->myNum != pContext->screenNum)
return BadDrawable; return BadDrawable;
} else { } else {
if (pContext->state & DOC_COOKED_STARTED) if (pContext->state & DOC_COOKED_STARTED)
@ -1994,7 +1998,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 +2081,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 +2153,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 +2233,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 +2304,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 +2340,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

@ -139,12 +139,12 @@ ProcXTestCompareCursor(client)
xXTestCompareCursorReply rep; xXTestCompareCursorReply rep;
WindowPtr pWin; WindowPtr pWin;
CursorPtr pCursor; CursorPtr pCursor;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xXTestCompareCursorReq); REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
pWin = (WindowPtr)LookupWindow(stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return(BadWindow); return rc;
if (stuff->cursor == None) if (stuff->cursor == None)
pCursor = NullCursor; pCursor = NullCursor;
else if (stuff->cursor == XTestCurrentCursor) else if (stuff->cursor == XTestCurrentCursor)
@ -173,12 +173,10 @@ ProcXTestFakeInput(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xXTestFakeInputReq); REQUEST(xXTestFakeInputReq);
int nev; int nev, n, type, rc;
int n;
xEvent *ev; xEvent *ev;
DeviceIntPtr dev = NULL; DeviceIntPtr dev = NULL;
WindowPtr root; WindowPtr root;
int type;
#ifdef XINPUT #ifdef XINPUT
Bool extension = FALSE; Bool extension = FALSE;
deviceValuator *dv = NULL; deviceValuator *dv = NULL;
@ -367,9 +365,10 @@ ProcXTestFakeInput(client)
root = GetCurrentRootWindow(); root = GetCurrentRootWindow();
else else
{ {
root = LookupWindow(ev->u.keyButtonPointer.root, client); rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
if (!root) DixUnknownAccess);
return BadWindow; if (rc != Success)
return rc;
if (root->parent) if (root->parent)
{ {
client->errorValue = ev->u.keyButtonPointer.root; client->errorValue = ev->u.keyButtonPointer.root;

View File

@ -373,10 +373,8 @@ ProcXvQueryAdaptors(ClientPtr client)
xvFormat format; xvFormat format;
xvAdaptorInfo ainfo; xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep; xvQueryAdaptorsReply rep;
int totalSize; int totalSize, na, nf, rc;
int na;
XvAdaptorPtr pa; XvAdaptorPtr pa;
int nf;
XvFormatPtr pf; XvFormatPtr pf;
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
@ -385,11 +383,9 @@ ProcXvQueryAdaptors(ClientPtr client)
REQUEST(xvQueryAdaptorsReq); REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) )) rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
{ if (rc != Success)
client->errorValue = stuff->window; return rc;
return (BadWindow);
}
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
@ -531,9 +527,9 @@ ProcXvQueryEncodings(ClientPtr client)
static int static int
ProcXvPutVideo(ClientPtr client) ProcXvPutVideo(ClientPtr client)
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
register GCPtr pGC; GCPtr pGC;
int status; int status;
REQUEST(xvPutVideoReq); REQUEST(xvPutVideoReq);
@ -577,9 +573,9 @@ ProcXvPutVideo(ClientPtr client)
static int static int
ProcXvPutStill(ClientPtr client) ProcXvPutStill(ClientPtr client)
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
register GCPtr pGC; GCPtr pGC;
int status; int status;
REQUEST(xvPutStillReq); REQUEST(xvPutStillReq);
@ -624,9 +620,9 @@ ProcXvPutStill(ClientPtr client)
static int static int
ProcXvGetVideo(ClientPtr client) ProcXvGetVideo(ClientPtr client)
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
register GCPtr pGC; GCPtr pGC;
int status; int status;
REQUEST(xvGetVideoReq); REQUEST(xvGetVideoReq);
@ -671,9 +667,9 @@ ProcXvGetVideo(ClientPtr client)
static int static int
ProcXvGetStill(ClientPtr client) ProcXvGetStill(ClientPtr client)
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
register GCPtr pGC; GCPtr pGC;
int status; int status;
REQUEST(xvGetStillReq); REQUEST(xvGetStillReq);
@ -717,15 +713,14 @@ ProcXvGetStill(ClientPtr client)
static int static int
ProcXvSelectVideoNotify(ClientPtr client) ProcXvSelectVideoNotify(ClientPtr client)
{ {
register DrawablePtr pDraw; DrawablePtr pDraw;
int rc;
REQUEST(xvSelectVideoNotifyReq); REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) )) rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixUnknownAccess);
{ if (rc != Success)
client->errorValue = stuff->drawable; return rc;
return (BadWindow);
}
return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff); return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff);
@ -822,8 +817,8 @@ ProcXvUngrabPort(ClientPtr client)
static int static int
ProcXvStopVideo(ClientPtr client) ProcXvStopVideo(ClientPtr client)
{ {
int status; int status, rc;
register DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
REQUEST(xvStopVideoReq); REQUEST(xvStopVideoReq);
REQUEST_SIZE_MATCH(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq);
@ -840,11 +835,9 @@ ProcXvStopVideo(ClientPtr client)
return (status); return (status);
} }
if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) )) rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixUnknownAccess);
{ if (rc != Success)
client->errorValue = stuff->drawable; return rc;
return (BadDrawable);
}
return XVCALL(diStopVideo)(client, pPort, pDraw); return XVCALL(diStopVideo)(client, pPort, pDraw);
@ -1877,11 +1870,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 +1898,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 +1924,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 +1971,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 +2016,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 +2061,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

@ -106,7 +106,7 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
int int
ProcXChangeDeviceDontPropagateList(register ClientPtr client) ProcXChangeDeviceDontPropagateList(register ClientPtr client)
{ {
int i; int i, rc;
WindowPtr pWin; WindowPtr pWin;
struct tmask tmp[EMASKSIZE]; struct tmask tmp[EMASKSIZE];
OtherInputMasks *others; OtherInputMasks *others;
@ -121,11 +121,10 @@ ProcXChangeDeviceDontPropagateList(register ClientPtr client)
return Success; return Success;
} }
pWin = (WindowPtr) LookupWindow(stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) { if (rc != Success) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0, SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadWindow); rc);
return Success; return Success;
} }

View File

@ -506,6 +506,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
WindowPtr pWin, confineTo; WindowPtr pWin, confineTo;
CursorPtr cursor; CursorPtr cursor;
GrabPtr grab; GrabPtr grab;
int rc;
if ((this_device_mode != GrabModeSync) && if ((this_device_mode != GrabModeSync) &&
(this_device_mode != GrabModeAsync)) { (this_device_mode != GrabModeAsync)) {
@ -525,15 +526,15 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
client->errorValue = ownerEvents; client->errorValue = ownerEvents;
return BadValue; return BadValue;
} }
pWin = LookupWindow(grabWindow, client); rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (rconfineTo == None) if (rconfineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else { else {
confineTo = LookupWindow(rconfineTo, client); rc = dixLookupWindow(&confineTo, rconfineTo, client, DixUnknownAccess);
if (!confineTo) if (rc != Success)
return BadWindow; return rc;
} }
if (rcursor == None) if (rcursor == None)
cursor = NullCursor; cursor = NullCursor;
@ -563,6 +564,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
WindowPtr pWin; WindowPtr pWin;
GrabPtr grab; GrabPtr grab;
KeyClassPtr k = dev->key; KeyClassPtr k = dev->key;
int rc;
if (k == NULL) if (k == NULL)
return BadMatch; return BadMatch;
@ -589,9 +591,9 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
client->errorValue = ownerEvents; client->errorValue = ownerEvents;
return BadValue; return BadValue;
} }
pWin = LookupWindow(grabWindow, client); rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
grab = CreateGrab(client->index, dev, pWin, grab = CreateGrab(client->index, dev, pWin,
mask, ownerEvents, this_device_mode, other_devices_mode, mask, ownerEvents, this_device_mode, other_devices_mode,
@ -811,7 +813,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
} else } else
effectiveFocus = pWin = inputFocus; effectiveFocus = pWin = inputFocus;
} else } else
pWin = LookupWindow(dest, client); dixLookupWindow(&pWin, dest, client, DixUnknownAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if ((propagate != xFalse) && (propagate != xTrue)) { if ((propagate != xFalse) && (propagate != xTrue)) {

View File

@ -100,7 +100,7 @@ int
ProcXGetDeviceDontPropagateList(register ClientPtr client) ProcXGetDeviceDontPropagateList(register ClientPtr client)
{ {
CARD16 count = 0; CARD16 count = 0;
int i; int i, rc;
XEventClass *buf = NULL, *tbuf; XEventClass *buf = NULL, *tbuf;
WindowPtr pWin; WindowPtr pWin;
xGetDeviceDontPropagateListReply rep; xGetDeviceDontPropagateListReply rep;
@ -115,11 +115,10 @@ ProcXGetDeviceDontPropagateList(register ClientPtr client)
rep.length = 0; rep.length = 0;
rep.count = 0; rep.count = 0;
pWin = (WindowPtr) LookupWindow(stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) { if (rc != Success) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0, SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
BadWindow); rc);
return Success; return Success;
} }

View File

@ -98,8 +98,7 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
int int
ProcXGetSelectedExtensionEvents(register ClientPtr client) ProcXGetSelectedExtensionEvents(register ClientPtr client)
{ {
int i; int i, rc, total_length = 0;
int total_length = 0;
xGetSelectedExtensionEventsReply rep; xGetSelectedExtensionEventsReply rep;
WindowPtr pWin; WindowPtr pWin;
XEventClass *buf = NULL; XEventClass *buf = NULL;
@ -118,9 +117,10 @@ ProcXGetSelectedExtensionEvents(register ClientPtr client)
rep.this_client_count = 0; rep.this_client_count = 0;
rep.all_clients_count = 0; rep.all_clients_count = 0;
if (!(pWin = LookupWindow(stuff->window, client))) { rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (rc != Success) {
SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0, SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
BadWindow); rc);
return Success; return Success;
} }

View File

@ -170,11 +170,9 @@ ProcXSelectExtensionEvent(register ClientPtr client)
return Success; return Success;
} }
pWin = (WindowPtr) LookupWindow(stuff->window, client); ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) { if (ret != Success) {
client->errorValue = stuff->window; SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, ret);
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
BadWindow);
return Success; return Success;
} }

View File

@ -105,6 +105,7 @@ ProcXUngrabDeviceButton(ClientPtr client)
DeviceIntPtr mdev; DeviceIntPtr mdev;
WindowPtr pWin; WindowPtr pWin;
GrabRec temporaryGrab; GrabRec temporaryGrab;
int rc;
REQUEST(xUngrabDeviceButtonReq); REQUEST(xUngrabDeviceButtonReq);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
@ -134,9 +135,9 @@ ProcXUngrabDeviceButton(ClientPtr client)
} else } else
mdev = (DeviceIntPtr) LookupKeyboardDevice(); mdev = (DeviceIntPtr) LookupKeyboardDevice();
pWin = LookupWindow(stuff->grabWindow, client); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
if (!pWin) { if (rc != Success) {
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadWindow); SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, rc);
return Success; return Success;
} }

View File

@ -105,6 +105,7 @@ ProcXUngrabDeviceKey(ClientPtr client)
DeviceIntPtr mdev; DeviceIntPtr mdev;
WindowPtr pWin; WindowPtr pWin;
GrabRec temporaryGrab; GrabRec temporaryGrab;
int rc;
REQUEST(xUngrabDeviceKeyReq); REQUEST(xUngrabDeviceKeyReq);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
@ -133,9 +134,9 @@ ProcXUngrabDeviceKey(ClientPtr client)
} else } else
mdev = (DeviceIntPtr) LookupKeyboardDevice(); mdev = (DeviceIntPtr) LookupKeyboardDevice();
pWin = LookupWindow(stuff->grabWindow, client); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
if (!pWin) { if (rc != Success) {
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadWindow); SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, rc);
return Success; return Success;
} }
if (((stuff->key > dev->key->curKeySyms.maxKeyCode) || if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||

View File

@ -269,7 +269,10 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
client->errorValue = stuff->window; client->errorValue = stuff->window;
return BadWindow; return BadWindow;
} }
if (!pWin->viewable)
return BadMatch;
LEGAL_NEW_RESOURCE (stuff->pixmap, client); LEGAL_NEW_RESOURCE (stuff->pixmap, client);
cw = GetCompWindow (pWin); cw = GetCompWindow (pWin);

View File

@ -93,10 +93,10 @@ typedef struct _compPixmapVisit {
static Bool static Bool
compRepaintBorder (ClientPtr pClient, pointer closure) compRepaintBorder (ClientPtr pClient, pointer closure)
{ {
WindowPtr pWindow = LookupWindow ((XID) closure, pClient); WindowPtr pWindow;
int rc = dixLookupWindow(&pWindow, (XID)closure, pClient,DixUnknownAccess);
if (pWindow) if (rc == Success) {
{
RegionRec exposed; RegionRec exposed;
REGION_NULL(pScreen, &exposed); REGION_NULL(pScreen, &exposed);

View File

@ -36,10 +36,10 @@
/* the above comment lies. there is no better way. */ /* the above comment lies. there is no better way. */
#include "input.h" #include "input.h"
#include "inputstr.h" #include "inputstr.h"
#include "config.h" #include "hotplug.h"
#include "os.h" #include "os.h"
#define MATCH_RULE "type='method_call',interface='org.x.config.input'" #define CONFIG_MATCH_RULE "type='method_call',interface='org.x.config.input'"
#define MALFORMED_MSG "[config] malformed message, dropping" #define MALFORMED_MSG "[config] malformed message, dropping"
#define MALFORMED_MESSAGE() { DebugF(MALFORMED_MSG "\n"); \ #define MALFORMED_MESSAGE() { DebugF(MALFORMED_MSG "\n"); \
@ -50,18 +50,44 @@
ret = BadValue; \ ret = BadValue; \
goto unwind; } goto unwind; }
static DBusConnection *configConnection = NULL; /* How often to attempt reconnecting when we get booted off the bus. */
static int configfd = -1; #define RECONNECT_DELAY 10000 /* in ms */
static char busobject[32] = { 0 };
static char busname[64] = { 0 };
void struct config_data {
configDispatch() int fd;
DBusConnection *connection;
char busobject[32];
char busname[64];
};
static struct config_data *configData;
static CARD32 configReconnect(OsTimerPtr timer, CARD32 time, pointer arg);
static void
configWakeupHandler(pointer blockData, int err, pointer pReadMask)
{ {
if (!configConnection) struct config_data *data = blockData;
return;
dbus_connection_read_write_dispatch(configConnection, 0); if (data->connection && FD_ISSET(data->fd, (fd_set *) pReadMask))
dbus_connection_read_write_dispatch(data->connection, 0);
}
static void
configBlockHandler(pointer data, struct timeval **tv, pointer pReadMask)
{
}
static void
configTeardown(void)
{
if (configData) {
RemoveGeneralSocket(configData->fd);
RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
configData);
xfree(configData);
configData = NULL;
}
} }
static int static int
@ -217,23 +243,22 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
ret = configAddDevice(message, &iter, &error); ret = configAddDevice(message, &iter, &error);
else if (strcmp(dbus_message_get_member(message), "remove") == 0) else if (strcmp(dbus_message_get_member(message), "remove") == 0)
ret = configRemoveDevice(message, &iter, &error); ret = configRemoveDevice(message, &iter, &error);
} if (ret != BadDrawable && ret != BadAlloc) {
reply = dbus_message_new_method_return(message);
dbus_message_iter_init_append(reply, &iter);
if (ret != BadDrawable && ret != BadAlloc) { if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) {
reply = dbus_message_new_method_return(message); ErrorF("[config] couldn't append to iterator\n");
dbus_message_iter_init_append(reply, &iter); dbus_error_free(&error);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) { if (!dbus_connection_send(bus, reply, NULL))
ErrorF("[config] couldn't append to iterator\n"); ErrorF("[config] failed to send reply\n");
dbus_error_free(&error); dbus_connection_flush(bus);
return DBUS_HANDLER_RESULT_HANDLED;
dbus_message_unref(reply);
} }
if (!dbus_connection_send(bus, reply, NULL))
ErrorF("[config] failed to send reply\n");
dbus_connection_flush(bus);
dbus_message_unref(reply);
} }
dbus_error_free(&error); dbus_error_free(&error);
@ -246,71 +271,147 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
return DBUS_HANDLER_RESULT_HANDLED; return DBUS_HANDLER_RESULT_HANDLED;
} }
void /**
configInitialise() * This is a filter, which only handles the disconnected signal, which
* doesn't go to the normal message handling function. This takes
* precedence over the message handling function, so have have to be
* careful to ignore anything we don't want to deal with here.
*
* Yes, this is brutally stupid.
*/
static DBusHandlerResult
configFilter(DBusConnection *connection, DBusMessage *message, void *closure)
{
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
"Disconnected")) {
ErrorF("[dbus] disconnected from bus\n");
TimerSet(NULL, 0, RECONNECT_DELAY, configReconnect, NULL);
configTeardown();
return DBUS_HANDLER_RESULT_HANDLED;
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
static Bool
configSetup(void)
{ {
DBusConnection *bus = NULL;
DBusError error; DBusError error;
DBusObjectPathVTable vtable = { .message_function = configMessage }; DBusObjectPathVTable vtable = { .message_function = configMessage };
configConnection = NULL; if (!configData)
configData = (struct config_data *) xcalloc(sizeof(struct config_data), 1);
if (!configData) {
ErrorF("[dbus] failed to allocate data struct.\n");
return FALSE;
}
dbus_error_init(&error); dbus_error_init(&error);
bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error); configData->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
if (!bus || dbus_error_is_set(&error)) { if (!configData->connection || dbus_error_is_set(&error)) {
ErrorF("[dbus] some kind of error occurred: %s (%s)\n", error.name, ErrorF("[dbus] some kind of error occurred: %s (%s)\n", error.name,
error.message); error.message);
dbus_error_free(&error); dbus_error_free(&error);
return; xfree(configData);
configData = NULL;
return FALSE;
} }
if (!dbus_connection_get_unix_fd(bus, &configfd)) { dbus_connection_set_exit_on_disconnect(configData->connection, FALSE);
dbus_connection_unref(bus);
if (!dbus_connection_get_unix_fd(configData->connection, &configData->fd)) {
dbus_connection_unref(configData->connection);
ErrorF("[dbus] couldn't get fd for bus\n"); ErrorF("[dbus] couldn't get fd for bus\n");
dbus_error_free(&error); dbus_error_free(&error);
configfd = -1; xfree(configData);
return; configData = NULL;
return FALSE;
} }
snprintf(busname, sizeof(busname), "org.x.config.display%d", atoi(display)); snprintf(configData->busname, sizeof(configData->busname),
if (!dbus_bus_request_name(bus, busname, 0, &error) || "org.x.config.display%d", atoi(display));
dbus_error_is_set(&error)) { if (!dbus_bus_request_name(configData->connection, configData->busname,
0, &error) || dbus_error_is_set(&error)) {
ErrorF("[dbus] couldn't take over org.x.config: %s (%s)\n", ErrorF("[dbus] couldn't take over org.x.config: %s (%s)\n",
error.name, error.message); error.name, error.message);
dbus_error_free(&error); dbus_error_free(&error);
dbus_connection_unref(bus); dbus_connection_unref(configData->connection);
configfd = -1; xfree(configData);
return; configData = NULL;
return FALSE;
} }
/* blocks until we get a reply. */ /* blocks until we get a reply. */
dbus_bus_add_match(bus, MATCH_RULE, &error); dbus_bus_add_match(configData->connection, CONFIG_MATCH_RULE, &error);
if (dbus_error_is_set(&error)) { if (dbus_error_is_set(&error)) {
ErrorF("[dbus] couldn't match X.Org rule: %s (%s)\n", error.name, ErrorF("[dbus] couldn't match X.Org rule: %s (%s)\n", error.name,
error.message); error.message);
dbus_error_free(&error); dbus_error_free(&error);
dbus_bus_release_name(bus, busname, &error); dbus_bus_release_name(configData->connection, configData->busname,
dbus_connection_unref(bus); &error);
configfd = -1; dbus_connection_unref(configData->connection);
return; xfree(configData);
configData = NULL;
return FALSE;
} }
snprintf(busobject, sizeof(busobject), "/org/x/config/%d", atoi(display)); if (!dbus_connection_add_filter(configData->connection, configFilter,
if (!dbus_connection_register_object_path(bus, busobject, &vtable, bus)) { configData, NULL)) {
ErrorF("[dbus] couldn't register object path\n");
configfd = -1; ErrorF("[dbus] couldn't add signal filter: %s (%s)\n", error.name,
dbus_bus_release_name(bus, busname, &error); error.message);
dbus_bus_remove_match(bus, MATCH_RULE, &error);
dbus_connection_unref(bus);
dbus_error_free(&error); dbus_error_free(&error);
return; dbus_bus_release_name(configData->connection, configData->busname,
&error);
dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
&error);
dbus_connection_unref(configData->connection);
xfree(configData);
configData = NULL;
return FALSE;
} }
DebugF("[dbus] registered object path %s\n", busobject); snprintf(configData->busobject, sizeof(configData->busobject),
"/org/x/config/%d", atoi(display));
if (!dbus_connection_register_object_path(configData->connection,
configData->busobject, &vtable,
configData->connection)) {
ErrorF("[dbus] couldn't register object path\n");
dbus_bus_release_name(configData->connection, configData->busname,
&error);
dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
&error);
dbus_connection_unref(configData->connection);
dbus_error_free(&error);
xfree(configData);
configData = NULL;
return FALSE;
}
DebugF("[dbus] registered object path %s\n", configData->busobject);
dbus_error_free(&error); dbus_error_free(&error);
configConnection = bus; AddGeneralSocket(configData->fd);
AddGeneralSocket(configfd);
RegisterBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler,
configData);
return TRUE;
}
static CARD32
configReconnect(OsTimerPtr timer, CARD32 time, pointer arg)
{
if (configSetup())
return 0;
else
return RECONNECT_DELAY;
}
void
configInitialise()
{
TimerSet(NULL, 0, 1, configReconnect, NULL);
} }
void void
@ -318,26 +419,24 @@ configFini()
{ {
DBusError error; DBusError error;
if (configConnection) { if (configData) {
dbus_error_init(&error); dbus_error_init(&error);
dbus_connection_unregister_object_path(configConnection, busobject); dbus_connection_unregister_object_path(configData->connection,
dbus_bus_remove_match(configConnection, MATCH_RULE, &error); configData->busobject);
dbus_bus_release_name(configConnection, busname, &error); dbus_connection_remove_filter(configData->connection, configFilter,
dbus_connection_unref(configConnection); configData);
RemoveGeneralSocket(configfd); dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE,
configConnection = NULL; &error);
configfd = -1; dbus_bus_release_name(configData->connection, configData->busname,
&error);
dbus_connection_unref(configData->connection);
dbus_error_free(&error); dbus_error_free(&error);
configTeardown();
} }
} }
#else /* !HAVE_DBUS */ #else /* !HAVE_DBUS */
void
configDispatch()
{
}
void void
configInitialise() configInitialise()
{ {

View File

@ -391,7 +391,7 @@ AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [P
AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]), AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
[ FONTDIR="$withval" ], [ FONTDIR="$withval" ],
[ FONTDIR="${libdir}/X11/fonts" ]) [ FONTDIR="${libdir}/X11/fonts" ])
DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/CID/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/" DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
[ FONTPATH="$withval" ], [ FONTPATH="$withval" ],
[ FONTPATH="${DEFAULT_FONT_PATH}" ]) [ FONTPATH="${DEFAULT_FONT_PATH}" ])
@ -1006,7 +1006,7 @@ dnl ---------------------------------------------------------------------------
dnl DMX DDX dnl DMX DDX
AC_MSG_CHECKING([whether to build Xdmx DDX]) AC_MSG_CHECKING([whether to build Xdmx DDX])
PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no]) PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
if test "x$DMX" = xauto; then if test "x$DMX" = xauto; then
DMX="$have_dmx" DMX="$have_dmx"
fi fi
@ -1058,7 +1058,7 @@ AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
if test "x$XVFB" = xyes; then if test "x$XVFB" = xyes; then
XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS"
AC_SUBST([XVFB_LIBS]) AC_SUBST([XVFB_LIBS])
fi fi

View File

@ -34,6 +34,7 @@ MANDEFS = \
-D__miscmansuffix__=$(MISC_MAN_SUFFIX) \ -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
-D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \ -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \ -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
-D__mandir__=$(mandir) \
-D__projectroot__=$(prefix) \ -D__projectroot__=$(prefix) \
-D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \ -D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \
-D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME)

View File

@ -173,13 +173,17 @@ ProcDamageCreate (ClientPtr client)
DamageExtPtr pDamageExt; DamageExtPtr pDamageExt;
DamageReportLevel level; DamageReportLevel level;
RegionPtr pRegion; RegionPtr pRegion;
int rc;
REQUEST(xDamageCreateReq); REQUEST(xDamageCreateReq);
REQUEST_SIZE_MATCH(xDamageCreateReq); REQUEST_SIZE_MATCH(xDamageCreateReq);
LEGAL_NEW_RESOURCE(stuff->damage, client); LEGAL_NEW_RESOURCE(stuff->damage, client);
SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
SecurityReadAccess); DixReadAccess);
if (rc != Success)
return rc;
switch (stuff->level) { switch (stuff->level) {
case XDamageReportRawRectangles: case XDamageReportRawRectangles:
level = DamageReportRawRegion; level = DamageReportRawRegion;
@ -237,7 +241,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 +255,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

@ -405,11 +405,9 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
/* The window must be valid. */ /* The window must be valid. */
if (!(pWin = SecurityLookupWindow(stuff->window, client, status = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
SecurityWriteAccess))) if (status != Success)
{ return status;
return(BadWindow);
}
/* The window must be InputOutput. */ /* The window must be InputOutput. */
if (pWin->drawable.class != InputOutput) if (pWin->drawable.class != InputOutput)
@ -633,9 +631,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);
@ -729,11 +727,11 @@ ProcDbeSwapBuffers(ClientPtr client)
/* Check all windows to swap. */ /* Check all windows to swap. */
/* Each window must be a valid window - BadWindow. */ /* Each window must be a valid window - BadWindow. */
if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, error = dixLookupWindow(&pWin, dbeSwapInfo[i].window, client,
SecurityWriteAccess))) DixWriteAccess);
{ if (error != Success) {
DEALLOCATE_LOCAL(swapInfo); DEALLOCATE_LOCAL(swapInfo);
return(BadWindow); return error;
} }
/* Each window must be double-buffered - BadMatch. */ /* Each window must be double-buffered - BadMatch. */
@ -867,7 +865,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
xDbeGetVisualInfoReply rep; xDbeGetVisualInfoReply rep;
Drawable *drawables; Drawable *drawables;
DrawablePtr *pDrawables = NULL; DrawablePtr *pDrawables = NULL;
register int i, j, n; register int i, j, n, rc;
register int count; /* number of visual infos in reply */ register int count; /* number of visual infos in reply */
register int length; /* length of reply */ register int length; /* length of reply */
ScreenPtr pScreen; ScreenPtr pScreen;
@ -889,11 +887,11 @@ ProcDbeGetVisualInfo(ClientPtr client)
for (i = 0; i < stuff->n; i++) for (i = 0; i < stuff->n; i++)
{ {
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( rc = dixLookupDrawable(pDrawables+i, drawables[i], client, 0,
drawables[i], client, SecurityReadAccess))) DixReadAccess);
{ if (rc != Success) {
DEALLOCATE_LOCAL(pDrawables); DEALLOCATE_LOCAL(pDrawables);
return(BadDrawable); return rc;
} }
} }
} }
@ -1047,7 +1045,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

@ -302,9 +302,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
DeviceIntPtr pDev; DeviceIntPtr pDev;
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

@ -1847,16 +1847,16 @@ ProcGetMotionEvents(ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
xTimecoord * coords = (xTimecoord *) NULL; xTimecoord * coords = (xTimecoord *) NULL;
xGetMotionEventsReply rep; xGetMotionEventsReply rep;
int i, count, xmin, xmax, ymin, ymax; int i, count, xmin, xmax, ymin, ymax, rc;
unsigned long nEvents; unsigned long nEvents;
DeviceIntPtr mouse = inputInfo.pointer; DeviceIntPtr mouse = inputInfo.pointer;
TimeStamp start, stop; TimeStamp start, stop;
REQUEST(xGetMotionEventsReq); REQUEST(xGetMotionEventsReq);
REQUEST_SIZE_MATCH(xGetMotionEventsReq); REQUEST_SIZE_MATCH(xGetMotionEventsReq);
pWin = SecurityLookupWindow(stuff->window, client, TRUE); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (mouse->valuator->motionHintWindow) if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client); MaybeStopHint(mouse, client);
rep.type = X_Reply; rep.type = X_Reply;

File diff suppressed because it is too large Load Diff

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

@ -194,115 +194,144 @@ CompareISOLatin1Lowered(unsigned char *s1, int s1len,
return (int) c1 - (int) c2; return (int) c1 - (int) c2;
} }
#ifdef XACE /*
* dixLookupWindow and dixLookupDrawable:
/* SecurityLookupWindow and SecurityLookupDrawable: * Look up the window/drawable taking into account the client doing the
* Look up the window/drawable taking into account the client doing * lookup, the type of drawable desired, and the type of access desired.
* the lookup and the type of access desired. Return the window/drawable * Return Success with *pDraw set if the window/drawable exists and the client
* if it exists and the client is allowed access, else return NULL. * is allowed access, else return an error code with *pDraw set to NULL. The
* Most Proc* functions should be calling these instead of * access mask values are defined in resource.h. The type mask values are
* LookupWindow and LookupDrawable, which do no access checks. * defined in pixmap.h, with zero equivalent to M_DRAWABLE.
* XACE note: need to see if client->lastDrawableID can still be used here.
*/ */
_X_EXPORT int
_X_EXPORT WindowPtr dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) Mask type, Mask access)
{ {
client->errorValue = rid; DrawablePtr pTmp;
if(rid == INVALID) RESTYPE rtype;
return NULL; *pDraw = NULL;
return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); client->errorValue = id;
}
if (id == INVALID)
return BadDrawable;
_X_EXPORT pointer if (id == client->lastDrawableID) {
SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) pTmp = client->lastDrawable;
{
register DrawablePtr pDraw;
if(rid == INVALID) /* an access check is required for cached drawables */
return (pointer) NULL; rtype = (pTmp->type | M_WINDOW) ? RT_WINDOW : RT_PIXMAP;
pDraw = (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, if (!XaceHook(XACE_RESOURCE_ACCESS, client, id, rtype, access, pTmp))
access_mode); return BadDrawable;
if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) } else
return (pointer)pDraw; pTmp = (DrawablePtr)SecurityLookupIDByClass(client, id, RC_DRAWABLE,
return (pointer)NULL; access);
} if (!pTmp)
return BadDrawable;
if (!((1 << pTmp->type) | (type ? type : M_DRAWABLE)))
return BadMatch;
/* We can't replace the LookupWindow and LookupDrawable functions with if (pTmp->type | M_DRAWABLE) {
* macros because of compatibility with loadable servers. client->lastDrawable = pTmp;
*/ client->lastDrawableID = id;
_X_EXPORT WindowPtr
LookupWindow(XID rid, ClientPtr client)
{
return SecurityLookupWindow(rid, client, SecurityUnknownAccess);
}
_X_EXPORT pointer
LookupDrawable(XID rid, ClientPtr client)
{
return SecurityLookupDrawable(rid, client, SecurityUnknownAccess);
}
#else /* not XACE */
WindowPtr
LookupWindow(XID rid, ClientPtr client)
{
WindowPtr pWin;
client->errorValue = rid;
if(rid == INVALID)
return NULL;
if (client->lastDrawableID == rid)
{
if (client->lastDrawable->type == DRAWABLE_WINDOW)
return ((WindowPtr) client->lastDrawable);
return (WindowPtr) NULL;
}
pWin = (WindowPtr)LookupIDByType(rid, RT_WINDOW);
if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) {
client->lastDrawable = (DrawablePtr) pWin;
client->lastDrawableID = rid;
client->lastGCID = INVALID; client->lastGCID = INVALID;
client->lastGC = (GCPtr)NULL; client->lastGC = (GCPtr)NULL;
} }
return pWin; *pDraw = pTmp;
return Success;
} }
_X_EXPORT int
pointer dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access)
LookupDrawable(XID rid, ClientPtr client)
{ {
register DrawablePtr pDraw; int rc;
rc = dixLookupDrawable((DrawablePtr*)pWin, id, client, M_WINDOW, access);
if(rid == INVALID) return (rc == BadDrawable) ? BadWindow : rc;
return (pointer) NULL;
if (client->lastDrawableID == rid)
return ((pointer) client->lastDrawable);
pDraw = (DrawablePtr)LookupIDByClass(rid, RC_DRAWABLE);
if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW))
return (pointer)pDraw;
return (pointer)NULL;
} }
#endif /* XACE */ _X_EXPORT int
dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access)
{
GCPtr pTmp = (GCPtr)SecurityLookupIDByType(client, id, RT_GC, access);
if (pTmp) {
*pGC = pTmp;
return Success;
}
client->errorValue = id;
*pGC = NULL;
return BadGC;
}
_X_EXPORT ClientPtr _X_EXPORT int
LookupClient(XID rid, ClientPtr client) dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
{ {
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);
client->errorValue = rid;
if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) {
{ *pClient = clients[clientIndex];
return clients[clientIndex]; return Success;
} }
return (ClientPtr)NULL; *pClient = NULL;
return BadValue;
} }
/*
* These are deprecated compatibility functions and will be removed soon!
* Please use the new dixLookup*() functions above.
*/
_X_EXPORT _X_DEPRECATED WindowPtr
SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
{
WindowPtr pWin;
int i = dixLookupWindow(&pWin, id, client, access_mode);
static int warn = 1;
if (warn-- > 0)
ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
"are deprecated. Please convert your driver/module "
"to use dixLookupWindow().\n");
return (i == Success) ? pWin : NULL;
}
_X_EXPORT _X_DEPRECATED WindowPtr
LookupWindow(XID id, ClientPtr client)
{
return SecurityLookupWindow(id, client, DixUnknownAccess);
}
_X_EXPORT _X_DEPRECATED pointer
SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode)
{
DrawablePtr pDraw;
int i = dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
static int warn = 1;
if (warn-- > 0)
ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
"are deprecated. Please convert your driver/module "
"to use dixLookupDrawable().\n");
return (i == Success) ? pDraw : NULL;
}
_X_EXPORT _X_DEPRECATED pointer
LookupDrawable(XID id, ClientPtr client)
{
return SecurityLookupDrawable(id, client, DixUnknownAccess);
}
_X_EXPORT _X_DEPRECATED ClientPtr
LookupClient(XID id, ClientPtr client)
{
ClientPtr pClient;
int i = dixLookupClient(&pClient, id, client, DixUnknownAccess);
static int warn = 1;
if (warn-- > 0)
ErrorF("Warning: LookupClient() is deprecated. Please convert your "
"driver/module to use dixLookupClient().\n");
return (i == Success) ? pClient : NULL;
}
/* end deprecated functions */
int int
AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,

View File

@ -328,7 +328,8 @@ static void ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
static void PostNewCursor(DeviceIntPtr pDev); static void PostNewCursor(DeviceIntPtr pDev);
#define SyntheticMotion(dev, x, y) \ #define SyntheticMotion(dev, x, y) \
PostSyntheticMotion(dev, x, y, dev->pSprite->screen, \ PostSyntheticMotion(dev, x, y, noPanoramiXExtension ? 0 : \
dev->pSprite->screen->myNum, \
syncEvents.playingEvents ? \ syncEvents.playingEvents ? \
syncEvents.time.milliseconds : \ syncEvents.time.milliseconds : \
currentTime.milliseconds); currentTime.milliseconds);
@ -2342,17 +2343,16 @@ static int
XineramaWarpPointer(ClientPtr client) XineramaWarpPointer(ClientPtr client)
{ {
WindowPtr dest = NULL; WindowPtr dest = NULL;
int x, y; int x, y, rc;
SpritePtr pSprite = inputInfo.pointer->pSprite; SpritePtr pSprite = inputInfo.pointer->pSprite;
REQUEST(xWarpPointerReq); REQUEST(xWarpPointerReq);
if (stuff->dstWid != None) if (stuff->dstWid != None) {
{ rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); if (rc != Success)
if (!dest) return rc;
return BadWindow;
} }
x = pSprite->hotPhys.x; x = pSprite->hotPhys.x;
y = pSprite->hotPhys.y; y = pSprite->hotPhys.y;
@ -2363,8 +2363,9 @@ XineramaWarpPointer(ClientPtr client)
XID winID = stuff->srcWid; XID winID = stuff->srcWid;
WindowPtr source; WindowPtr source;
source = SecurityLookupWindow(winID, client, SecurityReadAccess); rc = dixLookupWindow(&source, winID, client, DixReadAccess);
if (!source) return BadWindow; if (rc != Success)
return rc;
winX = source->drawable.x; winX = source->drawable.x;
winY = source->drawable.y; winY = source->drawable.y;
@ -2416,7 +2417,7 @@ int
ProcWarpPointer(ClientPtr client) ProcWarpPointer(ClientPtr client)
{ {
WindowPtr dest = NULL; WindowPtr dest = NULL;
int x, y; int x, y, rc;
ScreenPtr newScreen; ScreenPtr newScreen;
SpritePtr pSprite = inputInfo.pointer->pSprite; SpritePtr pSprite = inputInfo.pointer->pSprite;
@ -2429,11 +2430,10 @@ ProcWarpPointer(ClientPtr client)
return XineramaWarpPointer(client); return XineramaWarpPointer(client);
#endif #endif
if (stuff->dstWid != None) if (stuff->dstWid != None) {
{ rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); if (rc != Success)
if (!dest) return rc;
return BadWindow;
} }
x = pSprite->hotPhys.x; x = pSprite->hotPhys.x;
y = pSprite->hotPhys.y; y = pSprite->hotPhys.y;
@ -2444,8 +2444,9 @@ ProcWarpPointer(ClientPtr client)
XID winID = stuff->srcWid; XID winID = stuff->srcWid;
WindowPtr source; WindowPtr source;
source = SecurityLookupWindow(winID, client, SecurityReadAccess); rc = dixLookupWindow(&source, winID, client, DixReadAccess);
if (!source) return BadWindow; if (rc != Success)
return rc;
winX = source->drawable.x; winX = source->drawable.x;
winY = source->drawable.y; winY = source->drawable.y;
@ -3673,8 +3674,8 @@ SetInputFocus(
Bool followOK) Bool followOK)
{ {
register FocusClassPtr focus; register FocusClassPtr focus;
register WindowPtr focusWin; WindowPtr focusWin;
int mode; int mode, rc;
TimeStamp time; TimeStamp time;
UpdateCurrentTime(); UpdateCurrentTime();
@ -3691,14 +3692,12 @@ SetInputFocus(
focusWin = (WindowPtr)(long)focusID; focusWin = (WindowPtr)(long)focusID;
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 {
SecurityReadAccess))) rc = dixLookupWindow(&focusWin, focusID, client, DixReadAccess);
return BadWindow; if (rc != Success)
else return rc;
{
/* It is a match error to try to set the input focus to an /* It is a match error to try to set the input focus to an
unviewable window. */ unviewable window. */
if(!focusWin->realized) if(!focusWin->realized)
return(BadMatch); return(BadMatch);
} }
@ -3787,6 +3786,7 @@ ProcGrabPointer(ClientPtr client)
CursorPtr cursor, oldCursor; CursorPtr cursor, oldCursor;
REQUEST(xGrabPointerReq); REQUEST(xGrabPointerReq);
TimeStamp time; TimeStamp time;
int rc;
REQUEST_SIZE_MATCH(xGrabPointerReq); REQUEST_SIZE_MATCH(xGrabPointerReq);
UpdateCurrentTime(); UpdateCurrentTime();
@ -3812,24 +3812,24 @@ ProcGrabPointer(ClientPtr client)
client->errorValue = stuff->eventMask; client->errorValue = stuff->eventMask;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (stuff->confineTo == None) if (stuff->confineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else else
{ {
confineTo = SecurityLookupWindow(stuff->confineTo, client, rc = dixLookupWindow(&confineTo, stuff->confineTo, client,
SecurityReadAccess); DixReadAccess);
if (!confineTo) if (rc != Success)
return BadWindow; return rc;
} }
if (stuff->cursor == None) if (stuff->cursor == None)
cursor = NullCursor; cursor = NullCursor;
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;
@ -3904,7 +3904,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;
@ -3954,9 +3954,10 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
unsigned this_mode, unsigned other_mode, Window grabWindow, unsigned this_mode, unsigned other_mode, Window grabWindow,
unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status) unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status)
{ {
register WindowPtr pWin; WindowPtr pWin;
register GrabPtr grab; register GrabPtr grab;
TimeStamp time; TimeStamp time;
int rc;
UpdateCurrentTime(); UpdateCurrentTime();
if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync)) if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync))
@ -3974,9 +3975,9 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
client->errorValue = ownerEvents; client->errorValue = ownerEvents;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
time = ClientTimeToServerTime(ctime); time = ClientTimeToServerTime(ctime);
grab = dev->grab; grab = dev->grab;
if (grab && !SameClient(grab, client)) if (grab && !SameClient(grab, client))
@ -4063,14 +4064,16 @@ ProcQueryPointer(ClientPtr client)
{ {
xQueryPointerReply rep; xQueryPointerReply rep;
WindowPtr pWin, t; WindowPtr pWin, t;
REQUEST(xResourceReq);
DeviceIntPtr mouse = inputInfo.pointer; DeviceIntPtr mouse = inputInfo.pointer;
SpritePtr pSprite = mouse->pSprite; SpritePtr pSprite = mouse->pSprite;
int rc;
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (mouse->valuator->motionHintWindow) if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client); MaybeStopHint(mouse, client);
rep.type = X_Reply; rep.type = X_Reply;
@ -4257,8 +4260,8 @@ ProcSendEvent(ClientPtr client)
effectiveFocus = pWin = inputFocus; effectiveFocus = pWin = inputFocus;
} }
else else
pWin = SecurityLookupWindow(stuff->destination, client, dixLookupWindow(&pWin, stuff->destination, client, DixReadAccess);
SecurityReadAccess);
if (!pWin) if (!pWin)
return BadWindow; return BadWindow;
if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue))
@ -4294,11 +4297,12 @@ ProcUngrabKey(ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
GrabRec tempGrab; GrabRec tempGrab;
DeviceIntPtr keybd = inputInfo.keyboard; DeviceIntPtr keybd = inputInfo.keyboard;
int rc;
REQUEST_SIZE_MATCH(xUngrabKeyReq); REQUEST_SIZE_MATCH(xUngrabKeyReq);
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) ||
(stuff->key < keybd->key->curKeySyms.minKeyCode)) (stuff->key < keybd->key->curKeySyms.minKeyCode))
@ -4335,6 +4339,7 @@ ProcGrabKey(ClientPtr client)
REQUEST(xGrabKeyReq); REQUEST(xGrabKeyReq);
GrabPtr grab; GrabPtr grab;
DeviceIntPtr keybd = inputInfo.keyboard; DeviceIntPtr keybd = inputInfo.keyboard;
int rc;
REQUEST_SIZE_MATCH(xGrabKeyReq); REQUEST_SIZE_MATCH(xGrabKeyReq);
if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse)) if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse))
@ -4367,9 +4372,9 @@ ProcGrabKey(ClientPtr client)
client->errorValue = stuff->modifiers; client->errorValue = stuff->modifiers;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
grab = CreateGrab(client->index, keybd, pWin, grab = CreateGrab(client->index, keybd, pWin,
(Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents, (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents,
@ -4389,6 +4394,7 @@ ProcGrabButton(ClientPtr client)
REQUEST(xGrabButtonReq); REQUEST(xGrabButtonReq);
CursorPtr cursor; CursorPtr cursor;
GrabPtr grab; GrabPtr grab;
int rc;
REQUEST_SIZE_MATCH(xGrabButtonReq); REQUEST_SIZE_MATCH(xGrabButtonReq);
if ((stuff->pointerMode != GrabModeSync) && if ((stuff->pointerMode != GrabModeSync) &&
@ -4419,23 +4425,23 @@ ProcGrabButton(ClientPtr client)
client->errorValue = stuff->eventMask; client->errorValue = stuff->eventMask;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
if (stuff->confineTo == None) if (stuff->confineTo == None)
confineTo = NullWindow; confineTo = NullWindow;
else { else {
confineTo = SecurityLookupWindow(stuff->confineTo, client, rc = dixLookupWindow(&confineTo, stuff->confineTo, client,
SecurityReadAccess); DixReadAccess);
if (!confineTo) if (rc != Success)
return BadWindow; return rc;
} }
if (stuff->cursor == None) if (stuff->cursor == None)
cursor = NullCursor; cursor = NullCursor;
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;
@ -4460,6 +4466,7 @@ ProcUngrabButton(ClientPtr client)
REQUEST(xUngrabButtonReq); REQUEST(xUngrabButtonReq);
WindowPtr pWin; WindowPtr pWin;
GrabRec tempGrab; GrabRec tempGrab;
int rc;
REQUEST_SIZE_MATCH(xUngrabButtonReq); REQUEST_SIZE_MATCH(xUngrabButtonReq);
if ((stuff->modifiers != AnyModifier) && if ((stuff->modifiers != AnyModifier) &&
@ -4468,9 +4475,9 @@ ProcUngrabButton(ClientPtr client)
client->errorValue = stuff->modifiers; client->errorValue = stuff->modifiers;
return BadValue; return BadValue;
} }
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
tempGrab.resource = client->clientAsMask; tempGrab.resource = client->clientAsMask;
tempGrab.device = inputInfo.pointer; tempGrab.device = inputInfo.pointer;
tempGrab.window = pWin; tempGrab.window = pWin;
@ -4631,7 +4638,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

@ -489,6 +489,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
int num_events = 0, final_valuator = 0; int num_events = 0, final_valuator = 0;
CARD32 ms = 0; CARD32 ms = 0;
deviceKeyButtonPointer *kbp = NULL; deviceKeyButtonPointer *kbp = NULL;
/* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies
* with DeviceValuators. */
Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE); Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE);
DeviceIntPtr pointer = NULL; DeviceIntPtr pointer = NULL;
int x = 0, y = 0; int x = 0, y = 0;
@ -505,15 +507,16 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
else else
num_events = 1; num_events = 1;
if (type == MotionNotify && num_valuators <= 0) {
return 0;
}
/* Do we need to send a DeviceValuator event? */ /* Do we need to send a DeviceValuator event? */
if ((num_valuators + first_valuator) > 2 && sendValuators) { if (sendValuators) {
if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS) if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS)
num_valuators = MAX_VALUATOR_EVENTS * 6; num_valuators = MAX_VALUATOR_EVENTS * 6;
num_events += ((num_valuators - 1) / 6) + 1; num_events += ((num_valuators - 1) / 6) + 1;
} }
else if (type == MotionNotify && num_valuators <= 0) {
return 0;
}
final_valuator = num_valuators + first_valuator; final_valuator = num_valuators + first_valuator;
@ -546,7 +549,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
y = valuators[1 - first_valuator]; y = valuators[1 - first_valuator];
} }
else { else {
y = pointer->valuator->lasty; y = pointer->valuator->lasty;
} }
} }
else { else {
@ -606,7 +609,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
kbp->root_y = y; kbp->root_y = y;
events++; events++;
if (final_valuator > 2 && sendValuators) { if (sendValuators) {
kbp->deviceid |= MORE_EVENTS; kbp->deviceid |= MORE_EVENTS;
clipValuators(pDev, first_valuator, num_valuators, valuators); clipValuators(pDev, first_valuator, num_valuators, valuators);
events = getValuatorEvents(events, pDev, first_valuator, events = getValuatorEvents(events, pDev, first_valuator,
@ -754,7 +757,7 @@ void
PostSyntheticMotion(DeviceIntPtr pDev, PostSyntheticMotion(DeviceIntPtr pDev,
int x, int x,
int y, int y,
ScreenPtr pScreen, int screen,
unsigned long time) unsigned long time)
{ {
xEvent xE; xEvent xE;
@ -764,8 +767,8 @@ PostSyntheticMotion(DeviceIntPtr pDev,
will translate from sprite screen to screen 0 upon reentry will translate from sprite screen to screen 0 upon reentry
to the DIX layer. */ to the DIX layer. */
if (!noPanoramiXExtension) { if (!noPanoramiXExtension) {
x += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; x += panoramiXdataPtr[0].x - panoramiXdataPtr[screen].x;
y += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; y += panoramiXdataPtr[0].y - panoramiXdataPtr[screen].y;
} }
#endif #endif

View File

@ -98,7 +98,7 @@ Equipment Corporation.
#include <X11/fonts/font.h> #include <X11/fonts/font.h>
#include "opaque.h" #include "opaque.h"
#include "servermd.h" #include "servermd.h"
#include "config.h" #include "hotplug.h"
#include "site.h" #include "site.h"
#include "dixfont.h" #include "dixfont.h"
#include "extnsionst.h" #include "extnsionst.h"
@ -309,9 +309,9 @@ main(int argc, char *argv[], char *envp[])
DPMSPowerLevel = 0; DPMSPowerLevel = 0;
#endif #endif
InitBlockAndWakeupHandlers(); InitBlockAndWakeupHandlers();
configInitialise();
/* Perform any operating system dependent initializations you'd like */ /* Perform any operating system dependent initializations you'd like */
OsInit(); OsInit();
configInitialise();
if(serverGeneration == 1) if(serverGeneration == 1)
{ {
CreateWellKnownSockets(); CreateWellKnownSockets();

View File

@ -94,7 +94,7 @@ PrintPropertys(WindowPtr pWin)
int int
ProcRotateProperties(ClientPtr client) ProcRotateProperties(ClientPtr client)
{ {
int i, j, delta; int i, j, delta, rc;
REQUEST(xRotatePropertiesReq); REQUEST(xRotatePropertiesReq);
WindowPtr pWin; WindowPtr pWin;
register Atom * atoms; register Atom * atoms;
@ -104,10 +104,9 @@ 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, rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
SecurityWriteAccess); if (rc != Success)
if (!pWin) return rc;
return(BadWindow);
if (!stuff->nAtoms) if (!stuff->nAtoms)
return(Success); return(Success);
atoms = (Atom *) & stuff[1]; atoms = (Atom *) & stuff[1];
@ -117,7 +116,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);
@ -181,9 +180,7 @@ ProcChangeProperty(ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
char format, mode; char format, mode;
unsigned long len; unsigned long len;
int sizeInBytes; int sizeInBytes, totalSize, err;
int totalSize;
int err;
REQUEST(xChangePropertyReq); REQUEST(xChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xChangePropertyReq); REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
@ -208,10 +205,9 @@ ProcChangeProperty(ClientPtr client)
totalSize = len * sizeInBytes; totalSize = len * sizeInBytes;
REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, err = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
SecurityWriteAccess); if (err != Success)
if (!pWin) return err;
return(BadWindow);
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
@ -224,7 +220,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;
@ -445,19 +441,18 @@ int
ProcGetProperty(ClientPtr client) ProcGetProperty(ClientPtr client)
{ {
PropertyPtr pProp, prevProp; PropertyPtr pProp, prevProp;
unsigned long n, len, ind; unsigned long n, len, ind, rc;
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, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
if (!pWin) return rc;
return BadWindow;
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
@ -491,7 +486,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))
{ {
@ -585,16 +580,15 @@ ProcListProperties(ClientPtr client)
{ {
Atom *pAtoms = NULL, *temppAtoms; Atom *pAtoms = NULL, *temppAtoms;
xListPropertiesReply xlpr; xListPropertiesReply xlpr;
int numProps = 0; int rc, numProps = 0;
WindowPtr pWin; WindowPtr pWin;
PropertyPtr pProp; PropertyPtr pProp;
REQUEST(xResourceReq); REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, rc = dixLookupWindow(&pWin, stuff->id, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
if (!pWin) return rc;
return(BadWindow);
pProp = wUserProps (pWin); pProp = wUserProps (pWin);
while (pProp) while (pProp)
@ -636,10 +630,9 @@ ProcDeleteProperty(register ClientPtr client)
REQUEST_SIZE_MATCH(xDeletePropertyReq); REQUEST_SIZE_MATCH(xDeletePropertyReq);
UpdateCurrentTime(); UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, result = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
SecurityWriteAccess); if (result != Success)
if (!pWin) return result;
return(BadWindow);
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
@ -647,7 +640,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

@ -159,6 +159,14 @@ default state is platform and configuration specific.
disables DPMS (display power management services). The default state disables DPMS (display power management services). The default state
is platform and configuration specific. is platform and configuration specific.
.TP 8 .TP 8
.BI \-extension extensionName
disables named extension. If an unknown extension name is specified,
a list of accepted extension names is printed.
.TP 8
.BI \+extension extensionName
enables named extension. If an unknown extension name is specified,
a list of accepted extension names is printed.
.TP 8
.B \-f \fIvolume\fP .B \-f \fIvolume\fP
sets feep (bell) volume (allowable range: 0-100). sets feep (bell) volume (allowable range: 0-100).
.TP 8 .TP 8

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. */
@ -490,11 +490,9 @@ ProcAppleWMSetWindowLevel(
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (Success != dixLookupWindow(&pWin, stuff->window, client,
client, SecurityReadAccess))) DixReadAccess))
{
return BadValue; return BadValue;
}
if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) {
return BadValue; return BadValue;
@ -602,11 +600,9 @@ ProcAppleWMFrameDraw(
REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq); REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, if (Success != dixLookupWindow(&pWin, stuff->window, client,
client, SecurityReadAccess))) DixReadAccess))
{
return BadValue; return BadValue;
}
ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);

View File

@ -170,12 +170,13 @@ static int ProcPseudoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetStateReply rep; xPanoramiXGetStateReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -196,12 +197,13 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenCountReply rep; xPanoramiXGetScreenCountReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -222,12 +224,13 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep; xPanoramiXGetScreenSizeReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;

View File

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

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 (Success != dixLookupWindow(&pWin, win->info[i].id, client,
SecurityReadAccess))) DixReadAccess))
return -1; /* BadWindow */ return -1; /* BadWindow */
dmxForceWindowCreation(pWin); dmxForceWindowCreation(pWin);
@ -296,8 +296,8 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
} }
#endif #endif
if (!(pWin = SecurityLookupWindow(stuff->window, client, if (Success != dixLookupWindow(&pWin, 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 (Success != dixLookupWindow(&pWin, 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 (Success != dixLookupWindow(&pWin, window, client, DixReadAccess))
return -1; /* BadWindow */ return -1; /* BadWindow */
dmxGetWindowAttributes(pWin, &attr); dmxGetWindowAttributes(pWin, &attr);

View File

@ -1056,6 +1056,116 @@ static Bool dmxCompareScreens(DMXScreenInfo *new, DMXScreenInfo *old)
return TRUE; return TRUE;
} }
#ifdef RENDER
/** Restore Render's picture */
static void dmxBERestoreRenderPict(pointer value, XID id, pointer n)
{
PicturePtr pPicture = value; /* The picture */
DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */
int scrnNum = (int)n;
if (pDraw->pScreen->myNum != scrnNum) {
/* Picture not on the screen we are restoring*/
return;
}
if (pDraw->type == DRAWABLE_PIXMAP) {
PixmapPtr pPixmap = (PixmapPtr)pDraw;
/* Create and restore the pixmap drawable */
dmxBECreatePixmap(pPixmap);
dmxBERestorePixmap(pPixmap);
}
dmxBECreatePicture(pPicture);
}
/** Restore Render's glyphs */
static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n)
{
GlyphSetPtr glyphSet = value;
int scrnNum = (int)n;
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum];
GlyphRefPtr table;
char *images;
Glyph *gids;
XGlyphInfo *glyphs;
char *pos;
int beret;
int len_images = 0;
int i;
int ctr;
if (glyphPriv->glyphSets[scrnNum]) {
/* Only restore glyphs on the screen we are attaching */
return;
}
/* First we must create the glyph set on the backend. */
if ((beret = dmxBECreateGlyphSet(scrnNum, glyphSet)) != Success) {
dmxLog(dmxWarning,
"\tdmxBERestoreRenderGlyph failed to create glyphset!\n");
return;
}
/* Now for the complex part, restore the glyph data */
table = glyphSet->hash.table;
/* We need to know how much memory to allocate for this part */
for (i = 0; i < glyphSet->hash.hashSet->size; i++) {
GlyphRefPtr gr = &table[i];
GlyphPtr gl = gr->glyph;
if (!gl || gl == DeletedGlyph) continue;
len_images += gl->size - sizeof(gl->info);
}
/* Now allocate the memory we need */
images = ALLOCATE_LOCAL(len_images*sizeof(char));
gids = ALLOCATE_LOCAL(glyphSet->hash.tableEntries*sizeof(Glyph));
glyphs = ALLOCATE_LOCAL(glyphSet->hash.tableEntries*sizeof(XGlyphInfo));
memset(images, 0, len_images * sizeof(char));
pos = images;
ctr = 0;
/* Fill the allocated memory with the proper data */
for (i = 0; i < glyphSet->hash.hashSet->size; i++) {
GlyphRefPtr gr = &table[i];
GlyphPtr gl = gr->glyph;
if (!gl || gl == DeletedGlyph) continue;
/* First lets put the data into gids */
gids[ctr] = gr->signature;
/* Next do the glyphs data structures */
glyphs[ctr].width = gl->info.width;
glyphs[ctr].height = gl->info.height;
glyphs[ctr].x = gl->info.x;
glyphs[ctr].y = gl->info.y;
glyphs[ctr].xOff = gl->info.xOff;
glyphs[ctr].yOff = gl->info.yOff;
/* Copy the images from the DIX's data into the buffer */
memcpy(pos, gl+1, gl->size - sizeof(gl->info));
pos += gl->size - sizeof(gl->info);
ctr++;
}
/* Now restore the glyph data */
XRenderAddGlyphs(dmxScreen->beDisplay, glyphPriv->glyphSets[scrnNum],
gids,glyphs, glyphSet->hash.tableEntries, images,
len_images);
/* Clean up */
DEALLOCATE_LOCAL(len_images);
DEALLOCATE_LOCAL(gids);
DEALLOCATE_LOCAL(glyphs);
}
#endif
/** Reattach previously detached back-end screen. */ /** Reattach previously detached back-end screen. */
int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
{ {
@ -1174,6 +1284,20 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
/* Create window hierarchy (top down) */ /* Create window hierarchy (top down) */
dmxBECreateWindowTree(idx); dmxBECreateWindowTree(idx);
#ifdef RENDER
/* Restore the picture state for RENDER */
for (i = currentMaxClients; --i >= 0; )
if (clients[i])
FindClientResourcesByType(clients[i],PictureType,
dmxBERestoreRenderPict,(pointer)idx);
/* Restore the glyph state for RENDER */
for (i = currentMaxClients; --i >= 0; )
if (clients[i])
FindClientResourcesByType(clients[i],GlyphSetType,
dmxBERestoreRenderGlyph,(pointer)idx);
#endif
/* Refresh screen by generating exposure events for all windows */ /* Refresh screen by generating exposure events for all windows */
dmxForceExposures(idx); dmxForceExposures(idx);
@ -1362,8 +1486,15 @@ static void dmxBEDestroyResources(pointer value, XID id, RESTYPE type,
#ifdef RENDER #ifdef RENDER
} else if ((type & TypeMask) == (PictureType & TypeMask)) { } else if ((type & TypeMask) == (PictureType & TypeMask)) {
PicturePtr pPict = value; PicturePtr pPict = value;
if (pPict->pDrawable->pScreen->myNum == scrnNum) if (pPict->pDrawable->pScreen->myNum == scrnNum) {
/* Free the pixmaps on the backend if needed */
if (pPict->pDrawable->type == DRAWABLE_PIXMAP) {
PixmapPtr pPixmap = (PixmapPtr)(pPict->pDrawable);
dmxBESavePixmap(pPixmap);
dmxBEFreePixmap(pPixmap);
}
dmxBEFreePicture((PicturePtr)value); dmxBEFreePicture((PicturePtr)value);
}
} else if ((type & TypeMask) == (GlyphSetType & TypeMask)) { } else if ((type & TypeMask) == (GlyphSetType & TypeMask)) {
dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr)value); dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr)value);
#endif #endif

View File

@ -624,7 +624,7 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
} }
/* Make sure that the command-line arguments are sane. */ /* Make sure that the command-line arguments are sane. */
if (dmxAddRemoveScreens && (!noRenderExtension || dmxGLXProxy)) { if (dmxAddRemoveScreens && dmxGLXProxy) {
/* Currently it is not possible to support GLX and Render /* Currently it is not possible to support GLX and Render
* extensions with dynamic screen addition/removal due to the * extensions with dynamic screen addition/removal due to the
* state that each extension keeps, which cannot be restored. */ * state that each extension keeps, which cannot be restored. */

View File

@ -223,6 +223,36 @@ Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet)
return FALSE; return FALSE;
} }
/** Create \a glyphSet on the backend screen number \a idx. */
int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet)
{
XRenderPictFormat *pFormat;
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
PictFormatPtr pFmt = glyphSet->format;
int (*oldErrorHandler)(Display *, XErrorEvent *);
pFormat = dmxFindFormat(dmxScreen, pFmt);
if (!pFormat) {
return BadMatch;
}
dmxGlyphLastError = 0;
oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler);
/* Catch when this fails */
glyphPriv->glyphSets[idx]
= XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat);
XSetErrorHandler(oldErrorHandler);
if (dmxGlyphLastError) {
return dmxGlyphLastError;
}
return Success;
}
/** Create a Glyph Set on each screen. Save the glyphset ID from each /** Create a Glyph Set on each screen. Save the glyphset ID from each
* screen in the Glyph Set's private structure. Fail if the format * screen in the Glyph Set's private structure. Fail if the format
* requested is not available or if the Glyph Set cannot be created on * requested is not available or if the Glyph Set cannot be created on
@ -235,40 +265,32 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
ret = dmxSaveRenderVector[stuff->renderReqType](client); ret = dmxSaveRenderVector[stuff->renderReqType](client);
if (ret == Success) { if (ret == Success) {
int (*oldErrorHandler)(Display *, XErrorEvent *);
GlyphSetPtr glyphSet; GlyphSetPtr glyphSet;
dmxGlyphPrivPtr glyphPriv; dmxGlyphPrivPtr glyphPriv;
int i; int i;
PictFormatPtr pFmt;
XRenderPictFormat *pFormat;
/* Look up glyphSet that was just created ???? */ /* Look up glyphSet that was just created ???? */
/* Store glyphsets from backends in glyphSet->devPrivate ????? */ /* Store glyphsets from backends in glyphSet->devPrivate ????? */
/* 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;
MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc); MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc);
DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv); DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv);
pFmt = SecurityLookupIDByType(client, stuff->format, PictFormatType,
SecurityReadAccess);
oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler);
for (i = 0; i < dmxNumScreens; i++) { for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i]; DMXScreenInfo *dmxScreen = &dmxScreens[i];
int beret;
if (!dmxScreen->beDisplay) { if (!dmxScreen->beDisplay) {
glyphPriv->glyphSets[i] = 0; glyphPriv->glyphSets[i] = 0;
continue; continue;
} }
pFormat = dmxFindFormat(dmxScreen, pFmt); if ((beret = dmxBECreateGlyphSet(i, glyphSet)) != Success) {
if (!pFormat) {
int j; int j;
/* Free the glyph sets we've allocated thus far */ /* Free the glyph sets we've allocated thus far */
@ -278,30 +300,9 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
/* Free the resource created by render */ /* Free the resource created by render */
FreeResource(stuff->gsid, RT_NONE); FreeResource(stuff->gsid, RT_NONE);
ret = BadMatch; return beret;
break;
}
/* Catch when this fails */
glyphPriv->glyphSets[i]
= XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat);
if (dmxGlyphLastError) {
int j;
/* Free the glyph sets we've allocated thus far */
for (j = 0; j < i; j++)
dmxBEFreeGlyphSet(screenInfo.screens[j], glyphSet);
/* Free the resource created by render */
FreeResource(stuff->gsid, RT_NONE);
ret = dmxGlyphLastError;
break;
} }
} }
XSetErrorHandler(oldErrorHandler);
} }
return ret; return ret;
@ -315,7 +316,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 +359,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 +402,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 +474,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 +497,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 +548,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 +559,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 +623,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 +664,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
@ -753,6 +754,20 @@ void dmxCreatePictureList(WindowPtr pWindow)
} }
} }
/** Create \a pPicture on the backend. */
int dmxBECreatePicture(PicturePtr pPicture)
{
dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
/* Create picutre on BE */
pPictPriv->pict = dmxDoCreatePicture(pPicture);
/* Flush changes to the backend server */
dmxValidatePicture(pPicture, (1 << (CPLastBit+1)) - 1);
return Success;
}
/** Create a picture. This function handles the CreatePicture /** Create a picture. This function handles the CreatePicture
* unwrapping/wrapping and calls dmxDoCreatePicture to actually create * unwrapping/wrapping and calls dmxDoCreatePicture to actually create
* the picture on the appropriate screen. */ * the picture on the appropriate screen. */
@ -853,7 +868,11 @@ int dmxChangePictureClip(PicturePtr pPicture, int clipType,
/* The clip has already been changed into a region by the mi /* The clip has already been changed into a region by the mi
* routine called above. * routine called above.
*/ */
if (pPicture->clientClip) { if (clipType == CT_NONE) {
/* Disable clipping, show all */
XFixesSetPictureClipRegion(dmxScreen->beDisplay,
pPictPriv->pict, 0, 0, None);
} else if (pPicture->clientClip) {
RegionPtr pClip = pPicture->clientClip; RegionPtr pClip = pPicture->clientClip;
BoxPtr pBox = REGION_RECTS(pClip); BoxPtr pBox = REGION_RECTS(pClip);
int nBox = REGION_NUM_RECTS(pClip); int nBox = REGION_NUM_RECTS(pClip);

View File

@ -112,7 +112,9 @@ extern void dmxTriFan(CARD8 op,
INT16 xSrc, INT16 ySrc, INT16 xSrc, INT16 ySrc,
int npoint, xPointFixed *points); int npoint, xPointFixed *points);
extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet); extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
extern int dmxBECreatePicture(PicturePtr pPicture);
extern Bool dmxBEFreePicture(PicturePtr pPicture); extern Bool dmxBEFreePicture(PicturePtr pPicture);
extern int dmxPictPrivateIndex; /**< Index for picture private data */ extern int dmxPictPrivateIndex; /**< Index for picture private data */

View File

@ -430,9 +430,10 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
DrawablePtr pDraw; DrawablePtr pDraw;
__GLXpixmap *pGlxPixmap = NULL; __GLXpixmap *pGlxPixmap = NULL;
__glXWindow *pGlxWindow = NULL; __glXWindow *pGlxWindow = NULL;
int rc;
pDraw = (DrawablePtr) LookupDrawable(req->drawable, client); rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixUnknownAccess);
if (!pDraw) { if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
__glXPixmapRes); __glXPixmapRes);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
@ -459,9 +460,10 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
DrawablePtr pDraw, pMember = NULL; DrawablePtr pDraw, pMember = NULL;
__GLXpixmap *pGlxPixmap = NULL; __GLXpixmap *pGlxPixmap = NULL;
__glXWindow *pGlxWindow = NULL; __glXWindow *pGlxWindow = NULL;
int rc;
pDraw = (DrawablePtr) LookupDrawable(req->drawable, client); rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixUnknownAccess);
if (!pDraw) { if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
__glXPixmapRes); __glXPixmapRes);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
@ -479,8 +481,9 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
} }
if (req->member != None) { if (req->member != None) {
pMember = (DrawablePtr) LookupDrawable(req->member, client); rc = dixLookupDrawable(&pMember, req->member, client, 0,
if (!pMember) { DixUnknownAccess);
if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member, pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member,
__glXPixmapRes); __glXPixmapRes);
if (pGlxPixmap) pMember = pGlxPixmap->pDraw; if (pGlxPixmap) pMember = pGlxPixmap->pDraw;
@ -734,7 +737,7 @@ static int MakeCurrent(__GLXclientState *cl,
#endif #endif
int from_screen = 0; int from_screen = 0;
int to_screen = 0; int to_screen = 0;
int s; int s, rc;
/* /*
** If one is None and the other isn't, it's a bad match. ** If one is None and the other isn't, it's a bad match.
@ -778,8 +781,8 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (drawId != None) { if (drawId != None) {
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
/* /*
** Drawable is an X Window. ** Drawable is an X Window.
@ -885,8 +888,8 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (readId != None && readId != drawId ) { if (readId != None && readId != drawId ) {
pReadDraw = (DrawablePtr) LookupDrawable(readId, client); rc = dixLookupDrawable(&pReadDraw, readId, client, 0,DixUnknownAccess);
if (pReadDraw) { if (rc == Success) {
if (pReadDraw->type == DRAWABLE_WINDOW) { if (pReadDraw->type == DRAWABLE_WINDOW) {
/* /*
** Drawable is an X Window. ** Drawable is an X Window.
@ -1105,13 +1108,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;
@ -1137,9 +1140,7 @@ static int MakeCurrent(__GLXclientState *cl,
} }
#ifdef PANORAMIX #ifdef PANORAMIX
else if (pXinDraw) { else if (pXinDraw) {
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id, dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
client,
SecurityReadAccess);
} }
#endif #endif
else if (pGlxWindow) { else if (pGlxWindow) {
@ -1195,9 +1196,8 @@ static int MakeCurrent(__GLXclientState *cl,
} }
#ifdef PANORAMIX #ifdef PANORAMIX
else if (pXinReadDraw) { else if (pXinReadDraw) {
pReadWin = (WindowPtr)SecurityLookupWindow(pXinReadDraw->info[s].id, dixLookupWindow(&pReadWin, pXinReadDraw->info[s].id, client,
client, DixReadAccess);
SecurityReadAccess);
} }
#endif #endif
else if (pGlxReadWindow) { else if (pGlxReadWindow) {
@ -1639,18 +1639,16 @@ static int CreateGLXPixmap(__GLXclientState *cl,
__GLXscreenInfo *pGlxScreen; __GLXscreenInfo *pGlxScreen;
__GLXvisualConfig *pGlxVisual; __GLXvisualConfig *pGlxVisual;
__GLXFBConfig *pFBConfig; __GLXFBConfig *pFBConfig;
int i; int i, s, rc;
int s;
int from_screen, to_screen; int from_screen, to_screen;
#ifdef PANORAMIX #ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL; PanoramiXRes *pXinDraw = NULL;
#endif #endif
pDraw = (DrawablePtr) LookupDrawable(pixmapId, client); rc = dixLookupDrawable(&pDraw, pixmapId, client, M_DRAWABLE_PIXMAP,
if (!pDraw || pDraw->type != DRAWABLE_PIXMAP) { DixUnknownAccess);
client->errorValue = pixmapId; if (rc != Success)
return BadPixmap; return rc;
}
/* /*
** Check if screen of visual matches screen of pixmap. ** Check if screen of visual matches screen of pixmap.
@ -1768,7 +1766,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
@ -1781,7 +1779,8 @@ static int CreateGLXPixmap(__GLXclientState *cl,
#ifdef PANORAMIX #ifdef PANORAMIX
if (pXinDraw) { if (pXinDraw) {
pRealDraw = (DrawablePtr) LookupDrawable(pXinDraw->info[s].id,client); dixLookupDrawable(&pRealDraw, pXinDraw->info[s].id, client, 0,
DixUnknownAccess);
} }
#endif #endif
@ -1947,14 +1946,13 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
__glXWindow *pGlxWindow = NULL; __glXWindow *pGlxWindow = NULL;
int from_screen = 0; int from_screen = 0;
int to_screen = 0; int to_screen = 0;
int s; int s, rc;
/* /*
** Check that the GLX drawable is valid. ** Check that the GLX drawable is valid.
*/ */
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
from_screen = to_screen = pDraw->pScreen->myNum; from_screen = to_screen = pDraw->pScreen->myNum;
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
@ -2014,7 +2012,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
@ -2058,9 +2056,7 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
} }
#ifdef PANORAMIX #ifdef PANORAMIX
else if (pXinDraw) { else if (pXinDraw) {
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[s].id, dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
client,
SecurityReadAccess);
} }
#endif #endif
else if (pGlxWindow) { else if (pGlxWindow) {
@ -2104,12 +2100,13 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
__GLXpixmap *pGlxPixmap = NULL; __GLXpixmap *pGlxPixmap = NULL;
__GLXcontext *glxc = NULL; __GLXcontext *glxc = NULL;
__glXWindow *pGlxWindow = NULL; __glXWindow *pGlxWindow = NULL;
int rc;
/* /*
** Check that the GLX drawable is valid. ** Check that the GLX drawable is valid.
*/ */
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
if (pDraw->type != DRAWABLE_WINDOW) { if (pDraw->type != DRAWABLE_WINDOW) {
/* /*
** Drawable is an X pixmap, which is not allowed. ** Drawable is an X pixmap, which is not allowed.
@ -2897,16 +2894,15 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
__GLXFBConfig *pGlxFBConfig = NULL; __GLXFBConfig *pGlxFBConfig = NULL;
VisualPtr pVisual; VisualPtr pVisual;
VisualID visId; VisualID visId;
int i; int i, rc;
/* /*
** Check if windowId is valid ** Check if windowId is valid
*/ */
pDraw = (DrawablePtr) LookupDrawable(windowId, client); rc = dixLookupDrawable(&pDraw, windowId, client, M_DRAWABLE_WINDOW,
if (!pDraw || pDraw->type != DRAWABLE_WINDOW) { DixUnknownAccess);
client->errorValue = windowId; if (rc != Success)
return BadWindow; return rc;
}
/* /*
** Check if screen of window matches screen of fbconfig. ** Check if screen of window matches screen of fbconfig.
@ -3069,7 +3065,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;
@ -3279,7 +3275,7 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
GLXDrawable be_drawable = 0; GLXDrawable be_drawable = 0;
DrawablePtr pDraw = NULL; DrawablePtr pDraw = NULL;
Display *dpy; Display *dpy;
int screen; int screen, rc;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
CARD32 *attribs = NULL; CARD32 *attribs = NULL;
int attribs_size; int attribs_size;
@ -3288,8 +3284,8 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#endif #endif
if (drawId != None) { if (drawId != None) {
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr)pDraw; WindowPtr pWin = (WindowPtr)pDraw;
be_drawable = 0; be_drawable = 0;
@ -3353,15 +3349,14 @@ 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;
} }
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id, dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
client, DixReadAccess);
SecurityReadAccess);
} }
#endif #endif
@ -3441,7 +3436,7 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
GLXDrawable be_drawable = 0; GLXDrawable be_drawable = 0;
DrawablePtr pDraw = NULL; DrawablePtr pDraw = NULL;
Display *dpy; Display *dpy;
int screen; int screen, rc;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
char *attrbuf; char *attrbuf;
#ifdef PANORAMIX #ifdef PANORAMIX
@ -3450,8 +3445,8 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#endif #endif
if (drawId != None) { if (drawId != None) {
pDraw = (DrawablePtr) LookupDrawable(drawId, client); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
if (pDraw) { if (rc == Success) {
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr)pDraw; WindowPtr pWin = (WindowPtr)pDraw;
be_drawable = 0; be_drawable = 0;
@ -3515,15 +3510,14 @@ 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;
} }
pWin = (WindowPtr)SecurityLookupWindow(pXinDraw->info[screen].id, dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
client, DixReadAccess);
SecurityReadAccess);
} }
#endif #endif

View File

@ -745,14 +745,11 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
cfsetispeed(&nTty, 9600); cfsetispeed(&nTty, 9600);
cfsetospeed(&nTty, 9600); cfsetospeed(&nTty, 9600);
tcsetattr(fd, TCSANOW, &nTty); tcsetattr(fd, TCSANOW, &nTty);
/* Our kernel cleverly ignores O_NONBLOCK. Sigh. */
#if 0
/* /*
* Flush any pending keystrokes * Flush any pending keystrokes
*/ */
while ((n = read (fd, buf, sizeof (buf))) > 0) while ((n = read (fd, buf, sizeof (buf))) > 0)
; ;
#endif
KdRegisterFd (fd, LinuxKeyboardRead, ki); KdRegisterFd (fd, LinuxKeyboardRead, ki);
return Success; return Success;
} }

View File

@ -75,10 +75,7 @@ TsRead (int fd, void *closure)
while (ts_read(private->tsDev, &event, 1) == 1) { while (ts_read(private->tsDev, &event, 1) == 1) {
if (event.pressure) { if (event.pressure) {
if (event.pressure > pi->dixdev->absolute->button_threshold) flags = KD_BUTTON_1;
flags = KD_BUTTON_8;
else
flags = KD_BUTTON_1;
/* /*
* Here we test for the touch screen driver actually being on the * Here we test for the touch screen driver actually being on the
@ -113,9 +110,8 @@ TsRead (int fd, void *closure)
static Status static Status
TslibEnable (KdPointerInfo *pi) TslibEnable (KdPointerInfo *pi)
{ {
struct TslibPrivate *private = pi->driverPrivate; struct TslibPrivate *private = pi->driverPrivate;
private->holdThumbEvents = 1;
private->raw_event_hook = NULL; private->raw_event_hook = NULL;
private->raw_event_closure = NULL; private->raw_event_closure = NULL;
private->tsDev = ts_open(pi->path, 0); private->tsDev = ts_open(pi->path, 0);
@ -126,9 +122,6 @@ TslibEnable (KdPointerInfo *pi)
close(private->fd); close(private->fd);
return BadAlloc; return BadAlloc;
} }
if (pi->dixdev && pi->dixdev->absolute &&
pi->dixdev->absolute->button_threshold == 0)
pi->dixdev->absolute->button_threshold = 115;
KdRegisterFd(private->fd, TsRead, pi); KdRegisterFd(private->fd, TsRead, pi);
@ -141,12 +134,12 @@ TslibDisable (KdPointerInfo *pi)
{ {
struct TslibPrivate *private = pi->driverPrivate; struct TslibPrivate *private = pi->driverPrivate;
if (private->fd) { if (private->fd)
KdUnregisterFd(pi, private->fd); KdUnregisterFd(pi, private->fd, TRUE);
close(private->fd);
}
if (private->tsDev) if (private->tsDev)
ts_close(private->tsDev); ts_close(private->tsDev);
private->fd = 0; private->fd = 0;
private->tsDev = NULL; private->tsDev = NULL;
} }
@ -156,7 +149,6 @@ static Status
TslibInit (KdPointerInfo *pi) TslibInit (KdPointerInfo *pi)
{ {
int fd = 0, i = 0; int fd = 0, i = 0;
char devpath[PATH_MAX], devname[TS_NAME_SIZE];
DIR *inputdir = NULL; DIR *inputdir = NULL;
struct dirent *inputent = NULL; struct dirent *inputent = NULL;
struct tsdev *tsDev = NULL; struct tsdev *tsDev = NULL;

View File

@ -286,10 +286,8 @@ mgaCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
if (pMaskPicture->componentAlpha) if (pMaskPicture->componentAlpha)
MGA_FALLBACK(("Component alpha unsupported")); MGA_FALLBACK(("Component alpha unsupported"));
switch (pDstPicture->format) { if (pDstPicture->format == PICT_a8)
case PICT_a8:
MGA_FALLBACK(("render to A8 unsupported")); MGA_FALLBACK(("render to A8 unsupported"));
}
return TRUE; return TRUE;
} }

View File

@ -21,6 +21,7 @@ Xvfb_LDFLAGS =
AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
-DNO_HW_ONLY_EXTS \ -DNO_HW_ONLY_EXTS \
-DNO_MODULE_EXTS \ -DNO_MODULE_EXTS \
-DXFree86Server \
$(XVFBMODULES_CFLAGS) \ $(XVFBMODULES_CFLAGS) \
$(DIX_CFLAGS) $(DIX_CFLAGS)

View File

@ -93,7 +93,6 @@ CPP_FILES_FLAGS = \
-DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \ -DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \
-DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \ -DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \
-DTRUETYPEFONTPATH="\"$(BASE_FONT_PATH)/TTF\"" \ -DTRUETYPEFONTPATH="\"$(BASE_FONT_PATH)/TTF\"" \
-DCIDFONTPATH="\"$(BASE_FONT_PATH)/CID\"" \
-DDPI75FONTPATH="\"$(BASE_FONT_PATH)/75dpi\"" \ -DDPI75FONTPATH="\"$(BASE_FONT_PATH)/75dpi\"" \
-DDPI100FONTPATH="\"$(BASE_FONT_PATH)/100dpi\"" \ -DDPI100FONTPATH="\"$(BASE_FONT_PATH)/100dpi\"" \
-DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\" -DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\"

View File

@ -789,8 +789,6 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
xEvent ke; xEvent ke;
int i = 0, j = 0, nevents = 0; int i = 0, j = 0, nevents = 0;
ErrorF("releasekeys: called on device %s (%d)\n", pDev->name, pDev->id);
if (!pDev || !pDev->key) if (!pDev || !pDev->key)
return; return;

View File

@ -1119,9 +1119,6 @@ ddxGiveUp()
DGAShutdown(); DGAShutdown();
#endif #endif
while (xf86NumScreens)
xf86DeleteScreen(xf86NumScreens - 1, 0);
xf86CloseConsole(); xf86CloseConsole();
xf86CloseLog(); xf86CloseLog();

View File

@ -99,16 +99,6 @@
#include "mi.h" #include "mi.h"
/******************************************************************************
* debugging macro
*****************************************************************************/
#ifdef DEBUG
static int debug_level = 0;
#define DBG(lvl, f) {if ((lvl) <= debug_level) f;}
#else
#define DBG(lvl, f)
#endif
xEvent *xf86Events = NULL; xEvent *xf86Events = NULL;
static Bool static Bool
@ -154,33 +144,6 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
} }
} }
void
xf86AlwaysCoreControl(DeviceIntPtr pDev, IntegerCtrl *control)
{
}
/***********************************************************************
*
* xf86XinputFinalizeInit --
*
* Create and initialize an integer feedback to control the always
* core feature.
*
***********************************************************************
*/
void
xf86XinputFinalizeInit(DeviceIntPtr dev)
{
LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
if (InitIntegerFeedbackClassDeviceStruct(dev, xf86AlwaysCoreControl) == FALSE) {
ErrorF("Unable to init integer feedback for always core feature\n");
} else {
local->always_core_feedback = dev->intfeed;
dev->intfeed->ctrl.integer_displayed = (local->flags & XI86_ALWAYS_CORE) ? 1 : 0;
}
}
/*********************************************************************** /***********************************************************************
* *
* xf86ActivateDevice -- * xf86ActivateDevice --
@ -207,8 +170,6 @@ xf86ActivateDevice(LocalDevicePtr local)
dev->public.devicePrivate = (pointer) local; dev->public.devicePrivate = (pointer) local;
local->dev = dev; local->dev = dev;
xf86XinputFinalizeInit(dev);
dev->coreEvents = local->flags & XI86_ALWAYS_CORE; dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
dev->isMPDev = (local->flags & XI86_MP_DEVICE); dev->isMPDev = (local->flags & XI86_MP_DEVICE);
InitSprite(dev, dev->isMPDev); InitSprite(dev, dev->isMPDev);
@ -451,8 +412,10 @@ xf86PostMotionEvent(DeviceIntPtr device,
{ {
va_list var; va_list var;
int i = 0, nevents = 0; int i = 0, nevents = 0;
Bool drag = xf86SendDragEvents(device);
int *valuators = NULL; int *valuators = NULL;
int flags = 0; int flags = 0;
xEvent *xE = NULL;
if (is_absolute) if (is_absolute)
flags = POINTER_ABSOLUTE; flags = POINTER_ABSOLUTE;
@ -475,8 +438,14 @@ xf86PostMotionEvent(DeviceIntPtr device,
flags, first_valuator, num_valuators, flags, first_valuator, num_valuators,
valuators); valuators);
for (i = 0; i < nevents; i++) for (i = 0; i < nevents; i++) {
mieqEnqueue(device, xf86Events + i); xE = xf86Events + i;
/* Don't post core motion events for devices not registered to send
* drag events. */
if (xE->u.u.type != MotionNotify || drag) {
mieqEnqueue(device, xf86Events + i);
}
}
xfree(valuators); xfree(valuators);
} }

View File

@ -32,9 +32,6 @@
#include "propertyst.h" #include "propertyst.h"
#include "xf86DDC.h" #include "xf86DDC.h"
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA" #define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA" #define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"

View File

@ -304,16 +304,18 @@ get_detailed_timing_section(Uchar *c, struct detailed_timings *r)
r->misc = MISC; r->misc = MISC;
} }
#define MAX_EDID_MINOR 3
static Bool static Bool
validate_version(int scrnIndex, struct edid_version *r) validate_version(int scrnIndex, struct edid_version *r)
{ {
if (r->version != 1) if (r->version != 1)
return FALSE; return FALSE;
if (r->revision > 3) {
xf86DrvMsg(scrnIndex, X_ERROR,"EDID Version 1.%i not yet supported\n", if (r->revision > MAX_EDID_MINOR)
r->revision); xf86DrvMsg(scrnIndex, X_WARNING,
return FALSE; "Assuming version 1.%d is compatible with 1.%d\n",
} r->revision, MAX_EDID_MINOR);
return TRUE; return TRUE;
} }

View File

@ -57,9 +57,6 @@ static XF86ModuleVersionInfo VersRec =
_X_EXPORT XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL }; _X_EXPORT XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL };
extern void Type1RegisterFontFileFunctions(void); extern void Type1RegisterFontFileFunctions(void);
#ifdef BUILDCID
extern void CIDRegisterFontFileFunctions(void);
#endif
FontModule type1Module = { FontModule type1Module = {
Type1RegisterFontFileFunctions, Type1RegisterFontFileFunctions,
@ -67,23 +64,11 @@ FontModule type1Module = {
NULL NULL
}; };
#ifdef BUILDCID
FontModule CIDModule = {
CIDRegisterFontFileFunctions,
"CID",
NULL
};
#endif
static pointer static pointer
type1Setup(pointer module, pointer opts, int *errmaj, int *errmin) type1Setup(pointer module, pointer opts, int *errmaj, int *errmin)
{ {
type1Module.module = module; type1Module.module = module;
LoadFont(&type1Module); LoadFont(&type1Module);
#ifdef BUILDCID
CIDModule.module = module;
LoadFont(&CIDModule);
#endif
/* Need a non-NULL return */ /* Need a non-NULL return */
return (pointer)1; return (pointer)1;

View File

@ -1,7 +1,7 @@
.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $ .\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
.TH __xservername__ __appmansuffix__ __vendorversion__ .TH __xservername__ __appmansuffix__ __vendorversion__
.SH NAME .SH NAME
__xservername__ - X11R6 X server __xservername__ - X11R7 X server
.SH SYNOPSIS .SH SYNOPSIS
.B __xservername__ .B __xservername__
.RI [\fB:\fP display ] .RI [\fB:\fP display ]
@ -13,30 +13,26 @@ is a full featured X server that was originally designed for UNIX and
UNIX-like operating systems running on Intel x86 hardware. It now runs UNIX-like operating systems running on Intel x86 hardware. It now runs
on a wider range of hardware and OS platforms. on a wider range of hardware and OS platforms.
.PP .PP
This work was derived from This work was derived by the X.Org Foundation from the XFree86 Project's
.I "XFree86\ 4.4rc2" .I "XFree86\ 4.4rc2"
by the X.Org Foundation. release.
The XFree86 4.4rc2 release was originally derived from The XFree86 release was originally derived from
.I "X386\ 1.2" .I "X386\ 1.2"
by Thomas Roell which was contributed to X11R5 by Snitily Graphics by Thomas Roell which was contributed to X11R5 by Snitily Graphics
Consulting Service. The Consulting Service.
.B __xservername__
server architecture includes
among many other things a loadable module system derived from code
donated by Metro Link, Inc. The current __xservername__ release is compatible
with X11R6.6.
.SH PLATFORMS .SH PLATFORMS
.PP .PP
.B __xservername__ .B __xservername__
operates under a wide range of operating systems and hardware platforms. operates under a wide range of operating systems and hardware platforms.
The Intel x86 (IA32) architecture is the most widely supported hardware The Intel x86 (IA32) architecture is the most widely supported hardware
platform. Other hardware platforms include Compaq Alpha, Intel IA64, platform. Other hardware platforms include Compaq Alpha, Intel IA64, AMD64,
SPARC and PowerPC. The most widely supported operating systems are the SPARC and PowerPC. The most widely supported operating systems are the
free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD and free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD,
OpenBSD. Commercial UNIX operating systems such as Solaris (x86) and OpenBSD, and Solaris. Commercial UNIX operating systems such as
UnixWare are also supported. Other supported operating systems include UnixWare are also supported. Other supported operating systems include
LynxOS, and GNU Hurd. Darwin and Mac OS X are supported with the LynxOS, and GNU Hurd. Darwin and Mac OS X are supported with the
XDarwin(1) X server. Win32/Cygwin is supported with the XWin X server. XDarwin(__appmansuffix__) X server. Win32/Cygwin is supported with the
XWin(__appmansuffix__) X server.
.PP .PP
.SH "NETWORK CONNECTIONS" .SH "NETWORK CONNECTIONS"
.B __xservername__ .B __xservername__
@ -119,13 +115,14 @@ one way, the highest precedence mechanism is used. The list of mechanisms
is ordered from highest precedence to lowest. Note that not all parameters is ordered from highest precedence to lowest. Note that not all parameters
can be supplied via all methods. The available command line options can be supplied via all methods. The available command line options
and environment variables (and some defaults) are described here and in and environment variables (and some defaults) are described here and in
the Xserver(1) manual page. Most configuration file parameters, with the Xserver(__appmansuffix__) manual page. Most configuration file
their defaults, are described in the __xconfigfile__(__filemansuffix__) manual parameters, with their defaults, are described in the
page. Driver and module specific configuration parameters are described __xconfigfile__(__filemansuffix__) manual page. Driver and module specific
in the relevant driver or module manual page. configuration parameters are described in the relevant driver or module
manual page.
.PP .PP
In addition to the normal server options described in the Xserver(1) In addition to the normal server options described in the
manual page, Xserver(__appmansuffix__) manual page,
.B __xservername__ .B __xservername__
accepts the following command line switches: accepts the following command line switches:
.TP 8 .TP 8
@ -385,7 +382,8 @@ options.
When this option is specified, the When this option is specified, the
.B __xservername__ .B __xservername__
server scans the PCI bus, and prints out some information about each server scans the PCI bus, and prints out some information about each
device that was detected. See also scanpci(1) and pcitweak(1). device that was detected. See also scanpci(__appmansuffix__)
and pcitweak(__appmansuffix__).
.TP 8 .TP 8
.BI \-screen " screen-name" .BI \-screen " screen-name"
Use the __xconfigfile__(__filemansuffix__) file Use the __xconfigfile__(__filemansuffix__) file
@ -508,13 +506,12 @@ for its initial setup.
Refer to the __xconfigfile__(__filemansuffix__) manual page for information Refer to the __xconfigfile__(__filemansuffix__) manual page for information
about the format of this file. about the format of this file.
.PP .PP
Starting with version 4.4,
.B __xservername__ .B __xservername__
has a mechanism for automatically generating a built-in configuration has a mechanism for automatically generating a built-in configuration
at run-time when no at run-time when no
.B __xconfigfile__ .B __xconfigfile__
file is present. The current version of this automatic configuration file is present. The current version of this automatic configuration
mechanism works in three ways. mechanism works in two ways.
.PP .PP
The first is via enhancements that have made many components of the The first is via enhancements that have made many components of the
.B __xconfigfile__ .B __xconfigfile__
@ -523,14 +520,7 @@ reasonably deduced doesn't need to be specified explicitly, greatly
reducing the amount of built-in configuration information that needs to reducing the amount of built-in configuration information that needs to
be generated at run-time. be generated at run-time.
.PP .PP
The second is to use an external utility called getconfig(1), when The second is to have "safe" fallbacks for most configuration information.
available, to use meta-configuration information to generate a suitable
configuration for the primary video device. The meta-configuration
information can be updated to allow an existing installation to get the
best out of new hardware or to work around bugs that are found
post-release.
.PP
The third is to have "safe" fallbacks for most configuration information.
This maximises the likelihood that the This maximises the likelihood that the
.B __xservername__ .B __xservername__
server will start up in some usable configuration even when information server will start up in some usable configuration even when information
@ -586,7 +576,7 @@ Client error message database.
.B __projectroot__/lib/X11/app-defaults/\(** .B __projectroot__/lib/X11/app-defaults/\(**
Client resource specifications. Client resource specifications.
.TP 30 .TP 30
.B __projectroot__/man/man?/\(** .B __mandir__/man?/\(**
Manual pages. Manual pages.
.TP 30 .TP 30
.BI /etc/X n .hosts .BI /etc/X n .hosts
@ -644,7 +634,7 @@ __xservername__ was originally based on XFree86 4.4rc2.
That was originally based on \fIX386 1.2\fP by Thomas Roell, which That was originally based on \fIX386 1.2\fP by Thomas Roell, which
was contributed to the then X Consortium's X11R5 distribution by SGCS. was contributed to the then X Consortium's X11R5 distribution by SGCS.
.PP .PP
__xservername__ is released by the X.org Foundation. __xservername__ is released by the X.Org Foundation.
.PP .PP
The project that became XFree86 was originally founded in 1992 by The project that became XFree86 was originally founded in 1992 by
David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat. David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat.
@ -685,9 +675,9 @@ Orest Zborowski \fIorestz@eskimo.com\fP
.RE .RE
.PP .PP
__xservername__ source is available from the FTP server __xservername__ source is available from the FTP server
\fI<ftp://ftp.x.org/>\fP, and from the X.org \fI<ftp://ftp.x.org/>\fP, and from the X.Org
server \fI<http://www.freedesktop.org/cvs/>\fP. Documentation and other server \fI<http://gitweb.freedesktop.org/>\fP. Documentation and other
information can be found from the X.org web site information can be found from the X.Org web site
\fI<http://www.x.org/>\fP. \fI<http://www.x.org/>\fP.
.SH LEGAL .SH LEGAL

View File

@ -311,7 +311,6 @@ font path elements:
.I __projectroot__/lib/X11/fonts/misc/ .I __projectroot__/lib/X11/fonts/misc/
.I __projectroot__/lib/X11/fonts/TTF/ .I __projectroot__/lib/X11/fonts/TTF/
.I __projectroot__/lib/X11/fonts/Type1/ .I __projectroot__/lib/X11/fonts/Type1/
.I __projectroot__/lib/X11/fonts/CID/
.I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/75dpi/
.I __projectroot__/lib/X11/fonts/100dpi/ .I __projectroot__/lib/X11/fonts/100dpi/
.fi .fi
@ -326,7 +325,6 @@ The recommended font path contains the following font path elements:
.I __projectroot__/lib/X11/fonts/75dpi/:unscaled .I __projectroot__/lib/X11/fonts/75dpi/:unscaled
.I __projectroot__/lib/X11/fonts/100dpi/:unscaled .I __projectroot__/lib/X11/fonts/100dpi/:unscaled
.I __projectroot__/lib/X11/fonts/Type1/ .I __projectroot__/lib/X11/fonts/Type1/
.I __projectroot__/lib/X11/fonts/CID/
.I __projectroot__/lib/X11/fonts/Speedo/ .I __projectroot__/lib/X11/fonts/Speedo/
.I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/75dpi/
.I __projectroot__/lib/X11/fonts/100dpi/ .I __projectroot__/lib/X11/fonts/100dpi/

View File

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

View File

@ -98,7 +98,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
pvp = xf86GetPciInfoForEntity(entityIndex); pvp = xf86GetPciInfoForEntity(entityIndex);
if (pvp) pInt->Tag = ((pciConfigPtr)(pvp->thisCard))->tag; if (pvp) pInt->Tag = pciTag(pvp->bus, pvp->device, pvp->func);
/* /*
* we need to map video RAM MMIO as some chipsets map mmio * we need to map video RAM MMIO as some chipsets map mmio

View File

@ -155,17 +155,21 @@ _X_HIDDEN void *dixLookupTab[] = {
SYMFUNC(CompareTimeStamps) SYMFUNC(CompareTimeStamps)
SYMFUNC(CopyISOLatin1Lowered) SYMFUNC(CopyISOLatin1Lowered)
SYMFUNC(DeleteCallback) SYMFUNC(DeleteCallback)
SYMFUNC(dixLookupDrawable)
SYMFUNC(dixLookupWindow)
SYMFUNC(dixLookupClient)
SYMFUNC(dixLookupGC)
/* following are deprecated */
SYMFUNC(LookupClient) SYMFUNC(LookupClient)
SYMFUNC(LookupDrawable) SYMFUNC(LookupDrawable)
SYMFUNC(LookupWindow) SYMFUNC(LookupWindow)
SYMFUNC(SecurityLookupDrawable)
SYMFUNC(SecurityLookupWindow)
/* end deprecated */
SYMFUNC(NoopDDA) SYMFUNC(NoopDDA)
SYMFUNC(QueueWorkProc) SYMFUNC(QueueWorkProc)
SYMFUNC(RegisterBlockAndWakeupHandlers) SYMFUNC(RegisterBlockAndWakeupHandlers)
SYMFUNC(RemoveBlockAndWakeupHandlers) SYMFUNC(RemoveBlockAndWakeupHandlers)
#ifdef XACE
SYMFUNC(SecurityLookupDrawable)
SYMFUNC(SecurityLookupWindow)
#endif
/* events.c */ /* events.c */
SYMFUNC(CheckCursorConfinement) SYMFUNC(CheckCursorConfinement)
SYMFUNC(DeliverEvents) SYMFUNC(DeliverEvents)

View File

@ -90,6 +90,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
legacyVGARec vga; legacyVGARec vga;
xf86int10BiosLocation bios; xf86int10BiosLocation bios;
Bool videoBiosMapped = FALSE; Bool videoBiosMapped = FALSE;
pciVideoPtr pvp;
if (int10Generation != serverGeneration) { if (int10Generation != serverGeneration) {
counter = 0; counter = 0;
@ -151,6 +152,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec)); pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
pInt->scrnIndex = screen; pInt->scrnIndex = screen;
pInt->entityIndex = entityIndex; pInt->entityIndex = entityIndex;
pvp = xf86GetPciInfoForEntity(entityIndex);
if (pvp) pInt->Tag = pciTag(pvp->bus, pvp->device, pvp->func);
if (!xf86Int10ExecSetup(pInt)) if (!xf86Int10ExecSetup(pInt))
goto error0; goto error0;
pInt->mem = &linuxMem; pInt->mem = &linuxMem;

View File

@ -11,7 +11,7 @@
# This file can be distributed under either the GNU General Public License # This file can be distributed under either the GNU General Public License
# (version 2 or higher) or the 3-clause BSD License. # (version 2 or higher) or the 3-clause BSD License.
# #
# Daily snapshot on Tue 2006-10-03 01:05:01 # Daily snapshot on Wed 2006-12-06 02:05:02
# #
# Vendors, devices and subsystems. Please keep sorted. # Vendors, devices and subsystems. Please keep sorted.
@ -3012,20 +3012,22 @@
2200 QLA2200 64-bit Fibre Channel Adapter 2200 QLA2200 64-bit Fibre Channel Adapter
1077 0002 QLA2200 1077 0002 QLA2200
2300 QLA2300 64-bit Fibre Channel Adapter 2300 QLA2300 64-bit Fibre Channel Adapter
2312 QLA2312 Fibre Channel Adapter 2312 ISP2312-based 2Gb Fibre Channel to PCI-X HBA
103c 0131 2Gb Fibre Channel - Single port [A7538A] 103c 0131 2Gb Fibre Channel - Single port [A7538A]
103c 12ba 2Gb Fibre Channel - Dual port [A6826A] 103c 12ba 2Gb Fibre Channel - Dual port [A6826A]
2322 QLA2322 Fibre Channel Adapter 2322 ISP2322-based 2Gb Fibre Channel to PCI-X HBA
2422 QLA2422 Fibre Channel Adapter 2422 ISP2422-based 4Gb Fibre Channel to PCI-X HBA
103c 12d7 4Gb Fibre Channel [AB379A] 103c 12d7 4Gb Fibre Channel [AB379A]
103c 12dd 4Gb Fibre Channel [AB429A] 103c 12dd 4Gb Fibre Channel [AB429A]
2432 QLA2432 Fibre Channel Adapter 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA
3010 QLA3010 Network Adapter 3022 ISP4022-based Ethernet NIC
3022 QLA3022 Network Adapter 3032 ISP4032-based Ethernet NIC
4010 QLA4010 iSCSI TOE Adapter 4010 ISP4010-based iSCSI TOE HBA
4022 QLA4022 iSCSI TOE Adapter 4022 ISP4022-based iSCSI TOE HBA
6312 QLA6312 Fibre Channel Adapter 4032 ISP4032-based iSCSI TOE IPv6 HBA
6322 QLA6322 Fibre Channel Adapter 5432 SP232-based 4Gb Fibre Channel to PCI Express HBA
6312 SP202-based 2Gb Fibre Channel to PCI-X HBA
6322 SP212-based 2Gb Fibre Channel to PCI-X HBA
1078 Cyrix Corporation 1078 Cyrix Corporation
0000 5510 [Grappa] 0000 5510 [Grappa]
0001 PCI Master 0001 PCI Master
@ -10565,7 +10567,9 @@
16be 1040 V.9X DSP Data Fax Modem 16be 1040 V.9X DSP Data Fax Modem
1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
8086 2522 Samsung P30 integrated WLAN
8086 2527 MIM2000/Centrino 8086 2527 MIM2000/Centrino
8086 2581 Toshiba Satellite M10
1048 PRO/10GbE LR Server Adapter 1048 PRO/10GbE LR Server Adapter
8086 a01f PRO/10GbE LR Server Adapter 8086 a01f PRO/10GbE LR Server Adapter
8086 a11f PRO/10GbE LR Server Adapter 8086 a11f PRO/10GbE LR Server Adapter
@ -10583,6 +10587,10 @@
1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller 1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller
1052 PRO/100 VM Network Connection 1052 PRO/100 VM Network Connection
1053 PRO/100 VM Network Connection 1053 PRO/100 VM Network Connection
1054 PRO/100 VE Network Connection
1055 PRO/100 VM Network Connection
1056 PRO/100 VE Network Connection
1057 PRO/100 VE Network Connection
1059 82551QM Ethernet Controller 1059 82551QM Ethernet Controller
105b 82546GB Gigabit Ethernet Controller (Copper) 105b 82546GB Gigabit Ethernet Controller (Copper)
105e 82571EB Gigabit Ethernet Controller 105e 82571EB Gigabit Ethernet Controller
@ -10673,19 +10681,30 @@
108c 82573E Gigabit Ethernet Controller (Copper) 108c 82573E Gigabit Ethernet Controller (Copper)
108e 82573E KCS (Active Management) 108e 82573E KCS (Active Management)
108f Active Management Technology - SOL 108f Active Management Technology - SOL
1091 PRO/100 VM Network Connection
1092 PRO/100 VE Network Connection 1092 PRO/100 VE Network Connection
1093 PRO/100 VM Network Connection
1094 PRO/100 VE Network Connection
1095 PRO/100 VE Network Connection
1096 80003ES2LAN Gigabit Ethernet Controller (Copper) 1096 80003ES2LAN Gigabit Ethernet Controller (Copper)
1097 631xESB/632xESB DPT LAN Controller (Fiber) 1097 631xESB/632xESB DPT LAN Controller (Fiber)
1098 80003ES2LAN Gigabit Ethernet Controller (Serdes) 1098 80003ES2LAN Gigabit Ethernet Controller (Serdes)
1099 82546GB Gigabit Ethernet Controller (Copper) 1099 82546GB Gigabit Ethernet Controller (Copper)
8086 1099 PRO/1000 GT Quad Port Server Adapter 8086 1099 PRO/1000 GT Quad Port Server Adapter
109a 82573L Gigabit Ethernet Controller 109a 82573L Gigabit Ethernet Controller
1179 ff10 PRO/1000 PL
17aa 2001 ThinkPad T60 17aa 2001 ThinkPad T60
17aa 207e Thinkpad X60s 17aa 207e Thinkpad X60s
8086 109a PRO/1000 PL Network Connection 8086 109a PRO/1000 PL Network Connection
109b 82546GB PRO/1000 GF Quad Port Server Adapter 109b 82546GB PRO/1000 GF Quad Port Server Adapter
109e 82597EX 10GbE Ethernet Controller
8086 a01f PRO/10GbE CX4 Server Adapter
8086 a11f PRO/10GbE CX4 Server Adapter
10a0 82571EB PRO/1000 AT Quad Port Bypass Adapter 10a0 82571EB PRO/1000 AT Quad Port Bypass Adapter
10a1 82571EB PRO/1000 AF Quad Port Bypass Adapter 10a1 82571EB PRO/1000 AF Quad Port Bypass Adapter
10a4 82571EB Gigabit Ethernet Controller
8086 10a4 PRO/1000 PT Quad Port Server Adapter
8086 11a4 PRO/1000 PT Quad Port Server Adapter
10b0 82573L PRO/1000 PL Network Connection 10b0 82573L PRO/1000 PL Network Connection
10b2 82573V PRO/1000 PM Network Connection 10b2 82573V PRO/1000 PM Network Connection
10b3 82573E PRO/1000 PM Network Connection 10b3 82573E PRO/1000 PM Network Connection
@ -10699,6 +10718,11 @@
8086 1093 PRO/1000 PT Desktop Adapter 8086 1093 PRO/1000 PT Desktop Adapter
10ba 80003ES2LAN Gigabit Ethernet Controller (Copper) 10ba 80003ES2LAN Gigabit Ethernet Controller (Copper)
10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes) 10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes)
10bc 82571EB Gigabit Ethernet Controller (Copper)
8086 10bc PRO/1000 PT Quad Port LP Server Adapter
8086 11bc PRO/1000 PT Quad Port LP Server Adapter
10c4 82562GT 10/100 Network Connection
10c5 82562G 10/100 Network Connection
1107 PRO/1000 MF Server Adapter (LX) 1107 PRO/1000 MF Server Adapter (LX)
1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1130 82815 815 Chipset Host Bridge and Memory Controller Hub
1025 1016 Travelmate 612 TX 1025 1016 Travelmate 612 TX
@ -10946,6 +10970,9 @@
1a31 82845 845 (Brookdale) Chipset AGP Bridge 1a31 82845 845 (Brookdale) Chipset AGP Bridge
1a38 5000 Series Chipset DMA Engine 1a38 5000 Series Chipset DMA Engine
1a48 PRO/10GbE SR Server Adapter 1a48 PRO/10GbE SR Server Adapter
1b48 82597EX 10GbE Ethernet Controller
8086 a01f PRO/10GbE LR Server Adapter
8086 a11f PRO/10GbE LR Server Adapter
2410 82801AA ISA Bridge (LPC) 2410 82801AA ISA Bridge (LPC)
2411 82801AA IDE 2411 82801AA IDE
2412 82801AA USB 2412 82801AA USB
@ -10998,6 +11025,7 @@
147b 0507 TH7II-RAID 147b 0507 TH7II-RAID
8086 4532 D815EEA2 mainboard 8086 4532 D815EEA2 mainboard
2445 82801BA/BAM AC'97 Audio 2445 82801BA/BAM AC'97 Audio
0e11 000b Compaq Deskpro EN Audio
0e11 0088 Evo D500 0e11 0088 Evo D500
1014 01c6 Netvista A40/A40p 1014 01c6 Netvista A40/A40p
1025 1016 Travelmate 612 TX 1025 1016 Travelmate 612 TX
@ -11010,6 +11038,7 @@
104d 80df Vaio PCG-FX403 104d 80df Vaio PCG-FX403
2448 82801 Mobile PCI Bridge 2448 82801 Mobile PCI Bridge
103c 099c NX6110/NC6120 103c 099c NX6110/NC6120
144d c00c P30 notebook
1734 1055 Amilo M1420 1734 1055 Amilo M1420
2449 82801BA/BAM/CA/CAM Ethernet Controller 2449 82801BA/BAM/CA/CAM Ethernet Controller
0e11 0012 EtherExpress PRO/100 VM 0e11 0012 EtherExpress PRO/100 VM
@ -11129,6 +11158,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
1462 5800 845PE Max (MS-6580) 1462 5800 845PE Max (MS-6580)
1509 2990 Averatec 5110H laptop 1509 2990 Averatec 5110H laptop
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
@ -11160,6 +11190,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
1462 5800 845PE Max (MS-6580) 1462 5800 845PE Max (MS-6580)
1509 2990 Averatec 5110H 1509 2990 Averatec 5110H
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
@ -11177,6 +11208,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
1458 a002 GA-8PE667 Ultra 1458 a002 GA-8PE667 Ultra
1462 5800 845PE Max (MS-6580) 1462 5800 845PE Max (MS-6580)
1734 1005 D1451 (SCENIC N300, i845GV) Sigmatel STAC9750T 1734 1005 D1451 (SCENIC N300, i845GV) Sigmatel STAC9750T
@ -11190,6 +11222,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
24c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 24c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3
1014 0267 NetVista A30p 1014 0267 NetVista A30p
1014 052d Thinkpad R50e model 1634 1014 052d Thinkpad R50e model 1634
@ -11201,6 +11234,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
1462 5800 845PE Max (MS-6580) 1462 5800 845PE Max (MS-6580)
1509 2990 Averatec 5110H 1509 2990 Averatec 5110H
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
@ -11215,6 +11249,7 @@
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
144d c00c P30 notebook
1734 1055 Amilo M1420 1734 1055 Amilo M1420
8086 4541 Latitude D400 8086 4541 Latitude D400
24cb 82801DB (ICH4) IDE Controller 24cb 82801DB (ICH4) IDE Controller
@ -11225,6 +11260,7 @@
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
4c53 1090 Cx9 / Vx9 mainboard 4c53 1090 Cx9 / Vx9 mainboard
24cc 82801DBM (ICH4-M) LPC Interface Bridge 24cc 82801DBM (ICH4-M) LPC Interface Bridge
144d c00c P30 notebook
1734 1055 Amilo M1420 1734 1055 Amilo M1420
24cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller 24cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
1014 0267 NetVista A30p 1014 0267 NetVista A30p
@ -11240,6 +11276,7 @@
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
1071 8160 MIM2000 1071 8160 MIM2000
1179 ff00 Satellite 2430 1179 ff00 Satellite 2430
144d c00c P30 notebook
1462 3981 845PE Max (MS-6580) 1462 3981 845PE Max (MS-6580)
1509 1968 Averatec 5110H 1509 1968 Averatec 5110H
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
@ -11278,6 +11315,7 @@
1014 02ed xSeries server mainboard 1014 02ed xSeries server mainboard
1028 0156 Precision 360 1028 0156 Precision 360
1028 0169 Precision 470 1028 0169 Precision 470
103c 12bc d330 uT
1043 80a6 P4P800 Mainboard 1043 80a6 P4P800 Mainboard
1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)
1462 7280 865PE Neo2 (MS-6728) 1462 7280 865PE Neo2 (MS-6728)
@ -11304,6 +11342,7 @@
8086 4c43 Desktop Board D865GLC 8086 4c43 Desktop Board D865GLC
8086 524c D865PERL mainboard 8086 524c D865PERL mainboard
24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller 24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller
100a 147b Abit IS7-E motherboard
1028 0169 Precision 470 1028 0169 Precision 470
103c 006a NX9500 103c 006a NX9500
103c 12bc d330 uT 103c 12bc d330 uT
@ -11427,6 +11466,7 @@
1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)
2570 82865G/PE/P DRAM Controller/Host-Hub Interface 2570 82865G/PE/P DRAM Controller/Host-Hub Interface
103c 006a NX9500 103c 006a NX9500
103c 12bc d330 uT
1043 80f2 P5P800-MX Mainboard 1043 80f2 P5P800-MX Mainboard
1458 2570 GA-8IPE1000 Pro2 motherboard (865PE) 1458 2570 GA-8IPE1000 Pro2 motherboard (865PE)
2571 82865G/PE/P PCI to AGP Controller 2571 82865G/PE/P PCI to AGP Controller
@ -11533,7 +11573,7 @@
25e5 5000 Series Chipset PCI Express x4 Port 5 25e5 5000 Series Chipset PCI Express x4 Port 5
25e6 5000 Series Chipset PCI Express x4 Port 6 25e6 5000 Series Chipset PCI Express x4 Port 6
25e7 5000 Series Chipset PCI Express x4 Port 7 25e7 5000 Series Chipset PCI Express x4 Port 7
25f0 5000 Series Chipset Error Reporting Registers 25f0 5000 Series Chipset FSB Registers
25f1 5000 Series Chipset Reserved Registers 25f1 5000 Series Chipset Reserved Registers
25f3 5000 Series Chipset Reserved Registers 25f3 5000 Series Chipset Reserved Registers
25f5 5000 Series Chipset FBD Registers 25f5 5000 Series Chipset FBD Registers
@ -11554,7 +11594,7 @@
2609 E8500/E8501 PCI Express x8 Port B 2609 E8500/E8501 PCI Express x8 Port B
260a E8500/E8501 PCI Express x8 Port A 260a E8500/E8501 PCI Express x8 Port A
260c E8500/E8501 IMI Registers 260c E8500/E8501 IMI Registers
2610 E8500/E8501 Front Side Bus, Boot, and Interrupt Registers 2610 E8500/E8501 FSB Registers
2611 E8500/E8501 Address Mapping Registers 2611 E8500/E8501 Address Mapping Registers
2612 E8500/E8501 RAS Registers 2612 E8500/E8501 RAS Registers
2613 E8500/E8501 Reserved Registers 2613 E8500/E8501 Reserved Registers
@ -11713,6 +11753,7 @@
107b 5048 E4500 107b 5048 E4500
8086 544e DeskTop Board D945GTP 8086 544e DeskTop Board D945GTP
27b9 82801GBM (ICH7-M) LPC Interface Bridge 27b9 82801GBM (ICH7-M) LPC Interface Bridge
10f7 8338 Panasonic CF-Y5 laptop
17aa 2009 ThinkPad T60/R60 series 17aa 2009 ThinkPad T60/R60 series
27bd 82801GHM (ICH7-M DH) LPC Interface Bridge 27bd 82801GHM (ICH7-M DH) LPC Interface Bridge
27c0 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE 27c0 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE
@ -11749,9 +11790,12 @@
27d6 82801G (ICH7 Family) PCI Express Port 4 27d6 82801G (ICH7 Family) PCI Express Port 4
27d8 82801G (ICH7 Family) High Definition Audio Controller 27d8 82801G (ICH7 Family) High Definition Audio Controller
107b 5048 E4500 107b 5048 E4500
10f7 8338 Panasonic CF-Y5 laptop
1179 ff31 Toshiba America Information Systems:AC97 Data Fax SoftModem with SmartCP
152d 0753 Softmodem 152d 0753 Softmodem
17aa 2010 ThinkPad T60/R60 series 17aa 2010 ThinkPad T60/R60 series
27da 82801G (ICH7 Family) SMBus Controller 27da 82801G (ICH7 Family) SMBus Controller
10f7 8338 Panasonic CF-Y5 laptop
17aa 200f ThinkPad T60/R60 series 17aa 200f ThinkPad T60/R60 series
8086 544e DeskTop Board D945GTP 8086 544e DeskTop Board D945GTP
27dc 82801G (ICH7 Family) LAN Controller 27dc 82801G (ICH7 Family) LAN Controller
@ -11760,6 +11804,7 @@
27de 82801G (ICH7 Family) AC'97 Audio Controller 27de 82801G (ICH7 Family) AC'97 Audio Controller
27df 82801G (ICH7 Family) IDE Controller 27df 82801G (ICH7 Family) IDE Controller
107b 5048 E4500 107b 5048 E4500
10f7 8338 Panasonic CF-Y5 laptop
17aa 200c Thinkpad R60e model 0657 17aa 200c Thinkpad R60e model 0657
8086 544e DeskTop Board D945GTP 8086 544e DeskTop Board D945GTP
27e0 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 27e0 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5
@ -11770,21 +11815,28 @@
2814 82801HO (ICH8DO) LPC Interface Controller 2814 82801HO (ICH8DO) LPC Interface Controller
2815 Mobile LPC Interface Controller 2815 Mobile LPC Interface Controller
2820 82801H (ICH8 Family) 4 port SATA IDE Controller 2820 82801H (ICH8 Family) 4 port SATA IDE Controller
2821 82801HB (ICH8) SATA AHCI Controller 1462 7235 P965 Neo MS-7235 mainboard
2821 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller
2822 82801HR/HO/HH (ICH8R/DO/DH) SATA RAID Controller 2822 82801HR/HO/HH (ICH8R/DO/DH) SATA RAID Controller
2824 82801HR/HO/HH (ICH8R/DO/DH) SATA AHCI Controller 2824 82801HB (ICH8) 4 port SATA AHCI Controller
2825 82801H (ICH8 Family) 2 port SATA IDE Controller 2825 82801H (ICH8 Family) 2 port SATA IDE Controller
1462 7235 P965 Neo MS-7235 mainboard
2828 Mobile SATA IDE Controller 2828 Mobile SATA IDE Controller
2829 Mobile SATA AHCI Controller 2829 Mobile SATA AHCI Controller
282a Mobile SATA RAID Controller 282a Mobile SATA RAID Controller
2830 82801H (ICH8 Family) USB UHCI #1 2830 82801H (ICH8 Family) USB UHCI #1
1462 7235 P965 Neo MS-7235 mainboard
2831 82801H (ICH8 Family) USB UHCI #2 2831 82801H (ICH8 Family) USB UHCI #2
1462 7235 P965 Neo MS-7235 mainboard
2832 82801H (ICH8 Family) USB UHCI #3 2832 82801H (ICH8 Family) USB UHCI #3
2834 82801H (ICH8 Family) USB UHCI #4 2834 82801H (ICH8 Family) USB UHCI #4
1462 7235 P965 Neo MS-7235 mainboard
2835 82801H (ICH8 Family) USB UHCI #5 2835 82801H (ICH8 Family) USB UHCI #5
2836 82801H (ICH8 Family) USB2 EHCI #1 2836 82801H (ICH8 Family) USB2 EHCI #1
1462 7235 P965 Neo MS-7235 mainboard
283a 82801H (ICH8 Family) USB2 EHCI #2 283a 82801H (ICH8 Family) USB2 EHCI #2
283e 82801H (ICH8 Family) SMBus Controller 283e 82801H (ICH8 Family) SMBus Controller
1462 7235 P965 Neo MS-7235 mainboard
283f 82801H (ICH8 Family) PCI Express Port 1 283f 82801H (ICH8 Family) PCI Express Port 1
2841 82801H (ICH8 Family) PCI Express Port 2 2841 82801H (ICH8 Family) PCI Express Port 2
2843 82801H (ICH8 Family) PCI Express Port 3 2843 82801H (ICH8 Family) PCI Express Port 3
@ -11831,12 +11883,15 @@
2a07 Mobile KT Controller 2a07 Mobile KT Controller
3092 Integrated RAID 3092 Integrated RAID
3200 GD31244 PCI-X SATA HBA 3200 GD31244 PCI-X SATA HBA
1775 c200 C2K onboard SATA host bus adapter
3340 82855PM Processor to I/O Controller 3340 82855PM Processor to I/O Controller
1025 005a TravelMate 290 1025 005a TravelMate 290
103c 088c NC8000 laptop 103c 088c NC8000 laptop
103c 0890 NC6000 laptop 103c 0890 NC6000 laptop
103c 08b0 tc1100 tablet 103c 08b0 tc1100 tablet
144d c00c P30 notebook
3341 82855PM Processor to AGP Controller 3341 82855PM Processor to AGP Controller
144d c00c P30 notebook
3500 6311ESB/6321ESB PCI Express Upstream Port 3500 6311ESB/6321ESB PCI Express Upstream Port
3501 6310ESB PCI Express Upstream Port 3501 6310ESB PCI Express Upstream Port
3504 6311ESB/6321ESB I/OxAPIC Interrupt Controller 3504 6311ESB/6321ESB I/OxAPIC Interrupt Controller

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,6 @@ XCOMM command (or a combination of both methods)
FontPath MISCFONTPATH FontPath MISCFONTPATH
FontPath T1FONTPATH FontPath T1FONTPATH
FontPath TRUETYPEFONTPATH FontPath TRUETYPEFONTPATH
FontPath CIDFONTPATH
FontPath DPI75FONTPATH FontPath DPI75FONTPATH
FontPath DPI100FONTPATH FontPath DPI100FONTPATH

View File

@ -51,6 +51,7 @@ Xnest_LDFLAGS =
AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \
-DNO_HW_ONLY_EXTS \ -DNO_HW_ONLY_EXTS \
-DXFree86Server \
$(DIX_CFLAGS) \ $(DIX_CFLAGS) \
$(XNESTMODULES_CFLAGS) $(XNESTMODULES_CFLAGS)

View File

@ -5,7 +5,8 @@ bin_PROGRAMS = Xprt
Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
-DXPRINT -DPRINT_ONLY_SERVER -D_XP_PRINT_SERVER_ \ -DXPRINT -DPRINT_ONLY_SERVER -D_XP_PRINT_SERVER_ \
-DXPRINTDIR=\"$(libdir)/X11/xserver\" \ -DXPRINTDIR=\"$(libdir)/X11/xserver\" \
-DXPRASTERDDX -DXPPCLDDX -DXPMONOPCLDDX -DXPPSDDX -DXPRASTERDDX -DXPPCLDDX -DXPMONOPCLDDX -DXPPSDDX \
-DXFree86Server
Xprt_LDFLAGS = -L$(top_srcdir) Xprt_LDFLAGS = -L$(top_srcdir)
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \ Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \

View File

@ -694,6 +694,7 @@ winFixupPaths (void)
if (sizeof(xkbbasedir) > 0) if (sizeof(xkbbasedir) > 0)
xkbbasedir[sizeof(xkbbasedir)-1] = 0; xkbbasedir[sizeof(xkbbasedir)-1] = 0;
XkbBaseDirectory = xkbbasedir; XkbBaseDirectory = xkbbasedir;
XkbBinDirectory = basedir;
} }
#endif /* XKB */ #endif /* XKB */
#endif /* RELOCATE_PROJECTROOT */ #endif /* RELOCATE_PROJECTROOT */

View File

@ -344,13 +344,11 @@ winProcSetSelectionOwner (ClientPtr client)
if (None != stuff->window) if (None != stuff->window)
{ {
/* Grab the Window from the request */ /* Grab the Window from the request */
pWindow = (WindowPtr) SecurityLookupWindow (stuff->window, client, int rc = dixLookupWindow(&pWindow, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success) {
if (!pWindow)
{
ErrorF ("winProcSetSelectionOwner - Found BadWindow, aborting.\n"); ErrorF ("winProcSetSelectionOwner - Found BadWindow, aborting.\n");
goto winProcSetSelectionOwner_Done; goto winProcSetSelectionOwner_Done;
} }
} }
/* Now we either have a valid window or None */ /* Now we either have a valid window or None */

View File

@ -982,11 +982,10 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd)
/* /*
* If the Windows window is minimized, its WindowRect has * If the Windows window is minimized, its WindowRect has
* meaningless values so we don't adjust X window to it. * meaningless values so we don't adjust X window to it.
* Instead we put the X window to the bottom in Z order to
* be obscured by other windows.
*/ */
vlist[0] = Below; vlist[0] = 0;
return ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin)); vlist[1] = 0;
return ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
} }
pDraw = &pWin->drawable; pDraw = &pWin->drawable;

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)
@ -441,7 +441,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
win32RootlessWindowPtr pRLWinPriv; win32RootlessWindowPtr pRLWinPriv;
RECT rcNew; RECT rcNew;
int nCmdShow; int nCmdShow, rc;
RegionRec newShape; RegionRec newShape;
ScreenPtr pScreen; ScreenPtr pScreen;
@ -450,11 +450,9 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
#if CYGMULTIWINDOW_DEBUG #if CYGMULTIWINDOW_DEBUG
ErrorF ("ProcWindowsWMFrameDraw\n"); ErrorF ("ProcWindowsWMFrameDraw\n");
#endif #endif
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
client, SecurityReadAccess))) if (rc != Success)
{ return rc;
return BadValue;
}
#if CYGMULTIWINDOW_DEBUG #if CYGMULTIWINDOW_DEBUG
ErrorF ("ProcWindowsWMFrameDraw - Window found\n"); ErrorF ("ProcWindowsWMFrameDraw - Window found\n");
#endif #endif
@ -538,6 +536,7 @@ ProcWindowsWMFrameSetTitle(
REQUEST(xWindowsWMFrameSetTitleReq); REQUEST(xWindowsWMFrameSetTitleReq);
WindowPtr pWin; WindowPtr pWin;
win32RootlessWindowPtr pRLWinPriv; win32RootlessWindowPtr pRLWinPriv;
int rc;
#if CYGMULTIWINDOW_DEBUG #if CYGMULTIWINDOW_DEBUG
ErrorF ("ProcWindowsWMFrameSetTitle\n"); ErrorF ("ProcWindowsWMFrameSetTitle\n");
@ -545,11 +544,9 @@ ProcWindowsWMFrameSetTitle(
REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq); REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
client, SecurityReadAccess))) if (rc != Success)
{ return rc;
return BadValue;
}
#if CYGMULTIWINDOW_DEBUG #if CYGMULTIWINDOW_DEBUG
ErrorF ("ProcWindowsWMFrameSetTitle - Window found\n"); ErrorF ("ProcWindowsWMFrameSetTitle - Window found\n");
#endif #endif

View File

@ -7,7 +7,7 @@ sdk_HEADERS = \
closure.h \ closure.h \
colormap.h \ colormap.h \
colormapst.h \ colormapst.h \
config.h \ hotplug.h \
cursor.h \ cursor.h \
cursorstr.h \ cursorstr.h \
dix.h \ dix.h \

View File

@ -81,107 +81,6 @@ SOFTWARE.
return(BadIDChoice);\ return(BadIDChoice);\
} }
/* XXX if you are using this macro, you are probably not generating Match
* errors where appropriate */
#define LOOKUP_DRAWABLE(did, client)\
((client->lastDrawableID == did) ? \
client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
#ifdef XACE
#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
{\
pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
RC_DRAWABLE, mode);\
if (!pDraw) \
{\
client->errorValue = did; \
return BadDrawable;\
}\
if (pDraw->type == UNDRAWABLE_WINDOW)\
return BadMatch;\
}
#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
{\
pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
RC_DRAWABLE, mode);\
if (!pDraw) \
{\
client->errorValue = did; \
return BadDrawable;\
}\
}
#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
if (!pGC)\
{\
client->errorValue = rid;\
return (BadGC);\
}
#define VERIFY_DRAWABLE(pDraw, did, client)\
SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)
#define VERIFY_GEOMETRABLE(pDraw, did, client)\
SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)
#define VERIFY_GC(pGC, rid, client)\
SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
#else /* not XACE */
#define VERIFY_DRAWABLE(pDraw, did, client)\
if (client->lastDrawableID == did)\
pDraw = client->lastDrawable;\
else \
{\
pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
if (!pDraw) \
{\
client->errorValue = did; \
return BadDrawable;\
}\
if (pDraw->type == UNDRAWABLE_WINDOW)\
return BadMatch;\
}
#define VERIFY_GEOMETRABLE(pDraw, did, client)\
if (client->lastDrawableID == did)\
pDraw = client->lastDrawable;\
else \
{\
pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
if (!pDraw) \
{\
client->errorValue = did; \
return BadDrawable;\
}\
}
#define VERIFY_GC(pGC, rid, client)\
if (client->lastGCID == rid)\
pGC = client->lastGC;\
else\
pGC = (GC *)LookupIDByType(rid, RT_GC);\
if (!pGC)\
{\
client->errorValue = rid;\
return (BadGC);\
}
#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
VERIFY_DRAWABLE(pDraw, did, client)
#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
VERIFY_GEOMETRABLE(pDraw, did, client)
#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
VERIFY_GC(pGC, rid, client)
#endif /* XACE */
/* /*
* We think that most hardware implementations of DBE will want * We think that most hardware implementations of DBE will want
* LookupID*(dbe_back_buffer_id) to return the window structure that the * LookupID*(dbe_back_buffer_id) to return the window structure that the
@ -239,10 +138,15 @@ 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);\ int rc;\
SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\ rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY,\
if ((pGC->depth != pDraw->depth) ||\ DixWriteAccess);\
(pGC->pScreen != pDraw->pScreen))\ if (rc != Success)\
return rc;\
rc = dixLookupGC(&(pGC), stuff->gc, client, DixReadAccess);\
if (rc != Success)\
return rc;\
if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
return (BadMatch);\ return (BadMatch);\
client->lastDrawable = pDraw;\ client->lastDrawable = pDraw;\
client->lastDrawableID = drawID;\ client->lastDrawableID = drawID;\
@ -375,47 +279,41 @@ extern int CompareISOLatin1Lowered(
unsigned char * /*b*/, unsigned char * /*b*/,
int blen); int blen);
#ifdef XACE extern int dixLookupWindow(
WindowPtr *result,
XID id,
ClientPtr client,
Mask access_mode);
extern WindowPtr SecurityLookupWindow( extern int dixLookupDrawable(
XID /*rid*/, DrawablePtr *result,
ClientPtr /*client*/, XID id,
Mask /*access_mode*/); ClientPtr client,
Mask type_mask,
Mask access_mode);
extern pointer SecurityLookupDrawable( extern int dixLookupGC(
XID /*rid*/, GCPtr *result,
ClientPtr /*client*/, XID id,
Mask /*access_mode*/); ClientPtr client,
Mask access_mode);
extern WindowPtr LookupWindow( extern int dixLookupClient(
XID /*rid*/, ClientPtr *result,
ClientPtr /*client*/); XID id,
ClientPtr client,
Mask access_mode);
extern pointer LookupDrawable( /*
XID /*rid*/, * These are deprecated compatibility functions and will be removed soon!
ClientPtr /*client*/); * Please use the new dixLookup*() functions above.
*/
#else extern WindowPtr SecurityLookupWindow(XID, ClientPtr, Mask);
extern WindowPtr LookupWindow(XID, ClientPtr);
extern WindowPtr LookupWindow( extern pointer SecurityLookupDrawable(XID, ClientPtr, Mask);
XID /*rid*/, extern pointer LookupDrawable(XID, ClientPtr);
ClientPtr /*client*/); extern ClientPtr LookupClient(XID, ClientPtr);
/* end deprecated functions */
extern pointer LookupDrawable(
XID /*rid*/,
ClientPtr /*client*/);
#define SecurityLookupWindow(rid, client, access_mode) \
LookupWindow(rid, client)
#define SecurityLookupDrawable(rid, client, access_mode) \
LookupDrawable(rid, client)
#endif /* XACE */
extern ClientPtr LookupClient(
XID /*rid*/,
ClientPtr /*client*/);
extern void NoopDDA(void); extern void NoopDDA(void);

View File

@ -106,7 +106,7 @@ extern int ProcRecolorCursor(ClientPtr /* client */);
extern void PostSyntheticMotion(DeviceIntPtr pDev, extern void PostSyntheticMotion(DeviceIntPtr pDev,
int x, int x,
int y, int y,
ScreenPtr pScreen, int screen,
unsigned long time); unsigned long time);
#endif #endif

View File

@ -422,7 +422,7 @@ extern void PostSyntheticMotion(
DeviceIntPtr pDev, DeviceIntPtr pDev,
int x, int x,
int y, int y,
ScreenPtr pScreen, int screen,
unsigned long time); unsigned long time);
extern int GetMotionHistorySize( extern int GetMotionHistorySize(

View File

@ -58,6 +58,16 @@ SOFTWARE.
#define UNDRAWABLE_WINDOW 2 #define UNDRAWABLE_WINDOW 2
#define DRAWABLE_BUFFER 3 #define DRAWABLE_BUFFER 3
/* corresponding type masks for dixLookupDrawable() */
#define M_DRAWABLE_WINDOW (1<<0)
#define M_DRAWABLE_PIXMAP (1<<1)
#define M_UNDRAWABLE_WINDOW (1<<2)
#define M_DRAWABLE_BUFFER (1<<3)
#define M_ANY (-1)
#define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW)
#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP|M_DRAWABLE_BUFFER)
#define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW)
/* flags to PaintWindow() */ /* flags to PaintWindow() */
#define PW_BACKGROUND 0 #define PW_BACKGROUND 0
#define PW_BORDER 1 #define PW_BORDER 1

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

@ -415,7 +415,11 @@ RRTellChanged (ScreenPtr pScreen)
if (pScrPriv->changed) if (pScrPriv->changed)
{ {
UpdateCurrentTime (); UpdateCurrentTime ();
pScrPriv->lastConfigTime = currentTime; if (pScrPriv->configChanged)
{
pScrPriv->lastConfigTime = currentTime;
pScrPriv->configChanged = FALSE;
}
pScrPriv->changed = FALSE; pScrPriv->changed = FALSE;
WalkTree (pScreen, TellChanged, (pointer) pScreen); WalkTree (pScreen, TellChanged, (pointer) pScreen);
for (i = 0; i < pScrPriv->numOutputs; i++) for (i = 0; i < pScrPriv->numOutputs; i++)

View File

@ -216,11 +216,14 @@ typedef struct _rrScrPriv {
TimeStamp lastSetTime; /* last changed by client */ TimeStamp lastSetTime; /* last changed by client */
TimeStamp lastConfigTime; /* possible configs changed */ TimeStamp lastConfigTime; /* possible configs changed */
RRCloseScreenProcPtr CloseScreen; RRCloseScreenProcPtr CloseScreen;
Bool changed; /* some config changed */ Bool changed; /* some config changed */
Bool configChanged; /* configuration changed */
Bool layoutChanged; /* screen layout changed */
CARD16 minWidth, minHeight; CARD16 minWidth, minHeight;
CARD16 maxWidth, maxHeight; CARD16 maxWidth, maxHeight;
CARD16 width, height; /* last known screen size */ CARD16 width, height; /* last known screen size */
Bool layoutChanged; /* screen layout changed */
int numOutputs; int numOutputs;
RROutputPtr *outputs; RROutputPtr *outputs;
@ -619,10 +622,13 @@ ProcRRDeleteOutputMode (ClientPtr client);
/* rroutput.c */ /* rroutput.c */
/* /*
* Notify the output of some change * Notify the output of some change. configChanged indicates whether
* any external configuration (mode list, clones, connected status)
* has changed, or whether the change was strictly internal
* (which crtc is in use)
*/ */
void void
RROutputChanged (RROutputPtr output); RROutputChanged (RROutputPtr output, Bool configChanged);
/* /*
* Create an output * Create an output

View File

@ -136,7 +136,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
break; break;
if (j == crtc->numOutputs) if (j == crtc->numOutputs)
{ {
RROutputChanged (outputs[i]); RROutputChanged (outputs[i], FALSE);
RRCrtcChanged (crtc, FALSE); RRCrtcChanged (crtc, FALSE);
} }
} }
@ -151,7 +151,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
break; break;
if (i == numOutputs) if (i == numOutputs)
{ {
RROutputChanged (crtc->outputs[j]); RROutputChanged (crtc->outputs[j], FALSE);
RRCrtcChanged (crtc, FALSE); RRCrtcChanged (crtc, FALSE);
} }
} }
@ -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;
@ -698,7 +698,15 @@ ProcRRSetCrtcConfig (ClientPtr client)
*/ */
if (pScrPriv->rrScreenSetSize) if (pScrPriv->rrScreenSetSize)
{ {
if (stuff->x + mode->mode.width > pScreen->width) int source_width = mode->mode.width;
int source_height = mode->mode.height;
if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270)
{
source_width = mode->mode.height;
source_height = mode->mode.width;
}
if (stuff->x + source_width > pScreen->width)
{ {
client->errorValue = stuff->x; client->errorValue = stuff->x;
if (outputs) if (outputs)
@ -706,7 +714,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
return BadValue; return BadValue;
} }
if (stuff->y + mode->mode.height > pScreen->height) if (stuff->y + source_height > pScreen->height)
{ {
client->errorValue = stuff->y; client->errorValue = stuff->y;
if (outputs) if (outputs)
@ -766,7 +774,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 +801,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 +834,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

@ -70,14 +70,15 @@ ProcRRSelectInput (ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
RREventPtr pRREvent, *pHead; RREventPtr pRREvent, *pHead;
XID clientResource; XID clientResource;
int rc;
REQUEST_SIZE_MATCH(xRRSelectInputReq); REQUEST_SIZE_MATCH(xRRSelectInputReq);
pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
if (!pWin) if (rc != Success)
return BadWindow; return rc;
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

@ -69,6 +69,7 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
output->modes = modes; output->modes = modes;
output->changed = TRUE; output->changed = TRUE;
pScrPriv->changed = TRUE; pScrPriv->changed = TRUE;
pScrPriv->configChanged = TRUE;
return mode; return mode;
} }
@ -205,6 +206,7 @@ RRGetInfo (ScreenPtr pScreen)
rotations = 0; rotations = 0;
pScrPriv->changed = FALSE; pScrPriv->changed = FALSE;
pScrPriv->configChanged = FALSE;
if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations))
return FALSE; return FALSE;

View File

@ -108,12 +108,15 @@ RRModePtr *
RRModesForScreen (ScreenPtr pScreen, int *num_ret) RRModesForScreen (ScreenPtr pScreen, int *num_ret)
{ {
rrScrPriv(pScreen); rrScrPriv(pScreen);
int o; int o, c;
RRModePtr *screen_modes; RRModePtr *screen_modes;
int num_screen_modes = 0; int num_screen_modes = 0;
screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr));
/*
* Add modes from all outputs
*/
for (o = 0; o < pScrPriv->numOutputs; o++) for (o = 0; o < pScrPriv->numOutputs; o++)
{ {
RROutputPtr output = pScrPriv->outputs[o]; RROutputPtr output = pScrPriv->outputs[o];
@ -129,6 +132,24 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret)
screen_modes[num_screen_modes++] = mode; screen_modes[num_screen_modes++] = mode;
} }
} }
/*
* Add modes from all crtcs. The goal is to
* make sure all available and active modes
* are visible to the client
*/
for (c = 0; c < pScrPriv->numCrtcs; c++)
{
RRCrtcPtr crtc = pScrPriv->crtcs[c];
RRModePtr mode = crtc->mode;
int n;
if (!mode) continue;
for (n = 0; n < num_screen_modes; n++)
if (screen_modes[n] == mode)
break;
if (n == num_screen_modes)
screen_modes[num_screen_modes++] = mode;
}
*num_ret = num_screen_modes; *num_ret = num_screen_modes;
return screen_modes; return screen_modes;
} }

View File

@ -28,7 +28,7 @@ RESTYPE RROutputType;
* Notify the output of some change * Notify the output of some change
*/ */
void void
RROutputChanged (RROutputPtr output) RROutputChanged (RROutputPtr output, Bool configChanged)
{ {
ScreenPtr pScreen = output->pScreen; ScreenPtr pScreen = output->pScreen;
@ -37,6 +37,8 @@ RROutputChanged (RROutputPtr output)
{ {
rrScrPriv (pScreen); rrScrPriv (pScreen);
pScrPriv->changed = TRUE; pScrPriv->changed = TRUE;
if (configChanged)
pScrPriv->configChanged = TRUE;
} }
} }
@ -106,7 +108,7 @@ RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen)
output->pScreen = pScreen; output->pScreen = pScreen;
pScrPriv->outputs = outputs; pScrPriv->outputs = outputs;
pScrPriv->outputs[pScrPriv->numOutputs++] = output; pScrPriv->outputs[pScrPriv->numOutputs++] = output;
RROutputChanged (output); RROutputChanged (output, FALSE);
return TRUE; return TRUE;
} }
@ -142,7 +144,7 @@ RROutputSetClones (RROutputPtr output,
memcpy (newClones, clones, numClones * sizeof (RROutputPtr)); memcpy (newClones, clones, numClones * sizeof (RROutputPtr));
output->clones = newClones; output->clones = newClones;
output->numClones = numClones; output->numClones = numClones;
RROutputChanged (output); RROutputChanged (output, TRUE);
return TRUE; return TRUE;
} }
@ -186,7 +188,7 @@ RROutputSetModes (RROutputPtr output,
output->modes = newModes; output->modes = newModes;
output->numModes = numModes; output->numModes = numModes;
output->numPreferred = numPreferred; output->numPreferred = numPreferred;
RROutputChanged (output); RROutputChanged (output, TRUE);
return TRUE; return TRUE;
} }
@ -219,7 +221,7 @@ RROutputSetCrtcs (RROutputPtr output,
memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr)); memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr));
output->crtcs = newCrtcs; output->crtcs = newCrtcs;
output->numCrtcs = numCrtcs; output->numCrtcs = numCrtcs;
RROutputChanged (output); RROutputChanged (output, TRUE);
return TRUE; return TRUE;
} }
@ -229,7 +231,7 @@ RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc)
if (output->crtc == crtc) if (output->crtc == crtc)
return; return;
output->crtc = crtc; output->crtc = crtc;
RROutputChanged (output); RROutputChanged (output, FALSE);
} }
Bool Bool
@ -239,7 +241,7 @@ RROutputSetConnection (RROutputPtr output,
if (output->connection == connection) if (output->connection == connection)
return TRUE; return TRUE;
output->connection = connection; output->connection = connection;
RROutputChanged (output); RROutputChanged (output, TRUE);
return TRUE; return TRUE;
} }
@ -251,7 +253,7 @@ RROutputSetSubpixelOrder (RROutputPtr output,
return TRUE; return TRUE;
output->subpixelOrder = subpixelOrder; output->subpixelOrder = subpixelOrder;
RROutputChanged (output); RROutputChanged (output, FALSE);
return TRUE; return TRUE;
} }
@ -264,7 +266,7 @@ RROutputSetPhysicalSize (RROutputPtr output,
return TRUE; return TRUE;
output->mmWidth = mmWidth; output->mmWidth = mmWidth;
output->mmHeight = mmHeight; output->mmHeight = mmHeight;
RROutputChanged (output); RROutputChanged (output, FALSE);
return TRUE; return TRUE;
} }
@ -378,7 +380,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

@ -217,13 +217,12 @@ ProcRRGetScreenSizeRange (ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int rc;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
return rc;
if (!pWin)
return BadWindow;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
@ -268,15 +267,12 @@ ProcRRSetScreenSize (ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
RRCrtcPtr crtc; int i, rc;
int i;
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
return rc;
if (!pWin)
return BadWindow;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
@ -291,12 +287,26 @@ ProcRRSetScreenSize (ClientPtr client)
client->errorValue = stuff->height; client->errorValue = stuff->height;
return BadValue; return BadValue;
} }
for (i = 0; i < pScrPriv->numCrtcs; i++) { for (i = 0; i < pScrPriv->numCrtcs; i++)
crtc = pScrPriv->crtcs[i]; {
if (crtc->mode && RRCrtcPtr crtc = pScrPriv->crtcs[i];
(crtc->x + crtc->mode->mode.width > stuff->width || RRModePtr mode = crtc->mode;
crtc->y + crtc->mode->mode.height > stuff->height)) if (mode)
{
int source_width = mode->mode.width;
int source_height = mode->mode.height;
Rotation rotation = crtc->rotation;
if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270)
{
source_width = mode->mode.height;
source_height = mode->mode.width;
}
if (crtc->x + source_width > stuff->width ||
crtc->y + source_height > stuff->height)
return BadMatch; return BadMatch;
}
} }
if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0) if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0)
{ {
@ -323,19 +333,16 @@ ProcRRGetScreenResources (ClientPtr client)
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
CARD8 *extra; CARD8 *extra;
unsigned long extraLen; unsigned long extraLen;
int i; int i, n, rc;
RRCrtc *crtcs; RRCrtc *crtcs;
RROutput *outputs; RROutput *outputs;
xRRModeInfo *modeinfos; xRRModeInfo *modeinfos;
CARD8 *names; CARD8 *names;
int n;
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
return rc;
if (!pWin)
return BadWindow;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
@ -481,62 +488,81 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output)
RR10DataPtr data; RR10DataPtr data;
RRScreenSizePtr size; RRScreenSizePtr size;
int nmode = output->numModes; int nmode = output->numModes;
int i, j, k; int o, os, l, r;
RRScreenRatePtr refresh; RRScreenRatePtr refresh;
CARD16 vRefresh; CARD16 vRefresh;
RRModePtr mode; RRModePtr mode;
Bool *used;
/* Make sure there is plenty of space for any combination */ /* Make sure there is plenty of space for any combination */
data = malloc (sizeof (RR10DataRec) + data = malloc (sizeof (RR10DataRec) +
sizeof (RRScreenSize) * nmode + sizeof (RRScreenSize) * nmode +
sizeof (RRScreenRate) * nmode); sizeof (RRScreenRate) * nmode +
sizeof (Bool) * nmode);
if (!data) if (!data)
return NULL; return NULL;
size = (RRScreenSizePtr) (data + 1); size = (RRScreenSizePtr) (data + 1);
refresh = (RRScreenRatePtr) (size + nmode); refresh = (RRScreenRatePtr) (size + nmode);
used = (Bool *) (refresh + nmode);
memset (used, '\0', sizeof (Bool) * nmode);
data->sizes = size; data->sizes = size;
data->nsize = 0; data->nsize = 0;
data->nrefresh = 0; data->nrefresh = 0;
data->size = 0; data->size = 0;
data->refresh = 0; data->refresh = 0;
for (i = 0; i < output->numModes; i++)
/*
* find modes not yet listed
*/
for (o = 0; o < output->numModes; o++)
{ {
mode = output->modes[i]; if (used[o]) continue;
for (j = 0; j < data->nsize; j++)
if (mode->mode.width == size[j].width && mode = output->modes[o];
mode->mode.height == size[j].height)
break; l = data->nsize;
if (j == data->nsize) size[l].id = data->nsize;
size[l].width = mode->mode.width;
size[l].height = mode->mode.height;
if (output->mmWidth && output->mmHeight) {
size[l].mmWidth = output->mmWidth;
size[l].mmHeight = output->mmHeight;
} else {
size[l].mmWidth = pScreen->mmWidth;
size[l].mmHeight = pScreen->mmHeight;
}
size[l].nRates = 0;
size[l].pRates = &refresh[data->nrefresh];
data->nsize++;
/*
* Find all modes with matching size
*/
for (os = o; os < output->numModes; os++)
{ {
size[j].id = j; mode = output->modes[os];
size[j].width = mode->mode.width; if (mode->mode.width == size[l].width &&
size[j].height = mode->mode.height; mode->mode.height == size[l].height)
if (output->mmWidth && output->mmHeight) { {
size[j].mmWidth = output->mmWidth; vRefresh = RRVerticalRefresh (&mode->mode);
size[j].mmHeight = output->mmHeight; used[os] = TRUE;
} else {
size[j].mmWidth = pScreen->mmWidth; for (r = 0; r < size[l].nRates; r++)
size[j].mmHeight = pScreen->mmHeight; if (vRefresh == size[l].pRates[r].rate)
break;
if (r == size[l].nRates)
{
size[l].pRates[r].rate = vRefresh;
size[l].pRates[r].mode = mode;
size[l].nRates++;
data->nrefresh++;
}
if (mode == output->crtc->mode)
{
data->size = l;
data->refresh = vRefresh;
}
} }
size[j].nRates = 0;
size[j].pRates = &refresh[data->nrefresh];
data->nsize++;
}
vRefresh = RRVerticalRefresh (&mode->mode);
for (k = 0; k < size[j].nRates; k++)
if (vRefresh == size[j].pRates[k].rate)
break;
if (k == size[j].nRates)
{
size[j].pRates[k].rate = vRefresh;
size[j].pRates[k].mode = mode;
size[j].nRates++;
data->nrefresh++;
}
if (mode == output->crtc->mode)
{
data->size = j;
data->refresh = vRefresh;
} }
} }
return data; return data;
@ -548,7 +574,7 @@ ProcRRGetScreenInfo (ClientPtr client)
REQUEST(xRRGetScreenInfoReq); REQUEST(xRRGetScreenInfoReq);
xRRGetScreenInfoReply rep; xRRGetScreenInfoReply rep;
WindowPtr pWin; WindowPtr pWin;
int n; int n, rc;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
CARD8 *extra; CARD8 *extra;
@ -556,11 +582,9 @@ ProcRRGetScreenInfo (ClientPtr client)
RROutputPtr output; RROutputPtr output;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
return rc;
if (!pWin)
return BadWindow;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
@ -703,7 +727,7 @@ ProcRRSetScreenConfig (ClientPtr client)
REQUEST(xRRSetScreenConfigReq); REQUEST(xRRSetScreenConfigReq);
xRRSetScreenConfigReply rep; xRRSetScreenConfigReply rep;
DrawablePtr pDraw; DrawablePtr pDraw;
int n; int n, rc;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
TimeStamp configTime; TimeStamp configTime;
@ -730,8 +754,9 @@ ProcRRSetScreenConfig (ClientPtr client)
has_rate = FALSE; has_rate = FALSE;
} }
SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
SecurityWriteAccess); if (rc != Success)
return rc;
pScreen = pDraw->pScreen; pScreen = pDraw->pScreen;
@ -864,22 +889,28 @@ ProcRRSetScreenConfig (ClientPtr client)
for (c = 0; c < pScrPriv->numCrtcs; c++) for (c = 0; c < pScrPriv->numCrtcs; c++)
{ {
rep.status = RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0, if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0,
0, NULL); 0, NULL))
if (rep.status != Success) {
rep.status = RRSetConfigFailed;
/* XXX recover from failure */
goto sendReply; goto sendReply;
}
} }
if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height, if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height,
pScreen->mmWidth, pScreen->mmHeight)) pScreen->mmWidth, pScreen->mmHeight))
{ {
rep.status = RRSetConfigFailed; rep.status = RRSetConfigFailed;
/* XXX recover from failure */
goto sendReply; goto sendReply;
} }
} }
rep.status = RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, if (!RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, 1, &output))
1, &output); rep.status = RRSetConfigFailed;
else
rep.status = RRSetConfigSuccess;
/* /*
* XXX Configure other crtcs to mirror as much as possible * XXX Configure other crtcs to mirror as much as possible
*/ */

View File

@ -116,14 +116,15 @@ ProcRRXineramaGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetStateReply rep; xPanoramiXGetStateReply rep;
register int n; register int n, rc;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
Bool active = FALSE; Bool active = FALSE;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow(stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if(!pWin) return BadWindow; if(rc != Success)
return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
@ -180,11 +181,12 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenCountReply rep; xPanoramiXGetScreenCountReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow(stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if(!pWin) return BadWindow; if (rc != Success)
return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
@ -206,11 +208,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
WindowPtr pWin, pRoot; WindowPtr pWin, pRoot;
ScreenPtr pScreen; ScreenPtr pScreen;
xPanoramiXGetScreenSizeReply rep; xPanoramiXGetScreenSizeReply rep;
register int n; register int n, rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if(!pWin) return BadWindow; if (rc != Success)
return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pRoot = WindowTable[pScreen->myNum]; pRoot = WindowTable[pScreen->myNum];

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)
{ {
@ -614,19 +614,21 @@ ProcRenderCreatePicture (ClientPtr client)
PicturePtr pPicture; PicturePtr pPicture;
DrawablePtr pDrawable; DrawablePtr pDrawable;
PictFormatPtr pFormat; PictFormatPtr pFormat;
int len; int len, error, rc;
int error;
REQUEST(xRenderCreatePictureReq); REQUEST(xRenderCreatePictureReq);
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
SecurityWriteAccess); DixWriteAccess);
if (rc != Success)
return rc;
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 +662,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 +682,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 +708,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 +738,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 +784,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 +797,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 +831,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 +844,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 +878,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 +891,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 +925,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 +938,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 +990,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 +1038,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 +1063,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 +1097,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 +1198,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 +1253,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 +1266,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 +1279,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 +1341,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 +1422,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 +1488,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 +1670,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)
@ -1687,14 +1689,15 @@ ProcRenderQueryFilters (ClientPtr client)
int nnames; int nnames;
ScreenPtr pScreen; ScreenPtr pScreen;
PictureScreenPtr ps; PictureScreenPtr ps;
int i, j; int i, j, len, total_bytes, rc;
int len;
int total_bytes;
INT16 *aliases; INT16 *aliases;
char *names; char *names;
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
DixReadAccess);
if (rc != Success)
return rc;
pScreen = pDrawable->pScreen; pScreen = pDrawable->pScreen;
nbytesName = 0; nbytesName = 0;
@ -1797,7 +1800,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 +1834,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 +1862,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 +2617,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 +2659,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 +2680,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 +2701,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 +2722,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 +2745,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 +2771,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 +2819,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 +2862,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 +2909,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 +2971,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 +3029,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 +3083,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 +3139,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 +3183,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 +3229,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

@ -240,12 +240,12 @@ ProcXFixesSelectCursorInput (ClientPtr client)
{ {
REQUEST (xXFixesSelectCursorInputReq); REQUEST (xXFixesSelectCursorInputReq);
WindowPtr pWin; WindowPtr pWin;
int rc;
REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq);
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
SecurityReadAccess); if (rc != Success)
if (!pWin) return rc;
return(BadWindow);
if (stuff->eventMask & ~CursorAllEvents) if (stuff->eventMask & ~CursorAllEvents)
{ {
client->errorValue = stuff->eventMask; client->errorValue = stuff->eventMask;
@ -416,7 +416,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)
@ -449,7 +449,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
@ -680,8 +680,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);
@ -715,7 +715,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)

Some files were not shown because too many files have changed in this diff Show More