[PATCH 39/42] Hide local-only extensions from remote clients
Daniel Stone
daniel at fooishbar.org
Fri Dec 2 03:27:47 PST 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>
Reviewed-by: Jamey Sharp <jamey at minilop.net>
---
dix/extension.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dix/extension.c b/dix/extension.c
index 2e74bcc..1706790 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -272,7 +272,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
{
@@ -309,7 +310,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;
@@ -324,7 +326,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.7.3
More information about the xorg-devel
mailing list