Last change to non-XCB libX11 breaks KDE

Kean Johnston kean at armory.com
Tue Jul 17 16:18:15 PDT 2007


> By modifying the fullname to insert the hostname it creates an
> inconsistency, which thwarts the purpose of XDisplayString()
> completely. Either that or XDisplayString() should eb changed to
> simply return the value of $DISPLAY, like XDisplayName() does,
> and not the "canonical" name computed by _X11TransConnectDisplay().

FYI the patch below fixes the problem:

index 95a836d..8da5140 100644
--- a/src/ConnDis.c
+++ b/src/ConnDis.c
@@ -152,6 +152,7 @@ _X11TransConnectDisplay (
      int connect_stat;
  #ifdef LOCALCONN
      struct utsname sys;
+    Bool reset_hostname = False;       /* Reset hostname? */
  # ifdef UNIXCONN
      Bool try_unix_socket = False;      /* Try unix if local fails */
  # endif
@@ -245,6 +246,8 @@ #ifdef TCPCONN
         else
             tcphostname = copystring("localhost", 9);
  #endif
+       if (!phostname)
+           reset_hostname = True;
         Xfree (phostname);
         phostname = copystring ("unix", 4);
      }
@@ -429,6 +432,12 @@ #endif
       *
       *     [host] : [:] dpy . scr \0
       */
+#ifdef LOCALCONN
+    if (reset_hostname) {
+       Xfree (phostname);
+       phostname = NULL;
+    }
+#endif
      len = ((phostname ? strlen(phostname) : 0) + 1 + (dnet ? 1 : 0) +
            strlen(pdpynum) + 1 + (pscrnum ? strlen(pscrnum) : 1) + 1);
      *fullnamep = (char *) Xmalloc (len);




More information about the xorg mailing list