1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

If you configure Unix PuTTY to use a proxy, tell it to even proxy

localhost connections, and also enable X forwarding in such a way that
it will attempt to connect to a Unix-domain X server socket, an
assertion will fail when proxy_for_destination() tries to call
sk_getaddr(). Fix by ensuring that Unix-domain sockets are _never_
proxied, since they fundamentally can't be.

[originally from svn r9688]
This commit is contained in:
Simon Tatham 2012-10-16 20:15:51 +00:00
parent 36b8d450f0
commit 58870f60e4
4 changed files with 20 additions and 0 deletions

View File

@ -118,6 +118,7 @@ SockAddr sk_nonamelookup(const char *host);
void sk_getaddr(SockAddr addr, char *buf, int buflen);
int sk_hostname_is_local(char *name);
int sk_address_is_local(SockAddr addr);
int sk_address_is_special_local(SockAddr addr);
int sk_addrtype(SockAddr addr);
void sk_addrcopy(SockAddr addr, char *buf);
void sk_addr_free(SockAddr addr);

View File

@ -285,6 +285,15 @@ static int proxy_for_destination (SockAddr addr, char *hostname, int port,
int hostip_len, hostname_len;
const char *exclude_list;
/*
* Special local connections such as Unix-domain sockets
* unconditionally cannot be proxied, even in proxy-localhost
* mode. There just isn't any way to ask any known proxy type for
* them.
*/
if (addr && sk_address_is_special_local(addr))
return 0; /* do not proxy */
/*
* Check the host name and IP against the hard-coded
* representations of `localhost'.

View File

@ -390,6 +390,11 @@ int sk_address_is_local(SockAddr addr)
}
}
int sk_address_is_special_local(SockAddr addr)
{
return addr->superfamily == UNIX;
}
int sk_addrtype(SockAddr addr)
{
SockAddrStep step;

View File

@ -667,6 +667,11 @@ int sk_address_is_local(SockAddr addr)
}
}
int sk_address_is_special_local(SockAddr addr)
{
return 0; /* no Unix-domain socket analogue here */
}
int sk_addrtype(SockAddr addr)
{
SockAddrStep step;