Bug 546 - XOpenDisplay should try tcp connection if local connections fail
Summary: XOpenDisplay should try tcp connection if local connections fail
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: 6.7.0
Hardware: All All
: low minor
Assignee: Alan Coopersmith
QA Contact:
Depends on:
Reported: 2004-04-25 03:55 UTC by Alan Coopersmith
Modified: 2004-05-21 19:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Patch to xc/lib/X11/ConnDis.c (1.07 KB, patch)
2004-04-25 03:57 UTC, Alan Coopersmith
no flags Details | Splinter Review

Description Alan Coopersmith 2004-04-25 03:55:15 UTC
[Originally reported against Solaris as Sun bug id #4624183, fixed in Solaris 9.]

If you specify no hostname in your display (i.e. "DISPLAY=:0"), Xlib will try to
connect via local connections such as Unix domain sockets or pipes.  If neither
of those works it gives up.  If you instead specify the display as hostname:0 it
will fall back to attempting to connect to TCP.  It should also attempt this fall
back for the no-hostname case, for dealing with programs such as xscope which only
open TCP sockets, or for X servers started with -nolisten options to prevent use
of the local transports.

Test Case:
Start an Xnest on :5 with -nolisten options appropriate for your platform to 
disable local transports (or simply rm /tmp/.X11-*/X5 after starting it).
Run 'xdpyinfo -display :5' and see if it can connect or not - after this patch
is applied, it should be able to connect.
Comment 1 Alan Coopersmith 2004-04-25 03:57:41 UTC
Created attachment 232 [details] [review]
Patch to xc/lib/X11/ConnDis.c
Comment 2 Alan Coopersmith 2004-05-23 05:28:56 UTC
Fix committed to CVS head:

Changes by:	alanc at pdx.	04/04/24 16:39:25

Log message:
  	* xc/lib/X11/ConnDis.c
  	Bugzilla #546: XOpenDisplay should try tcp connection if local
  	connections fail (aka Sun bug id #4624183).
  	Also includes fix from NetBSD Problem Report #25098 (Michael van Elst)
  	(Xlib segfaults with IPv6 if compiled with HASXDMAUTH).
  	* xc/config/cf/sunLib.tmpl
  	* xc/lib/FS/Imakefile
  	Add missing shared library dependencies for Solaris

Modified files:
  Revision      Changes    Path
  1.3           +37 -3     xc/config/cf/sunLib.tmpl
  1.3           +5 -0      xc/lib/FS/Imakefile
  1.3           +19 -14    xc/lib/X11/ConnDis.c

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.