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

333 Коммитов

Автор SHA1 Сообщение Дата
Jacob Nevins 01c4c363d9 Initialise (struct Socket_tag).connected in sk_newlistener() since Valgrind
complained.
(I _think_ this is the correct initialisation.)

[originally from svn r5299]
2005-02-14 15:03:32 +00:00
Simon Tatham 7109d413b4 Oh, and (there's always one) remove the unnecessary extra parameter
from unix_setup_config_box().

[originally from svn r5293]
2005-02-14 07:44:50 +00:00
Simon Tatham b75856edfa Saw uxcfg.c in half down the middle, to separate out config changes
that apply to all Unix-like systems from those which apply
specifically to the GTK front end.

[originally from svn r5292]
2005-02-14 07:41:41 +00:00
Simon Tatham 471624882b Reinstate the broken -e option in pterm. Also I've just worked out a
much better way of handling pty_argv which doesn't require uxpty.c
to be linked in to Unix PuTTY and PuTTYtel.

[originally from svn r5262]
2005-02-06 15:52:00 +00:00
Simon Tatham f5442209d4 Encapsulated most of the pty backend's variables into a proper data
structure, in preparation for wanting more than one of them in a
single process. This can't be done cleanly, because the whole
business with pty_pre_init pre-allocating the pty rather assumes we
want a known number of the things before we drop privileges; so
there's a horrid hack to make pty_pre_init work on platforms that
have at most one pty instance per process, but at the same time
things ought to work sensibly with more than one per process _if_
pty_pre_init isn't required.

[originally from svn r5261]
2005-02-06 15:14:34 +00:00
Simon Tatham 3fb9e2326d The pty backend won't _always_ be running under X, so it should be
possible to compile it without the WINDOWID variable.

[originally from svn r5259]
2005-02-06 13:33:41 +00:00
Simon Tatham fd961b398a When allocating BSD-style ptys, we should not be satisfied with a
/dev/ptyXX we can open: we must also check that we can open and use
the corresponding /dev/ttyXX, because if it's been left in the wrong
mode then we will look terribly silly when we fork and _then_
discover our pty is unusable.

[originally from svn r5257]
2005-02-05 15:33:36 +00:00
Ben Harris 3d44cb23c8 Use AF_UNIX, not AF_LOCAL, since the former is in POSIX and the latter is not.
[originally from svn r5220]
2005-01-28 11:47:33 +00:00
Ben Harris 865fbaa8ce Overhaul of client-side XDM-AUTHORIZATION-1:
* Make sk_getxdmdata() return an arbitrary string rather than two integers.
  This better matches the spec, even if the current version always returns
  six bytes
* On Unix, for PF_UNIX sockets, return a counter rather than a constant along
  with the PID.  This should allow multiple clients to connect within one
  second, and is what Xlib does.
* On Unix, interpret AF_INET6 addresses like Xlib does, returning the
  embedded IPv4 address for v4-mapped addresses, and six bytes of zeroes
  otherwise.  The latter is silly, but if I'm going to do anything more sane
  I need to check that X servers won't reject it.

[originally from svn r5219]
2005-01-28 11:39:45 +00:00
Ben Harris 5e35aa383a Buffer overruns are embarassing (even if caused by user error), so assert
that this one can't happen until I actually fix it.

[originally from svn r5217]
2005-01-26 23:49:56 +00:00
Ben Harris 3f725a56ef Move sockaddr_is_loopback() to before sk_address_is_local(), and define the
latter in terms of the former.  Also adjust the definition of
ipv4_is_loopback() to avoid using the non-standard inet_netof() and
IN_LOOPBACKNET, and move it next to its remaining uses.

[originally from svn r5215]
2005-01-26 20:18:33 +00:00
Ben Harris 15e7d71f39 When checking if a connection comes from localhost, don't assume it's an IPv4
connection.  Instead, correctly check IPv4 and IPv6 connections, assume that
AF_LOCAL is always local, and anything else is always remote.

This makes trivial local-to-remote forwarding work on my system.

[originally from svn r5180]
2005-01-23 14:31:08 +00:00
Ben Harris 30fae9ffcb When calling getaddrinfo() for a listening socket, pass in a suggested type
of SOCK_STREAM, since that's what we'll be using.

[originally from svn r5170]
2005-01-22 15:32:10 +00:00
Ben Harris a54961fe87 Stupid typo, spotted by GCC.
[originally from svn r5168]
2005-01-22 15:20:35 +00:00
Ben Harris 258a87361a If getaddrinfo() fails, it's not safe to dereference the struct addrinfo* it
passes back to us, so don't.

[originally from svn r5167]
2005-01-22 15:19:21 +00:00
Ben Harris 961319c14c Dispose of a variable whose only use was being set to zero.
[originally from svn r5156]
2005-01-20 21:45:42 +00:00
Simon Tatham f70efc5cc6 Support for falling back through the list of addresses returned from
a DNS lookup, whether they're IPv4, v6 or a mixture of both.

[originally from svn r5119]
[this svn revision also touched putty-wishlist]
2005-01-16 14:29:34 +00:00
Simon Tatham 8167dfd406 Rewrite of Unix sk_newlistener() which should fix any possible
problems involving trying to bind an IPv6 socket to an IPv4 address.

[originally from svn r5115]
2005-01-16 12:37:19 +00:00
Ben Harris 178a66ea0f Turn of ICRNL in the client tty when we're not in editing mode. This
means that we send literal CRs and let the remote pty layer work out what to
do with them, so that if it wants raw mode it can have it.

[originally from svn r5114]
2005-01-15 20:39:27 +00:00
Ben Harris b4f0ffc2bf INADDR_NONE is nonstandard. Use (in_addr_t)(-1) instead.
[originally from svn r5109]
2005-01-14 19:28:18 +00:00
Simon Tatham 378dbbb06b sk_namelookup() on Unix was failing to translate from our platform-
independent ADDRTYPE_* constants to real AF_* ones, causing explicit
protocol specification to fail.

[originally from svn r5089]
2005-01-09 14:55:55 +00:00
Owen Dunn 06434ffc71 New function ltime() returns a struct tm of the current local time.
Fixes crashes when time() returns (time_t)-1 on Windows by using the
Win32 GetLocalTime() function.  (The Unix implementation still just 
uses time() and localtime().)

[originally from svn r5086]
2005-01-09 14:27:48 +00:00
Simon Tatham 3669401216 Having laboriously constructed a hints parameter for getaddrinfo, it
would help to _use_ it!

[originally from svn r5085]
2005-01-09 11:58:36 +00:00
Simon Tatham e6dd93c25a Don't forget to initialise ret->ai to NULL in sk_nonamelookup. Was
causing segfaults in IPv6-enabled Unix PuTTY connecting through a
proxy when letting the proxy do the DNS.

[originally from svn r5064]
2005-01-04 17:39:35 +00:00
Ben Harris 8053aea360 If we're going to use select(), we need <sys/select.h>.
[originally from svn r5063]
2005-01-04 14:37:32 +00:00
Simon Tatham b93e12d477 It's a new year!
[originally from svn r5061]
[this svn revision also touched putty-website]
2005-01-02 09:19:14 +00:00
Simon Tatham c64ad3bb0c Rename some of the more stupidly named files in the Unix back end.
Notably pterm.c, which was a sensible name right at the start but
became a misnomer as soon as I created Unix PuTTY.

[originally from svn r5053]
2004-12-31 13:02:46 +00:00
Ben Harris bb4b9039b4 If we're going to define _XOPEN_SOURCE, we should at least define it to a
version that includes putenv().  Make it 600 (the current one) for good
measure.

[originally from svn r5048]
2004-12-30 17:29:54 +00:00
Simon Tatham 6daf6faede Integrate unfix.org's IPv6 patches up to level 10, with rather a lot
of polishing to bring them to what I think should in principle be
release quality. Unlike the unfix.org patches themselves, this
checkin enables IPv6 by default; if you want to leave it out, you
have to build with COMPAT=-DNO_IPV6.

I have tested that this compiles on Visual C 7 (so the nightlies
_should_ acquire IPv6 support without missing a beat), but since I
don't have IPv6 set up myself I haven't actually tested that it
_works_. It still seems to make correct IPv4 connections, but that's
all I've been able to verify for myself. Further testing is needed.

[originally from svn r5047]
[this svn revision also touched putty-wishlist]
2004-12-30 16:45:11 +00:00
Simon Tatham b0bf176dfb Loose end from r5031: the Kex panel should only be displayed in
mid-session if we are not using SSHv1. I've done this by introducing
a generic `cfg_info' function which every back end can use to
communicate an int's worth of data to setup_config_box; in SSH
that's the protocol version in use, and in everything else it's
currently zero.

[originally from svn r5040]
[r5031 == d77102a8d5]
2004-12-29 12:32:25 +00:00
Jacob Nevins 3c98d6e60d Add a preference list for SSH-2 key exchange algorithms, on a new "Kex" panel
(which will gain more content anon).

Retire BUG_SSH2_DH_GEX and add a backwards-compatibility wart, since we never
did find a way of automatically detecting this alleged server bug, and in any
case there was only ever one report (<3D91F3B5.7030309@inwind.it>, FWIW).

Also generalise askcipher() to a new askalg() (thus touching all the
front-ends).

I've made some attempt to document what SSH key exchange is and why you care,
but it could use some review for clarity (and outright lies).

[originally from svn r5022]
2004-12-23 02:24:07 +00:00
Jacob Nevins a27ce0492b Fix line cursor colours (fallout from `256-colours'), on both Windows and Unix.
[originally from svn r5012]
2004-12-19 22:37:05 +00:00
Simon Tatham b3b70d749f Jacob has pointed out why SIGCHLD was blocked, so I've updated the
comment when I unblock it in pty.c to reflect reality. Also I've
moved block_signal() out of pterm.c into signal.c, so I can
conveniently use it for unblocking SIGCHLD rather than having to
reinvent it in pty.c.

[originally from svn r5006]
2004-12-17 14:25:53 +00:00
Simon Tatham ebf507497d Apparently SIGCHLD is blocked by default in processes run in a
pterm, which was breaking my bash job notification patch. This is
apparently not the case for xterm, so I've fiddled with it. Not
entirely sure _why_ it did this in the first place, but there we go.

[originally from svn r4997]
2004-12-17 09:43:09 +00:00
Simon Tatham 6c81ee6706 General mechanism for ensuring a dodgy SFTP server can't return
malicious filenames via FXP_READDIR.

[originally from svn r4995]
2004-12-16 19:36:47 +00:00
Simon Tatham f1585f8f46 Jacob points out that I introduced a bug in PSFTP when I did the
timing shakeup: just running `psftp' caused the net/stdin select
loop (on both Unix and Windows) to get confused at the lack of any
network connection and give up immediately. Should now be fixed.

[originally from svn r4993]
2004-12-16 19:15:38 +00:00
Simon Tatham a4fe439184 Implement mget and mput in PSFTP, supporting wildcards.
[originally from svn r4991]
[this svn revision also touched putty-wishlist]
2004-12-16 17:35:20 +00:00
Simon Tatham 6ef62aacfc Unix PSCP was tight-looping when connecting through a ProxyCommand.
Turned out that sk_localproxy_close() was closing the pipe fds
without removing them from the uxsel list.

[originally from svn r4965]
2004-12-10 11:41:14 +00:00
Owen Dunn 30e94b6a5c Fix segfault when HOME not set on Unix.
[originally from svn r4948]
2004-12-07 11:50:44 +00:00
Jacob Nevins 4cb0ead447 Another default-background fix for 256-colour mode
[originally from svn r4931]
2004-11-30 01:07:29 +00:00
Simon Tatham 0600e8cf75 Bah, there's always one thing I miss. Correct the background-colour
handling in Unix PuTTY.

[originally from svn r4918]
2004-11-28 15:18:23 +00:00
Simon Tatham e4e10e494b Implement xterm 256-colour mode.
[originally from svn r4917]
[this svn revision also touched putty-wishlist]
2004-11-28 15:13:34 +00:00
Simon Tatham 92f3b101f5 Slight improvement to cursor blink timing: since the cursor doesn't
blink when the window doesn't have focus, we don't schedule blink
timers at that point either.

Infrastructure change: term->has_focus should now not be written
directly from outside terminal.c. Instead, use the function
term_set_focus, which will sort out the blink timers as well.

[originally from svn r4911]
2004-11-27 19:34:45 +00:00
Simon Tatham 7ecf13564a New timing infrastructure. There's a new function schedule_timer()
which pretty much any module can call to request a call-back in the
future. So terminal.c can do its own handling of blinking, visual
bells and deferred screen updates, without having to rely on
term_update() being called 50 times a second (fixes: pterm-timer);
and ssh.c and telnet.c both invoke a new module pinger.c which takes
care of sending keepalives, so they get sent uniformly in all front
ends (fixes: plink-keepalives, unix-keepalives).

[originally from svn r4906]
[this svn revision also touched putty-wishlist]
2004-11-27 13:20:21 +00:00
Simon Tatham 1aa64afc30 I think rjk meant `setpgid', not `setpgrp'.
[originally from svn r4897]
2004-11-24 11:42:45 +00:00
Simon Tatham 4f197b872e RJK's OS X portability patch:
- initialise blank mbstate_t using memset rather than an ad-hoc
   initialiser.
 - expand the OMIT_UTMP ifdefs to enclose a load of entire functions
   that would generate `static function never called' warnings if
   left as empty shells.
 - couple of other fiddly things.

[originally from svn r4896]
2004-11-24 11:36:08 +00:00
Jacob Nevins 739de21c6d console_get_line() returns failure iff console_batch_mode is set, whereas
before is would return success and the empty string. IMO this makes `-batch'
much more useful; before, utilities such as Plink in `-batch' mode would
attempt to plough on using empty strings for usernames, passwords, and so on.

[originally from svn r4832]
2004-11-19 21:05:31 +00:00
Simon Tatham 8a99993c88 Remove .cvsignore files on all active branches.
[originally from svn r4788]
[this svn revision also touched bmbm,caltrap,charset,enigma,filter,fonts,golem,grunge,halibut,html,lj,local,misc,polyhedra,putty-website,putty-wishlist,puzzles,pycee,sdlgames,svn-tools,timber,tweak]
2004-11-16 15:29:14 +00:00
Jacob Nevins 17b0d8c58e Support the SSH-2 mechanism for sending signals to a running session. Neither
of the SSH servers I conveniently have access to (Debian stable OpenSSH --
3.4p1 -- and lshd) seem to take a blind bit of notice, but the channel
requests look fine to me in the packet log.

I've included all the signals explicitly defined by
draft-ietf-secsh-connect-19, but I've put the more obscure ones in a submenu
of the specials menu; there's therefore been some minor upheaval to support
such submenus.

[originally from svn r4652]
2004-10-17 21:22:22 +00:00
Jacob Nevins 4482a79162 Telnet specials menu was not being reinstated after a session was restarted in
the same window (Windows version only).

Policy change: it's now the backend's responsibility to call
update_specials_menu() at the start of a session (or whenever it feels ready),
if it has any special commands. Otherwise the menu won't be displayed.

[originally from svn r4649]
2004-10-17 14:44:27 +00:00