Граф коммитов

18 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 22d8cfe36f Missed out a couple of uxsel_tell() which were hanging forwarded X
connections in at least some situations. Oops.

[originally from svn r3128]
2003-04-18 09:00:37 +00:00
Ben Harris d66a1d685f Replace use of FIONBIO with POSIX-approved O_NONBLOCK (set using fcntl()).
This should save us having to worry about different OSs' defining it in
different headers.

[originally from svn r3126]
2003-04-16 23:58:59 +00:00
Ben Harris e7c7f5e3f8 Make IPv6 support for Unix work, and make it a lot simpler in the process.
At the moment, we have to assume that getaddrinfo() will only return AF_INET
and AF_INET6 addresses, since we patch in the port number into the sockaddr
later.  Fixing this is probably best done by redesigning the PuTTY network
abstraction a little.

[originally from svn r3125]
2003-04-16 23:33:44 +00:00
Simon Tatham b109918032 Added uxsel.c, into which I've moved those parts of the uxnet.c
functionality that deal with selectable fds in general. The idea is
that pty.c will stop passing its fd straight to pterm.c and hand it
to this module instead, and pterm.c will start requesting a general
list of fds from this module rather than expecting a single one from
pty.c, with the ultimate aim of pterm.c being able to form the basis
of a Unix PuTTY as well as pterm proper.

[originally from svn r3015]
2003-03-29 16:47:06 +00:00
Simon Tatham d36a4c3685 Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're
allocating the size of. Should prevent any future errors involving
mallocing the size of the wrong structure type, and will also make
life easier if we ever need to turn the PuTTY core code from real C
into C++-friendly C. I haven't touched the Mac frontend in this
checkin because I couldn't compile or test it.

[originally from svn r3014]
2003-03-29 16:14:26 +00:00
Simon Tatham 952857fca3 proxy.c now no longer refers to `cfg'. Instead, each of the three
proxy-indirection network functions (name_lookup, new_connection,
new_listener) takes a `const Config *' as an argument, and extracts
enough information from it before returning to handle that
particular network operation in accordance with the proxy settings
it specifies. This involved {win,ux}net.c due to a `const'
repercussion.

[originally from svn r2567]
2003-01-12 15:26:10 +00:00
Simon Tatham 87f9446a26 Support XDM-AUTHORIZATION-1 for connecting to local X servers. If
we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...

[originally from svn r2537]
2003-01-11 09:31:54 +00:00
Simon Tatham 86977efa81 Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)

[originally from svn r2536]
2003-01-10 18:33:35 +00:00
Simon Tatham f928707849 Support asynchronous connect() in Unix networking. Now a port
forwarding to a nonexistent host shouldn't hold up the rest of the
program.

[originally from svn r2514]
2003-01-09 18:14:24 +00:00
Simon Tatham 2435c54597 sk_nonamelookup() should ensure the sockaddr it returns has `error'
set to NULL. Otherwise it'll be random uninitialised goop. Not good.

[originally from svn r2416]
2003-01-02 10:07:50 +00:00
Simon Tatham a564ad3140 Support for doing DNS at the proxy end. I've invented a new type of
SockAddr, which just contains an unresolved hostname and is created
by a stub function in *net.c. It's an error to pass this to most of
the real-meat functions in *net.c; these fake addresses should have
been dealt with by the time they get down that far. proxy.c now
contains name_lookup(), a wrapper on sk_namelookup() which decides
whether or not to do real DNS, and the individual proxy
implementations each deal sensibly with being handed an unresolved
address and avoid ever passing one down to *net.c.

[originally from svn r2353]
2002-12-18 16:23:11 +00:00
Simon Tatham 8304f4e0dc Stop proxying connections to localhost by default; should fix
`x11-proxy-crash'.

[originally from svn r2348]
2002-12-18 12:18:54 +00:00
Simon Tatham 99b870dbc6 Implement `portfwd-loopback-choice'. Works on local side in Unix as
well, though it's a lot less useful since you still can't bind to
low-numbered ports of odd loopback IPs. Should work in principle for
SSH2 remote forwardings as well as local ones, but OpenSSH seems
unwilling to cooperate.

[originally from svn r2344]
2002-12-18 11:39:25 +00:00
Owen Dunn 269557cb64 Avoid potential memory leak.
[originally from svn r2278]
2002-12-04 12:53:42 +00:00
Owen Dunn cd3252bb66 Changed to use strerror()
[originally from svn r2276]
2002-12-04 12:39:32 +00:00
Simon Tatham fd3bc934d9 Improve handling of oobinline sockets; Plink in telnet mode now
doesn't hang when you hit ^C, which is nice. I think a better
solution would involve nonblocking sockets; as it stands it's a
little dependent on what may be quirks of the Linux socket layer.

[originally from svn r2175]
2002-11-01 13:36:48 +00:00
Simon Tatham 057eabf46d Stop the segfault on failure to resolve a host name.
[originally from svn r2170]
2002-11-01 12:54:22 +00:00
Simon Tatham 317180ed49 First attempt at a Unix port of Plink. Seems to basically work;
doesn't yet use the SSH agent, no way to specify arbitrary config
options, no manpage yet, couple of other fiddly things need doing,
but it makes SSH connections and doesn't fall over horribly so I say
it's a good start. Now to run it under valgrind...

[originally from svn r2165]
2002-10-31 19:49:52 +00:00