Local socket connections currently do not work on hurd-i386 because
xcb_auth calls getpeername() on the client socket, but hurd-i386 does
not implement anything in that case (I actually wonder what reasonable
value could be returned). In such case the xcb code does not actually
need the peer name anyway.
Signed-off-by: Julien Danjou <julien@danjou.info>
int ret = 1;
if (getpeername(fd, sockname, &socknamelen) == -1)
- return 0; /* can only authenticate sockets */
+ {
+ if (getsockname(fd, sockname, &socknamelen) == -1)
+ return 0; /* can only authenticate sockets */
+ if (sockname->sa_family != AF_UNIX)
+ return 0;
+ /* Some systems like hpux or Hurd do not expose peer names
+ * for UNIX Domain Sockets. We do not need it anyway. */
+ }
authptr = get_authptr(sockname, socknamelen, display);
if (authptr == 0)