File bug-262309_xcb-xauthlocalhostname.diff of Package libxcb.34895

--- src/xcb_auth.c.orig	2009-05-29 17:48:24.000000000 +0200
+++ src/xcb_auth.c	2009-05-29 17:56:01.000000000 +0200
@@ -119,2 +119,3 @@ static Xauth *get_authptr(struct sockadd
     int dispbuflen;
+    Xauth *authptr = NULL;
 
@@ -163,6 +163,16 @@ static Xauth *get_authptr(struct sockadd
 
-    return XauGetBestAuthByAddr (family,
+    authptr = XauGetBestAuthByAddr (family,
                                  (unsigned short) addrlen, addr,
                                  (unsigned short) dispbuflen, dispbuf,
                                  N_AUTH_PROTOS, authnames, authnameslen);
+    // && !phostname
+    if ((!authptr || !authptr->data_length) && family == FamilyLocal) {
+        if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) {
+            authptr = XauGetBestAuthByAddr (family,
+                                           (unsigned short) strlen(addr), addr,
+                                           (unsigned short) dispbuflen, dispbuf,
+                                           N_AUTH_PROTOS, authnames, authnameslen);
+        }
+    }
+    return authptr;
 }
openSUSE Build Service is sponsored by