[PATCH 40/42] Ignore local-only requests from remote clients

Daniel Stone daniel at fooishbar.org
Fri Dec 2 03:27:48 PST 2011


Even though we hide local-only extensions from remote clients in the
extension list, make doubly sure they can't make a local-only request.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 dix/dispatch.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index b39271f..51b9033 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -432,10 +432,16 @@ Dispatch(void)
 		if (result > (maxBigRequestSize << 2))
 		    result = BadLength;
 		else {
-		    result = XaceHookDispatch(client, client->majorOp);
-		    if (result == Success)
-			result = (* client->requestVector[client->majorOp])(client);
-		    XaceHookAuditEnd(client, result);
+		    ExtensionEntry *ext = GetExtensionEntry(client->majorOp);
+		    if (ext && ext->localOnly && !LocalClient(client)) {
+			result = BadRequest;
+		    }
+		    else {
+			result = XaceHookDispatch(client, client->majorOp);
+			if (result == Success)
+			    result = (* client->requestVector[client->majorOp])(client);
+			XaceHookAuditEnd(client, result);
+		    }
 		}
 #ifdef XSERVER_DTRACE
 		XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), client->majorOp,
-- 
1.7.7.3



More information about the xorg-devel mailing list