[PATCH 35/37] Ignore local-only requests from remote clients

Jamey Sharp jamey at minilop.net
Thu Jun 30 13:52:12 PDT 2011


I think this needs to assign something to result if a non-local client
makes a local-only extension request, doesn't it? BadRequest, I think?

Also, you've changed whitespace styles relative to the surrounding code.
Dispatch() is sort of internally consistent-ish at using tabs for each
eight-space indent.

Jamey

On Tue, Jun 28, 2011 at 08:27:51PM +0100, Daniel Stone wrote:
> 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 |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/dix/dispatch.c b/dix/dispatch.c
> index 192c8c3..835a4e4 100644
> --- a/dix/dispatch.c
> +++ b/dix/dispatch.c
> @@ -427,10 +427,13 @@ Dispatch(void)
>  		if (result > (maxBigRequestSize << 2))
>  		    result = BadLength;
>  		else {
> -		    result = XaceHookDispatch(client, MAJOROP);
> -		    if (result == Success)
> -			result = (* client->requestVector[MAJOROP])(client);
> -		    XaceHookAuditEnd(client, result);
> +                    ExtensionEntry *ext = GetExtensionEntry(MAJOROP);
> +                    if (!ext || !ext->localOnly || LocalClient(client)) {
> +                        result = XaceHookDispatch(client, MAJOROP);
> +                        if (result == Success)
> +                            result = (* client->requestVector[MAJOROP])(client);
> +                        XaceHookAuditEnd(client, result);
> +                    }
>  		}
>  #ifdef XSERVER_DTRACE
>  		XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
> -- 
> 1.7.5.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110630/2ab4e68e/attachment.pgp>


More information about the xorg-devel mailing list