xserver: Branch 'master' - 2 commits

Eamon Walsh ewalsh at kemper.freedesktop.org
Thu Feb 28 15:19:38 PST 2008


 GL/glx/glxcmds.c          |    8 ++++----
 Xext/panoramiX.c          |    6 +++---
 Xext/panoramiXprocs.c     |    8 ++++----
 Xext/shm.c                |    6 +++---
 Xext/xprint.c             |    2 +-
 Xi/exevents.c             |    2 +-
 composite/compext.c       |    6 ++++++
 composite/compwindow.c    |    2 +-
 config/dbus.c             |    2 +-
 hw/dmx/glxProxy/glxcmds.c |   24 ++++++++++++------------
 hw/xquartz/pseudoramiX.c  |    6 +++---
 randr/rrxinerama.c        |    6 +++---
 12 files changed, 42 insertions(+), 36 deletions(-)

New commits:
commit 5675ae1f72145e9b719c613023da525731b42461
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Feb 28 18:12:52 2008 -0500

    XACE: Call the creation hook to properly label COMPOSITE window pixmaps.

diff --git a/composite/compext.c b/composite/compext.c
index 2918556..97ea6d6 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -291,6 +291,12 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
 
     ++pPixmap->refcnt;
     
+    /* security creation/labeling check */
+    rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP,
+		  pPixmap, RT_WINDOW, pWin, DixCreateAccess);
+    if (rc != Success)
+	return rc;
+
     if (!AddResource (stuff->pixmap, RT_PIXMAP, (pointer) pPixmap))
 	return BadAlloc;
 
commit 27bcf40cda1d7c52b189cc76528f1f51cbe1d5eb
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Feb 28 16:43:43 2008 -0500

    XACE: Fix instances of DixUnknownAccess at hook callsites.

diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 21f3206..32d1bc8 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -479,7 +479,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
      * resource ID clashes.  Effectively, the X Window is now also a
      * GLXWindow. */
 
-    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
     if (rc != Success || pDraw->type != DRAWABLE_WINDOW) {
 	client->errorValue = drawId;
 	*error = __glXError(GLXBadDrawable);
@@ -1086,7 +1086,7 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLcontextModes *c
     DrawablePtr pDraw;
     int err;
 
-    err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixUnknownAccess);
+    err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess);
     if (err != Success || pDraw->type != DRAWABLE_PIXMAP) {
 	client->errorValue = drawableId;
 	return BadPixmap;
@@ -1364,7 +1364,7 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
     if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err))
 	return err;
 
-    err = dixLookupDrawable(&pDraw, req->window, client, 0, DixUnknownAccess);
+    err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess);
     if (err != Success || pDraw->type != DRAWABLE_WINDOW) {
 	client->errorValue = req->window;
 	return BadWindow;
@@ -2004,7 +2004,7 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
     int screen, rc;
     __GLXscreen *pGlxScreen;
 
-    rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
     pGlxScreen = glxGetScreen(pDraw->pScreen);
     if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
 	screen = pDraw->pScreen->myNum;
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index d8ec588..f924147 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -919,7 +919,7 @@ ProcPanoramiXGetState(ClientPtr client)
 	register int			n, rc;
 	
 	REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-	rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+	rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
 	if (rc != Success)
 	    return rc;
 
@@ -946,7 +946,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
 	register int			n, rc;
 
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-	rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+	rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
 	if (rc != Success)
 	    return rc;
 
@@ -972,7 +972,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
 	register int			n, rc;
 	
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-	rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+	rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
 	if (rc != Success)
 	    return rc;
 
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index d19b303..30aff74 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -525,7 +525,7 @@ int PanoramiXGetGeometry(ClientPtr client)
     REQUEST(xResourceReq);
 
     REQUEST_SIZE_MATCH(xResourceReq);
-    rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
@@ -1024,7 +1024,7 @@ int PanoramiXCopyArea(ClientPtr client)
 
 	FOR_NSCREENS(j) {
 	    rc = dixLookupDrawable(drawables+j, src->info[j].id, client, 0,
-				   DixUnknownAccess);
+				   DixGetAttrAccess);
 	    if (rc != Success)
 		return rc;
 	}
@@ -1779,7 +1779,7 @@ int PanoramiXGetImage(ClientPtr client)
 	return (*SavedProcVector[X_GetImage])(client);
 
     rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
-			   DixUnknownAccess);
+			   DixReadAccess);
     if (rc != Success)
 	return rc;
 
@@ -1817,7 +1817,7 @@ int PanoramiXGetImage(ClientPtr client)
     drawables[0] = pDraw;
     for(i = 1; i < PanoramiXNumScreens; i++) {
 	rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
-			       DixUnknownAccess);
+			       DixGetAttrAccess);
 	if (rc != Success)
 	    return rc;
     }
diff --git a/Xext/shm.c b/Xext/shm.c
index a7a1ecf..b2973bf 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -655,7 +655,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
 	return ProcShmGetImage(client);
 
     rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
-			   DixUnknownAccess);
+			   DixReadAccess);
     if (rc != Success)
 	return rc;
 
@@ -692,7 +692,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
     drawables[0] = pDraw;
     for(i = 1; i < PanoramiXNumScreens; i++) {
 	rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, 
-			       DixUnknownAccess);
+			       DixReadAccess);
 	if (rc != Success)
 	    return rc;
     }
@@ -767,7 +767,7 @@ ProcPanoramiXShmCreatePixmap(
 	return BadImplementation;
     LEGAL_NEW_RESOURCE(stuff->pid, client);
     rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
-			   DixUnknownAccess);
+			   DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
diff --git a/Xext/xprint.c b/Xext/xprint.c
index dba7989..a5d8fcc 100644
--- a/Xext/xprint.c
+++ b/Xext/xprint.c
@@ -1800,7 +1800,7 @@ ProcXpPutDocumentData(ClientPtr client)
 	if (pContext->state & DOC_RAW_STARTED)
 	    return BadDrawable;
 	result = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
-				   DixUnknownAccess);
+				   DixWriteAccess);
 	if (result != Success)
 	    return result;
 	if (pDraw->pScreen->myNum != pContext->screenNum)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index ac6b923..fb84bef 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -833,7 +833,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
 	} else
 	    effectiveFocus = pWin = inputFocus;
     } else
-	dixLookupWindow(&pWin, dest, client, DixUnknownAccess);
+	dixLookupWindow(&pWin, dest, client, DixSendAccess);
     if (!pWin)
 	return BadWindow;
     if ((propagate != xFalse) && (propagate != xTrue)) {
diff --git a/composite/compwindow.c b/composite/compwindow.c
index ee0f7d2..c022027 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -92,7 +92,7 @@ static Bool
 compRepaintBorder (ClientPtr pClient, pointer closure)
 {
     WindowPtr pWindow;
-    int rc = dixLookupWindow(&pWindow, (XID)closure, pClient,DixUnknownAccess);
+    int rc = dixLookupWindow(&pWindow, (XID)closure, pClient, DixWriteAccess);
 
     if (rc == Success) {
 	RegionRec exposed;
diff --git a/config/dbus.c b/config/dbus.c
index 0be42af..cef8ed5 100644
--- a/config/dbus.c
+++ b/config/dbus.c
@@ -213,7 +213,7 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
         MALFORMED_MESSAGE_ERROR();
     }
 
-    dixLookupDevice(&dev, deviceid, serverClient, DixUnknownAccess);
+    dixLookupDevice(&dev, deviceid, serverClient, DixDestroyAccess);
     if (!dev) {
         DebugF("[config/dbus] bogus device id %d given\n", deviceid);
         ret = BadMatch;
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index 85e0f87..ab7ee96 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -431,7 +431,7 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
     __glXWindow *pGlxWindow = NULL;
     int rc;
 
-    rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess);
     if (rc != Success) {
 	pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
 						    __glXPixmapRes);
@@ -461,7 +461,7 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
     __glXWindow *pGlxWindow = NULL;
     int rc;
 
-    rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess);
     if (rc != Success) {
 	pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
 						    __glXPixmapRes);
@@ -481,7 +481,7 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
 
     if (req->member != None) {
 	rc = dixLookupDrawable(&pMember, req->member, client, 0,
-			       DixUnknownAccess);
+			       DixGetAttrAccess);
 	if (rc != Success) {
 	    pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member,
 							__glXPixmapRes);
@@ -780,7 +780,7 @@ static int MakeCurrent(__GLXclientState *cl,
     }
 
     if (drawId != None) {
-	rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+	rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
 	if (rc == Success) {
 	    if (pDraw->type == DRAWABLE_WINDOW) {
 		/*
@@ -887,7 +887,7 @@ static int MakeCurrent(__GLXclientState *cl,
     }
 
     if (readId != None && readId != drawId ) {
-	rc = dixLookupDrawable(&pReadDraw, readId, client, 0,DixUnknownAccess);
+	rc = dixLookupDrawable(&pReadDraw, readId, client, 0, DixReadAccess);
 	if (rc == Success) {
 	    if (pReadDraw->type == DRAWABLE_WINDOW) {
 		/*
@@ -1645,7 +1645,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
 #endif
 
     rc = dixLookupDrawable(&pDraw, pixmapId, client, M_DRAWABLE_PIXMAP,
-			   DixUnknownAccess);
+			   DixAddAccess);
     if (rc != Success)
 	return rc;
 
@@ -1779,7 +1779,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
 #ifdef PANORAMIX
        if (pXinDraw) {
 	   dixLookupDrawable(&pRealDraw, pXinDraw->info[s].id, client, 0,
-			     DixUnknownAccess);
+			     DixAddAccess);
        }
 #endif
 
@@ -1950,7 +1950,7 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
     /*
     ** Check that the GLX drawable is valid.
     */
-    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
     if (rc == Success) {
         from_screen = to_screen = pDraw->pScreen->myNum;
 
@@ -2104,7 +2104,7 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
     /*
     ** Check that the GLX drawable is valid.
     */
-    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+    rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
     if (rc == Success) {
 	if (pDraw->type != DRAWABLE_WINDOW) {
 	    /*
@@ -2893,7 +2893,7 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
     ** Check if windowId is valid 
     */
     rc = dixLookupDrawable(&pDraw, windowId, client, M_DRAWABLE_WINDOW,
-			   DixUnknownAccess);
+			   DixAddAccess);
     if (rc != Success)
 	return rc;
 
@@ -3277,7 +3277,7 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
 #endif
 
    if (drawId != None) {
-      rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+      rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
       if (rc == Success) {
 	 if (pDraw->type == DRAWABLE_WINDOW) {
 		WindowPtr pWin = (WindowPtr)pDraw;
@@ -3438,7 +3438,7 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
 #endif
 
    if (drawId != None) {
-      rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+      rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess);
       if (rc == Success) {
 	 if (pDraw->type == DRAWABLE_WINDOW) {
 		WindowPtr pWin = (WindowPtr)pDraw;
diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index 4a9d8e1..49d5eb6 100644
--- a/hw/xquartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -179,7 +179,7 @@ static int ProcPseudoramiXGetState(ClientPtr client)
     register int n, rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
@@ -206,7 +206,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
     register int n, rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
@@ -233,7 +233,7 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
     register int			n, rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 896f61f..240fca2 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -122,7 +122,7 @@ ProcRRXineramaGetState(ClientPtr client)
     Bool			active = FALSE;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if(rc != Success)
 	return rc;
 
@@ -184,7 +184,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
     register int			n, rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
     
@@ -211,7 +211,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
     register int			n, rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 


More information about the xorg-commit mailing list