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

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 6 16:10:39 PST 2011


On Fri, Dec 02, 2011 at 11:27:48AM +0000, 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>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter

> ---
>  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
> 
> _______________________________________________
> 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
> 


More information about the xorg-devel mailing list