35 lines
1.4 KiB
Diff
35 lines
1.4 KiB
Diff
Index: src/xcb_auth.c
|
|
===================================================================
|
|
--- src/xcb_auth.c.orig
|
|
+++ src/xcb_auth.c
|
|
@@ -118,6 +118,7 @@ static Xauth *get_authptr(struct sockadd
|
|
char hostnamebuf[256]; /* big enough for max hostname */
|
|
char dispbuf[40]; /* big enough to hold more than 2^64 base 10 */
|
|
int dispbuflen;
|
|
+ Xauth *authptr = NULL;
|
|
|
|
family = FamilyLocal; /* 256 */
|
|
switch(sockname->sa_family)
|
|
@@ -162,10 +163,20 @@ static Xauth *get_authptr(struct sockadd
|
|
addrlen = strlen(addr);
|
|
}
|
|
|
|
- return XauGetBestAuthByAddr (family,
|
|
+ authptr = XauGetBestAuthByAddr (family,
|
|
(unsigned short) addrlen, addr,
|
|
(unsigned short) dispbuflen, dispbuf,
|
|
N_AUTH_PROTOS, (char **)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, (char **) authnames, authnameslen);
|
|
+ }
|
|
+ }
|
|
+ return authptr;
|
|
}
|
|
|
|
#ifdef HASXDMAUTH
|