[PATCH 34/37] Hide local-only extensions from remote clients

Daniel Stone daniel at fooishbar.org
Tue Jun 28 12:27:50 PDT 2011


If an extension is declared as being for local use only, don't show it
to remote clients in the extension list.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 dix/extension.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dix/extension.c b/dix/extension.c
index 0fa177a..59b7849 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -286,7 +286,8 @@ ProcQueryExtension(ClientPtr client)
     else
     {
 	i = FindExtension((char *)&stuff[1], stuff->nbytes);
-        if (i < 0 || XaceHook(XACE_EXT_ACCESS, client, extensions[i]))
+        if (i < 0 || XaceHook(XACE_EXT_ACCESS, client, extensions[i]) ||
+            (extensions[i]->localOnly && !LocalClient(client)))
             reply.present = xFalse;
         else
         {            
@@ -323,7 +324,8 @@ ProcListExtensions(ClientPtr client)
         for (i=0;  i<NumExtensions; i++)
 	{
 	    /* call callbacks to find out whether to show extension */
-	    if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success)
+	    if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success ||
+                (extensions[i]->localOnly && !LocalClient(client)))
 		continue;
 
 	    total_length += strlen(extensions[i]->name) + 1;
@@ -338,7 +340,8 @@ ProcListExtensions(ClientPtr client)
         for (i=0;  i<NumExtensions; i++)
         {
 	    int len;
-	    if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success)
+	    if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success ||
+                (extensions[i]->localOnly && !LocalClient(client)))
 		continue;
 
             *bufptr++ = len = strlen(extensions[i]->name);
-- 
1.7.5.4



More information about the xorg-devel mailing list