xserver: Branch 'master' - 5 commits

Eamon Walsh ewalsh at kemper.freedesktop.org
Fri Dec 28 10:30:20 PST 2007


 Xext/xselinux.c                     |  172 +++++++++++++++++++-----------------
 Xext/xselinux.h                     |   26 +----
 hw/xfree86/dixmods/extmod/modinit.h |    2 
 mi/miinitext.c                      |    6 -
 4 files changed, 105 insertions(+), 101 deletions(-)

New commits:
commit 3b23dd9fd43a28033d0af7b02088b0c6ca433158
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Dec 28 13:29:45 2007 -0500

    xselinux: Fix whitespace warnings.

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 6550c7f..4629e90 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1145,31 +1145,31 @@ ProcSELinuxDispatch(ClientPtr client)
     REQUEST(xReq);
     switch (stuff->data) {
     case X_SELinuxQueryVersion:
-        return ProcSELinuxQueryVersion(client);
+	return ProcSELinuxQueryVersion(client);
     case X_SELinuxSetSelectionManager:
 	return ProcSELinuxSetSelectionManager(client);
     case X_SELinuxGetSelectionManager:
-    	return ProcSELinuxGetSelectionManager(client);
+	return ProcSELinuxGetSelectionManager(client);
     case X_SELinuxSetDeviceCreateContext:
-    	return ProcSELinuxSetDeviceCreateContext(client);
+	return ProcSELinuxSetDeviceCreateContext(client);
     case X_SELinuxGetDeviceCreateContext:
-    	return ProcSELinuxGetDeviceCreateContext(client);
+	return ProcSELinuxGetDeviceCreateContext(client);
     case X_SELinuxSetDeviceContext:
-    	return ProcSELinuxSetDeviceContext(client);
+	return ProcSELinuxSetDeviceContext(client);
     case X_SELinuxGetDeviceContext:
-    	return ProcSELinuxGetDeviceContext(client);
+	return ProcSELinuxGetDeviceContext(client);
     case X_SELinuxSetPropertyCreateContext:
-    	return ProcSELinuxSetPropertyCreateContext(client);
+	return ProcSELinuxSetPropertyCreateContext(client);
     case X_SELinuxGetPropertyCreateContext:
-    	return ProcSELinuxGetPropertyCreateContext(client);
+	return ProcSELinuxGetPropertyCreateContext(client);
     case X_SELinuxGetPropertyContext:
-    	return ProcSELinuxGetPropertyContext(client);
+	return ProcSELinuxGetPropertyContext(client);
     case X_SELinuxSetWindowCreateContext:
-    	return ProcSELinuxSetWindowCreateContext(client);
+	return ProcSELinuxSetWindowCreateContext(client);
     case X_SELinuxGetWindowCreateContext:
-    	return ProcSELinuxGetWindowCreateContext(client);
+	return ProcSELinuxGetWindowCreateContext(client);
     case X_SELinuxGetWindowContext:
-    	return ProcSELinuxGetWindowContext(client);
+	return ProcSELinuxGetWindowContext(client);
     default:
 	return BadRequest;
     }
commit 643c52be32c187a0fdb9a031b1e31d97cd551339
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Dec 28 13:26:26 2007 -0500

    xselinux: Remove "X" prefix on remaining functions and strings.
    
    Should be evident from the context.

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index f3a8457..6550c7f 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -175,12 +175,12 @@ SELinuxSelectionToSID(Atom selection, SELinuxStateRec *sid_return)
 	security_id_t sid;
 
 	if (selabel_lookup(label_hnd, &con, name, SELABEL_X_SELN) < 0) {
-	    ErrorF("XSELinux: a selection label lookup failed!\n");
+	    ErrorF("SELinux: a selection label lookup failed!\n");
 	    return BadValue;
 	}
 	/* Get a SID for context */
 	if (avc_context_to_sid(con, &sid) < 0) {
-	    ErrorF("XSELinux: a context_to_SID call failed!\n");
+	    ErrorF("SELinux: a context_to_SID call failed!\n");
 	    return BadAlloc;
 	}
 	freecon(con);
@@ -216,12 +216,12 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
     if (!knownEvents[type]) {
 	/* Look in the mappings of event names to contexts */
 	if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EVENT) < 0) {
-	    ErrorF("XSELinux: an event label lookup failed!\n");
+	    ErrorF("SELinux: an event label lookup failed!\n");
 	    return BadValue;
 	}
 	/* Get a SID for context */
 	if (avc_context_to_sid(con, knownEvents + type) < 0) {
-	    ErrorF("XSELinux: a context_to_SID call failed!\n");
+	    ErrorF("SELinux: a context_to_SID call failed!\n");
 	    return BadAlloc;
 	}
 	freecon(con);
@@ -230,7 +230,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
     /* Perform a transition to obtain the final SID */
     if (avc_compute_create(sid_of_window, knownEvents[type], SECCLASS_X_EVENT,
 			   &sid_return->sid) < 0) {
-	ErrorF("XSELinux: a compute_create call failed!\n");
+	ErrorF("SELinux: a compute_create call failed!\n");
 	return BadValue;
     }
 
@@ -607,13 +607,13 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
 	/* Look in the mappings of property names to contexts */
 	if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EXT) < 0) {
-	    ErrorF("XSELinux: a property label lookup failed!\n");
+	    ErrorF("SELinux: a property label lookup failed!\n");
 	    rec->status = BadValue;
 	    return;
 	}
 	/* Get a SID for context */
 	if (avc_context_to_sid(con, &sid) < 0) {
-	    ErrorF("XSELinux: a context_to_SID call failed!\n");
+	    ErrorF("SELinux: a context_to_SID call failed!\n");
 	    rec->status = BadAlloc;
 	    return;
 	}
@@ -623,7 +623,7 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION,
 			       &obj->sid) < 0) {
-	    ErrorF("XSELinux: a SID transition call failed!\n");
+	    ErrorF("SELinux: a SID transition call failed!\n");
 	    freecon(con);
 	    rec->status = BadValue;
 	    return;
@@ -658,13 +658,13 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
 	/* Look in the mappings of property names to contexts */
 	if (selabel_lookup(label_hnd, &con, name, SELABEL_X_PROP) < 0) {
-	    ErrorF("XSELinux: a property label lookup failed!\n");
+	    ErrorF("SELinux: a property label lookup failed!\n");
 	    rec->status = BadValue;
 	    return;
 	}
 	/* Get a SID for context */
 	if (avc_context_to_sid(con, &sid) < 0) {
-	    ErrorF("XSELinux: a context_to_SID call failed!\n");
+	    ErrorF("SELinux: a context_to_SID call failed!\n");
 	    rec->status = BadAlloc;
 	    return;
 	}
@@ -674,7 +674,7 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(subj->sid, sid, SECCLASS_X_PROPERTY,
 			       &obj->sid) < 0) {
-	    ErrorF("XSELinux: a SID transition call failed!\n");
+	    ErrorF("SELinux: a SID transition call failed!\n");
 	    freecon(con);
 	    rec->status = BadValue;
 	    return;
@@ -732,7 +732,7 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(subj->sid, pobj->sid, class, &obj->sid) < 0) {
-	    ErrorF("XSELinux: a compute_create call failed!\n");
+	    ErrorF("SELinux: a compute_create call failed!\n");
 	    rec->status = BadValue;
 	    return;
 	}
@@ -766,7 +766,7 @@ SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata)
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN,
 			       &obj->sid) < 0) {
-	    ErrorF("XSELinux: a compute_create call failed!\n");
+	    ErrorF("SELinux: a compute_create call failed!\n");
 	    rec->status = BadValue;
 	    return;
 	}
@@ -883,16 +883,16 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	security_context_t ctx;
 	int rc = avc_sid_to_context(state->sid, &ctx);
 	if (rc < 0)
-	    FatalError("XSELinux: Failed to get security context!\n");
+	    FatalError("SELinux: Failed to get security context!\n");
 	rc = dixChangeWindowProperty(serverClient,
 				     pWin, atom_client_ctx, XA_STRING, 8,
 				     PropModeReplace, strlen(ctx), ctx, FALSE);
 	if (rc != Success)
-	    FatalError("XSELinux: Failed to set label property on window!\n");
+	    FatalError("SELinux: Failed to set label property on window!\n");
 	freecon(ctx);
     }
     else
-	FatalError("XSELinux: Unexpected unlabeled client found\n");
+	FatalError("SELinux: Unexpected unlabeled client found\n");
 
     state = dixLookupPrivate(&pWin->devPrivates, stateKey);
 
@@ -900,16 +900,16 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	security_context_t ctx;
 	int rc = avc_sid_to_context(state->sid, &ctx);
 	if (rc < 0)
-	    FatalError("XSELinux: Failed to get security context!\n");
+	    FatalError("SELinux: Failed to get security context!\n");
 	rc = dixChangeWindowProperty(serverClient,
 				     pWin, atom_ctx, XA_STRING, 8,
 				     PropModeReplace, strlen(ctx), ctx, FALSE);
 	if (rc != Success)
-	    FatalError("XSELinux: Failed to set label property on window!\n");
+	    FatalError("SELinux: Failed to set label property on window!\n");
 	freecon(ctx);
     }
     else
-	FatalError("XSELinux: Unexpected unlabeled window found\n");
+	FatalError("SELinux: Unexpected unlabeled window found\n");
 }
 
 static void
@@ -931,7 +931,7 @@ SELinuxSelectionState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
 	if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SELECTION,
 			       &obj->sid) < 0) {
-	    ErrorF("XSELinux: a compute_create call failed!\n");
+	    ErrorF("SELinux: a compute_create call failed!\n");
 	    obj->sid = unlabeled_sid;
 	}
 	break;
@@ -998,8 +998,8 @@ ProcSELinuxQueryVersion(ClientPtr client)
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
-    rep.server_major = XSELINUX_MAJOR_VERSION;
-    rep.server_minor = XSELINUX_MINOR_VERSION;
+    rep.server_major = SELINUX_MAJOR_VERSION;
+    rep.server_minor = SELINUX_MINOR_VERSION;
     if (client->swapped) {
 	int n;
 	swaps(&rep.sequenceNumber, n);
@@ -1367,7 +1367,7 @@ SELinuxResetProc(ExtensionEntry *extEntry)
 }
 
 void
-XSELinuxExtensionInit(INITARGS)
+SELinuxExtensionInit(INITARGS)
 {
     ExtensionEntry *extEntry;
     struct selinux_opt options[] = { { SELABEL_OPT_VALIDATE, (char *)1 } };
@@ -1376,7 +1376,7 @@ XSELinuxExtensionInit(INITARGS)
 
     /* Setup SELinux stuff */
     if (!is_selinux_enabled()) {
-        ErrorF("XSELinux: SELinux not enabled, disabling SELinux support.\n");
+        ErrorF("SELinux: SELinux not enabled, disabling SELinux support.\n");
         return;
     }
 
@@ -1385,42 +1385,42 @@ XSELinuxExtensionInit(INITARGS)
 
     if (selinux_set_mapping(map) < 0) {
 	if (errno == EINVAL) {
-	    ErrorF("XSELinux: Invalid object class mapping, disabling SELinux support.\n");
+	    ErrorF("SELinux: Invalid object class mapping, disabling SELinux support.\n");
 	    return;
 	}
-	FatalError("XSELinux: Failed to set up security class mapping\n");
+	FatalError("SELinux: Failed to set up security class mapping\n");
     }
 
     if (avc_open(NULL, 0) < 0)
-	FatalError("XSELinux: Couldn't initialize SELinux userspace AVC\n");
+	FatalError("SELinux: Couldn't initialize SELinux userspace AVC\n");
     avc_active = 1;
 
     label_hnd = selabel_open(SELABEL_CTX_X, options, 1);
     if (!label_hnd)
-	FatalError("XSELinux: Failed to open x_contexts mapping in policy\n");
+	FatalError("SELinux: Failed to open x_contexts mapping in policy\n");
 
     if (security_get_initial_context("unlabeled", &con) < 0)
-	FatalError("XSELinux: Failed to look up unlabeled context\n");
+	FatalError("SELinux: Failed to look up unlabeled context\n");
     if (avc_context_to_sid(con, &unlabeled_sid) < 0)
-	FatalError("XSELinux: a context_to_SID call failed!\n");
+	FatalError("SELinux: a context_to_SID call failed!\n");
     freecon(con);
 
     /* Prepare for auditing */
     audit_fd = audit_open();
     if (audit_fd < 0)
-        FatalError("XSELinux: Failed to open the system audit log\n");
+        FatalError("SELinux: Failed to open the system audit log\n");
 
     /* Allocate private storage */
     if (!dixRequestPrivate(stateKey, sizeof(SELinuxStateRec)))
-	FatalError("XSELinux: Failed to allocate private storage.\n");
+	FatalError("SELinux: Failed to allocate private storage.\n");
 
     /* Create atoms for doing window labeling */
     atom_ctx = MakeAtom("_SELINUX_CONTEXT", 16, TRUE);
     if (atom_ctx == BAD_RESOURCE)
-	FatalError("XSELinux: Failed to create atom\n");
+	FatalError("SELinux: Failed to create atom\n");
     atom_client_ctx = MakeAtom("_SELINUX_CLIENT_CONTEXT", 23, TRUE);
     if (atom_client_ctx == BAD_RESOURCE)
-	FatalError("XSELinux: Failed to create atom\n");
+	FatalError("SELinux: Failed to create atom\n");
 
     /* Register callbacks */
     ret &= dixRegisterPrivateInitFunc(stateKey, SELinuxStateInit, NULL);
@@ -1443,11 +1443,11 @@ XSELinuxExtensionInit(INITARGS)
     ret &= XaceRegisterCallback(XACE_SCREEN_ACCESS, SELinuxScreen, NULL);
     ret &= XaceRegisterCallback(XACE_SCREENSAVER_ACCESS, SELinuxScreen, truep);
     if (!ret)
-	FatalError("XSELinux: Failed to register one or more callbacks\n");
+	FatalError("SELinux: Failed to register one or more callbacks\n");
 
     /* Add extension to server */
-    extEntry = AddExtension(XSELINUX_EXTENSION_NAME,
-			    XSELinuxNumberEvents, XSELinuxNumberErrors,
+    extEntry = AddExtension(SELINUX_EXTENSION_NAME,
+			    SELinuxNumberEvents, SELinuxNumberErrors,
 			    ProcSELinuxDispatch, SProcSELinuxDispatch,
 			    SELinuxResetProc, StandardMinorOpcode);
 
diff --git a/Xext/xselinux.h b/Xext/xselinux.h
index 9800d5a..ba1380b 100644
--- a/Xext/xselinux.h
+++ b/Xext/xselinux.h
@@ -23,11 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "dixaccess.h"
 
 /* Extension info */
-#define XSELINUX_EXTENSION_NAME		"SELinux"
-#define XSELINUX_MAJOR_VERSION		1
-#define XSELINUX_MINOR_VERSION		0
-#define XSELinuxNumberEvents		0
-#define XSELinuxNumberErrors		0
+#define SELINUX_EXTENSION_NAME		"SELinux"
+#define SELINUX_MAJOR_VERSION		1
+#define SELINUX_MINOR_VERSION		0
+#define SELinuxNumberEvents		0
+#define SELinuxNumberErrors		0
 
 /* Extension protocol */
 #define X_SELinuxQueryVersion			0
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 191b3ef..99d714c 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -130,7 +130,7 @@ extern void XaceExtensionInit(INITARGS);
 #endif
 
 #ifdef XSELINUX
-extern void XSELinuxExtensionInit(INITARGS);
+extern void SELinuxExtensionInit(INITARGS);
 #endif
 
 #if 1
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 319d2ce..b146907 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -330,7 +330,7 @@ extern void XaceExtensionInit(INITARGS);
 extern void SecurityExtensionInit(INITARGS);
 #endif
 #ifdef XSELINUX
-extern void XSELinuxExtensionInit(INITARGS);
+extern void SELinuxExtensionInit(INITARGS);
 #endif
 #ifdef XPRINT
 extern void XpExtensionInit(INITARGS);
@@ -606,7 +606,7 @@ InitExtensions(argc, argv)
     if (!noSecurityExtension) SecurityExtensionInit();
 #endif
 #ifdef XSELINUX
-    XSELinuxExtensionInit();
+    SELinuxExtensionInit();
 #endif
 #ifdef XPRINT
     XpExtensionInit(); /* server-specific extension, cannot be disabled */
@@ -703,7 +703,7 @@ static ExtensionModule staticExtensions[] = {
     { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
 #endif
 #ifdef XSELINUX
-    { XSELinuxExtensionInit, XSELINUX_EXTENSION_NAME, NULL, NULL, NULL },
+    { SELinuxExtensionInit, SELINUX_EXTENSION_NAME, NULL, NULL, NULL },
 #endif
 #ifdef XPRINT
     { XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL },
commit f4bc333fc1e8d9fa9911771d2072df4df741c553
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Dec 28 11:56:54 2007 -0500

    xselinux: don't FatalError on an invalid class mapping, just disable support.

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index d7c7322..f3a8457 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1376,15 +1376,20 @@ XSELinuxExtensionInit(INITARGS)
 
     /* Setup SELinux stuff */
     if (!is_selinux_enabled()) {
-        ErrorF("XSELinux: Extension failed to load: SELinux not enabled\n");
+        ErrorF("XSELinux: SELinux not enabled, disabling SELinux support.\n");
         return;
     }
 
     selinux_set_callback(SELINUX_CB_LOG, (union selinux_callback)SELinuxLog);
     selinux_set_callback(SELINUX_CB_AUDIT, (union selinux_callback)SELinuxAudit);
 
-    if (selinux_set_mapping(map) < 0)
+    if (selinux_set_mapping(map) < 0) {
+	if (errno == EINVAL) {
+	    ErrorF("XSELinux: Invalid object class mapping, disabling SELinux support.\n");
+	    return;
+	}
 	FatalError("XSELinux: Failed to set up security class mapping\n");
+    }
 
     if (avc_open(NULL, 0) < 0)
 	FatalError("XSELinux: Couldn't initialize SELinux userspace AVC\n");
commit f3780ece528ed3ead809ba6a388fa0f8aab2a775
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Dec 20 20:32:07 2007 -0500

    xselinux: Implement swapped protocol request logic.

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index bbd8d1a..d7c7322 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1199,68 +1199,81 @@ SProcSELinuxSetSelectionManager(ClientPtr client)
 }
 
 static int
-SProcSELinuxGetSelectionManager(ClientPtr client)
-{
-    return ProcSELinuxGetSelectionManager(client);
-}
-
-static int
 SProcSELinuxSetDeviceCreateContext(ClientPtr client)
 {
-    return ProcSELinuxSetDeviceCreateContext(client);
-}
+    REQUEST(SELinuxSetCreateContextReq);
+    int n;
 
-static int
-SProcSELinuxGetDeviceCreateContext(ClientPtr client)
-{
-    return ProcSELinuxGetDeviceCreateContext(client);
+    REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
+    swaps(&stuff->context_len,n);
+    return ProcSELinuxSetDeviceCreateContext(client);
 }
 
 static int
 SProcSELinuxSetDeviceContext(ClientPtr client)
 {
+    REQUEST(SELinuxSetContextReq);
+    int n;
+
+    REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
+    swapl(&stuff->id,n);
+    swaps(&stuff->context_len,n);
     return ProcSELinuxSetDeviceContext(client);
 }
 
 static int
 SProcSELinuxGetDeviceContext(ClientPtr client)
 {
+    REQUEST(SELinuxGetContextReq);
+    int n;
+
+    REQUEST_SIZE_MATCH(SELinuxGetContextReq);
+    swapl(&stuff->id,n);
     return ProcSELinuxGetDeviceContext(client);
 }
 
 static int
 SProcSELinuxSetPropertyCreateContext(ClientPtr client)
 {
-    return ProcSELinuxSetPropertyCreateContext(client);
-}
+    REQUEST(SELinuxSetCreateContextReq);
+    int n;
 
-static int
-SProcSELinuxGetPropertyCreateContext(ClientPtr client)
-{
-    return ProcSELinuxGetPropertyCreateContext(client);
+    REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
+    swaps(&stuff->context_len,n);
+    return ProcSELinuxSetPropertyCreateContext(client);
 }
 
 static int
 SProcSELinuxGetPropertyContext(ClientPtr client)
 {
+    REQUEST(SELinuxGetPropertyContextReq);
+    int n;
+
+    REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
+    swapl(&stuff->window,n);
+    swapl(&stuff->property,n);
     return ProcSELinuxGetPropertyContext(client);
 }
 
 static int
 SProcSELinuxSetWindowCreateContext(ClientPtr client)
 {
-    return ProcSELinuxSetWindowCreateContext(client);
-}
+    REQUEST(SELinuxSetCreateContextReq);
+    int n;
 
-static int
-SProcSELinuxGetWindowCreateContext(ClientPtr client)
-{
-    return ProcSELinuxGetWindowCreateContext(client);
+    REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
+    swaps(&stuff->context_len,n);
+    return ProcSELinuxSetWindowCreateContext(client);
 }
 
 static int
 SProcSELinuxGetWindowContext(ClientPtr client)
 {
+    REQUEST(SELinuxGetContextReq);
+    int n;
+
+    REQUEST_SIZE_MATCH(SELinuxGetContextReq);
+    swapl(&stuff->id,n);
     return ProcSELinuxGetWindowContext(client);
 }
 
@@ -1278,11 +1291,11 @@ SProcSELinuxDispatch(ClientPtr client)
     case X_SELinuxSetSelectionManager:
 	return SProcSELinuxSetSelectionManager(client);
     case X_SELinuxGetSelectionManager:
-    	return SProcSELinuxGetSelectionManager(client);
+    	return ProcSELinuxGetSelectionManager(client);
     case X_SELinuxSetDeviceCreateContext:
     	return SProcSELinuxSetDeviceCreateContext(client);
     case X_SELinuxGetDeviceCreateContext:
-    	return SProcSELinuxGetDeviceCreateContext(client);
+    	return ProcSELinuxGetDeviceCreateContext(client);
     case X_SELinuxSetDeviceContext:
     	return SProcSELinuxSetDeviceContext(client);
     case X_SELinuxGetDeviceContext:
@@ -1290,13 +1303,13 @@ SProcSELinuxDispatch(ClientPtr client)
     case X_SELinuxSetPropertyCreateContext:
     	return SProcSELinuxSetPropertyCreateContext(client);
     case X_SELinuxGetPropertyCreateContext:
-    	return SProcSELinuxGetPropertyCreateContext(client);
+    	return ProcSELinuxGetPropertyCreateContext(client);
     case X_SELinuxGetPropertyContext:
     	return SProcSELinuxGetPropertyContext(client);
     case X_SELinuxSetWindowCreateContext:
     	return SProcSELinuxSetWindowCreateContext(client);
     case X_SELinuxGetWindowCreateContext:
-    	return SProcSELinuxGetWindowCreateContext(client);
+    	return ProcSELinuxGetWindowCreateContext(client);
     case X_SELinuxGetWindowContext:
     	return SProcSELinuxGetWindowContext(client);
     default:
commit 1bbf64ab115e2a1121d6f9c0830b1b977f025178
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Dec 20 20:31:34 2007 -0500

    xselinux: Remove unnecessary structure definition.

diff --git a/Xext/xselinux.h b/Xext/xselinux.h
index ebcc4aa..9800d5a 100644
--- a/Xext/xselinux.h
+++ b/Xext/xselinux.h
@@ -139,20 +139,6 @@ typedef struct {
 } SELinuxGetContextReq;
 
 typedef struct {
-    CARD8   type;
-    CARD8   pad1;
-    CARD16  sequenceNumber;
-    CARD32  length;
-    CARD16  context_len;
-    CARD16  pad2;
-    CARD32  pad3;
-    CARD32  pad4;
-    CARD32  pad5;
-    CARD32  pad6;
-    CARD32  pad7;
-} SELinuxGetContextReply;
-
-typedef struct {
     CARD8   reqType;
     CARD8   SELinuxReqType;
     CARD16  length;
@@ -172,7 +158,7 @@ typedef struct {
     CARD32  pad5;
     CARD32  pad6;
     CARD32  pad7;
-} SELinuxGetPropertyContextReply;
+} SELinuxGetContextReply;
 
 
 /* Private Flask definitions */


More information about the xorg-commit mailing list