xserver: Branch 'XACE-modular' - 5 commits

Eamon Walsh ewalsh at kemper.freedesktop.org
Fri Sep 8 22:26:55 EEST 2006


 Xext/Makefile.am |    9 ++++++---
 Xext/security.c  |    6 ------
 Xext/xace.c      |    4 ++++
 dix/dispatch.c   |    9 +++++----
 dix/extension.c  |    6 +++---
 5 files changed, 18 insertions(+), 16 deletions(-)

New commits:
diff-tree d1110c5c83a7f439158f369ab2f3ae614fa9d2a5 (from 9deb579dc9366590203afe0576bf88643ab36c89)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Sep 8 15:28:48 2006 -0400

    Generalize the handling of configuration files that ship with extensions.

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 4deb8e5..6ea3d74 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -33,6 +33,10 @@ MODULE_SRCS =			\
 	sync.c			\
 	xcmisc.c
 
+# Extra configuration files ship with some extensions
+SERVERCONFIGdir = $(libdir)/xserver
+SERVERCONFIG_DATA =
+
 # Optional sources included if extension enabled by configure.ac rules
 
 # MIT Shared Memory extension
@@ -77,8 +81,7 @@ XCSECURITY_SRCS = security.c securitysrv
 if XCSECURITY   
 BUILTIN_SRCS += $(XCSECURITY_SRCS)
 
-SERVERCONFIGdir = $(libdir)/xserver
-SERVERCONFIG_DATA = SecurityPolicy
+SERVERCONFIG_DATA += SecurityPolicy
 AM_CFLAGS += -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGdir)/SecurityPolicy\"
 endif
 
@@ -157,7 +160,7 @@ libXextmodule_la_SOURCES =	$(MODULE_SRCS
 endif
 
 EXTRA_DIST = \
-	SecurityPolicy \
+	$(SERVERCONFIG_DATA) \
 	$(MITSHM_SRCS) \
 	$(XV_SRCS) \
 	$(RES_SRCS) \
diff-tree 9deb579dc9366590203afe0576bf88643ab36c89 (from cec392656cda1c938d5462e1949e6eef489f9168)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Sep 8 15:25:17 2006 -0400

    Zero out newly created ExtensionEntry structures, but only after the
    devPrivates have been initialized.

diff --git a/dix/extension.c b/dix/extension.c
index ee00ab9..f58c731 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -80,7 +80,7 @@ extern int extensionPrivateLen;
 extern unsigned *extensionPrivateSizes;
 extern unsigned totalExtensionSize;
 
-static int
+static void
 InitExtensionPrivates(ExtensionEntry *ext)
 {
     register char *ptr;
@@ -107,7 +107,6 @@ InitExtensionPrivates(ExtensionEntry *ex
 	else
 	    ppriv->ptr = (pointer)NULL;
     }
-    return 1;
 }
 
 _X_EXPORT ExtensionEntry *
@@ -127,9 +126,10 @@ AddExtension(char *name, int NumEvents, 
         return((ExtensionEntry *) NULL);
 
     ext = (ExtensionEntry *) xalloc(totalExtensionSize);
-    if (!ext || !InitExtensionPrivates(ext))
+    if (!ext)
 	return((ExtensionEntry *) NULL);
     bzero(ext, totalExtensionSize);
+    InitExtensionPrivates(ext);
     ext->name = (char *)xalloc(strlen(name) + 1);
     ext->num_aliases = 0;
     ext->aliases = (char **)NULL;
diff-tree cec392656cda1c938d5462e1949e6eef489f9168 (from 0fba09cdfcc78161f5c92bef6cca53e5309656bd)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Sep 8 15:24:23 2006 -0400

    Zero out newly allocated ClientRec structures.
    This is required to initialize the devPrivates to a known state.

diff --git a/dix/dispatch.c b/dix/dispatch.c
index aa67dc4..7c4d539 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3612,8 +3612,13 @@ CloseDownRetainedResources()
     }
 }
 
+extern int clientPrivateLen;
+extern unsigned *clientPrivateSizes;
+extern unsigned totalClientSize;
+
 void InitClient(ClientPtr client, int i, pointer ospriv)
 {
+    bzero(client, totalClientSize);
     client->index = i;
     client->sequence = 0; 
     client->clientAsMask = ((Mask)i) << CLIENTOFFSET;
@@ -3664,10 +3669,6 @@ void InitClient(ClientPtr client, int i,
 #endif
 }
 
-extern int clientPrivateLen;
-extern unsigned *clientPrivateSizes;
-extern unsigned totalClientSize;
-
 int
 InitClientPrivates(ClientPtr client)
 {
diff-tree 0fba09cdfcc78161f5c92bef6cca53e5309656bd (from c93877100eb98647c5b6b8556730d54677f730b6)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Sep 8 15:23:06 2006 -0400

    Include dix-config.h.

diff --git a/Xext/xace.c b/Xext/xace.c
index 44aaa42..14a5e79 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -17,6 +17,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 
 ********************************************************/
 
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
 #include <stdarg.h>
 #include "windowstr.h"
 #include "scrnintstr.h"
diff-tree c93877100eb98647c5b6b8556730d54677f730b6 (from 0b81fccd2ee4e054e5cffb739de07460ff2c13f7)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Sep 8 15:21:57 2006 -0400

    Don't need to allocate memory now that devPrivates are being used.

diff --git a/Xext/security.c b/Xext/security.c
index 43f32fc..54a2b3e 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -1131,12 +1131,6 @@ CALLBACK(SecurityClientStateCallback)
 	    XID authId = AuthorizationIDOfClient(client);
 	    SecurityAuthorizationPtr pAuth;
 
-	    /* allocate space for security state */
-	    STATEPTR(client) = xalloc(sizeof(SecurityClientStateRec));
-	    if (!STATEPTR(client))
-		FatalError("Client %d: couldn't allocate security state\n",
-			   client->index);
-
 	    TRUSTLEVEL(client) = XSecurityClientTrusted;
 	    AUTHID(client) = authId;
 	    pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId,



More information about the xorg-commit mailing list