[PATCHv2 xts] Set XT_DISPLAYHOST for remote connections

Aaron Plattner aplattner at nvidia.com
Tue Feb 19 13:39:47 PST 2013


On 01/07/2013 12:47 PM, Peter Harris wrote:
> Xlib3/XOpenDisplay may segfault if XT_DISPLAY is set and XT_DISPLAYHOST
> is not.
>
> Signed-off-by: Peter Harris <pharris at opentext.com>
> ---

Pushed, 6fc68f..f98e350.

> This version works with IPv6 literal addresses. XOpenDisplay still
> parses them incorrectly, but at least it doesn't crash.
>
>   xts5/bin/xts-config.in |    8 ++++++++
>   1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/xts5/bin/xts-config.in b/xts5/bin/xts-config.in
> index 9e30b5f..e22ba56 100755
> --- a/xts5/bin/xts-config.in
> +++ b/xts5/bin/xts-config.in
> @@ -99,6 +99,14 @@ BEGIN
>   	}
>   	else
>   	{
> +		$::vars{"XT_TCP"} = "Yes";
> +		my $hostname = "";
> +		my $offset = rindex($::vars{"DISPLAY"}, ':');
> +		if ($offset >= 0) {
> +			$hostname = substr($::vars{"DISPLAY"}, 0, $offset);
> +		}
> +		$::vars{"XT_DISPLAYHOST"} = $hostname;
> +
>   		# Not a local display; admin is responsible for placing
>   		# xtest fonts on the font path before running xts-config.
>   		$::vars{"XT_FONTPATH"} = $::vars{"XT_FONTPATH_GOOD"};
>


-- 
Aaron


More information about the xorg-devel mailing list