File p_xauth.diff of Package xorg-x11-libX11-unstable-devel

--- lib/X11/ConnDis.c	25 Nov 2004 16:47:38 -0000	1.1.1.13
+++ src/ConnDis.c	26 Jul 2005 14:39:07 -0000
@@ -429,15 +429,24 @@
     *dpynump = idisplay;
     *screenp = iscreen;
     if (pprotocol) Xfree (pprotocol);
-    if (phostname) Xfree (phostname);
     if (pdpynum) Xfree (pdpynum);
     if (pscrnum) Xfree (pscrnum);
 #ifdef TCPCONN
     if (tcphostname) Xfree (tcphostname);
 #endif
-
     GetAuthorization(trans_conn, family, (char *) saddr, saddrlen, idisplay,
 		     auth_namep, auth_namelenp, auth_datap, auth_datalenp);
+    if (!(*auth_datalenp) && !phostname && family == FamilyLocal) {
+	char *env;
+	if ((env = getenv("XAUTHLOCALHOSTNAME")) != NULL) {
+	    char *addr = strdup(env);
+	    GetAuthorization(trans_conn, family, addr, strlen(addr),
+			 idisplay, auth_namep, auth_namelenp,
+			     auth_datap, auth_datalenp);
+	}
+    }
+    if (phostname) Xfree (phostname);
+	
     return trans_conn;
 
 
openSUSE Build Service is sponsored by