[PATCHv2 xts] Set XT_DISPLAYHOST for remote connections

Peter Harris pharris at opentext.com
Mon Jan 7 12:47:37 PST 2013


Xlib3/XOpenDisplay may segfault if XT_DISPLAY is set and XT_DISPLAYHOST
is not.

Signed-off-by: Peter Harris <pharris at opentext.com>
---
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"};
-- 
1.7.2.5



More information about the xorg-devel mailing list