From 41d5f75141d054d72d05ddbd1d4535e458be5f3a Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 6 Mar 2013 22:53:57 +0100 Subject: [PATCH 3/3] Fixes: - fixed comparing ipv4 localhost - get_peer_pid_from_tcp_handle(): disable ipv6 handling because ipv6 do not works currently - _dbus_read_credentials_socket(): do not return error when not getting peers pid --- dbus/dbus-sysdeps-win.c | 17 +++++++++++------ 1 Datei geändert, 11 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 50754c8..1a34f90 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -151,7 +151,7 @@ dbus_pid_t get_peer_pid_from_tcp_handle(int handle) DWORD size; MIB_TCPTABLE2 *tcp_table; int i; - int localhost; + int localhost = 0; getpeername (handle, (struct sockaddr*)&addr, &len); @@ -160,13 +160,18 @@ dbus_pid_t get_peer_pid_from_tcp_handle(int handle) { struct sockaddr_in *s = (struct sockaddr_in *)&addr; peer_port = ntohs (s->sin_port); - localhost = s->sin_addr.s_addr == INADDR_LOOPBACK; + localhost = htonl(s->sin_addr.s_addr) == INADDR_LOOPBACK; } else { /* AF_INET6 */ - struct sockaddr_in6 *s = (struct sockaddr_in6 *)&addr; - peer_port = ntohs (s->sin6_port); - localhost = memcmp(s->sin6_addr.s6_addr, in6addr_loopback.s6_addr, 16) == 0; + _dbus_verbose ("FIXME [61922]: IPV6 support not working on windows"); + return 0; + /* + struct sockaddr_in6 *s = (struct sockaddr_in6 *)&addr; + peer_port = ntohs (s->sin6_port); + localhost = memcmp(s->sin6_addr.s6_addr, in6addr_loopback.s6_addr, 16) == 0; + _dbus_verbose ("IPV6 %08x %08x", s->sin6_addr.s6_addr, in6addr_loopback.s6_addr); + */ } if (!localhost) @@ -1810,7 +1815,7 @@ _dbus_read_credentials_socket (int handle, pid = get_peer_pid_from_tcp_handle (handle); if (pid == 0) - return FALSE; + return TRUE; _dbus_credentials_add_unix_pid (credentials, pid); -- 1.7.10.4