summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-04-06 03:31:23 +0200
committerJulien Danjou <julien@danjou.info>2009-04-06 16:53:11 +0200
commit6e2e87d0bbdff87f127986a0666445160d52e6a5 (patch)
treee1b7df05e5a6c93bc73d5b010aa4be8bab36eed5
parentf916062edf0e04cd4e0a78f6975892f59fae3b60 (diff)
Local socket connections do not work on hurd-i386
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>
-rw-r--r--src/xcb_auth.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index 58dfe3a..93a6f68 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -243,7 +243,14 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
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)