[PATCH] os: Treat ssh as a non-local client

walter harms wharms at bfs.de
Tue Dec 8 11:09:56 PST 2015



Am 08.12.2015 19:55, schrieb Adam Jackson:
> By the time we get to ComputeLocalClient, we've already done
> NextAvailableClient → ReserveClientIds → DetermineClientCmd (assuming
> we're built with #define CLIENTIDS), so we can look up the name of the
> client process and refuse to treat ssh's X forwarding as if it were
> local.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  os/access.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/os/access.c b/os/access.c
> index 10a48c3..f9619ae 100644
> --- a/os/access.c
> +++ b/os/access.c
> @@ -1081,9 +1081,8 @@ ResetHosts(const char *display)
>      }
>  }
>  
> -/* Is client on the local host */
> -Bool
> -ComputeLocalClient(ClientPtr client)
> +static Bool
> +xtransLocalClient(ClientPtr client)
>  {
>      int alen, family, notused;
>      Xtransaddr *from = NULL;
> @@ -1116,6 +1115,20 @@ ComputeLocalClient(ClientPtr client)
>      return FALSE;
>  }
>  

unfortunately, that means if my client is called
"the_exceptional_secure_shell" it would break, right ?

there i would ask, could that be made on option ?
(default value e.g. ssh) other programms may benefit
also.


re,
 wh



> +/* Is client on the local host */
> +Bool
> +ComputeLocalClient(ClientPtr client)
> +{
> +    if (!xtransLocalClient(client))
> +        return FALSE;
> +
> +    if (client->clientIds)
> +        if (!strncmp(client->clientIds->cmdname, "ssh", 3))
> +            return FALSE;
> +
> +    return TRUE;
> +}
> +
>  /*
>   * Return the uid and all gids of a connected local client
>   * Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds


More information about the xorg-devel mailing list