u/mdw/putty
15 years agoAt last, merge the putty-gtk2 branch back into the trunk!
simon [Wed, 4 Jun 2008 23:05:48 +0000 (23:05 +0000)]
At last, merge the putty-gtk2 branch back into the trunk!

git-svn-id: svn://svn.tartarus.org/sgt/putty@8037 cda61777-01e9-0310-a592-d414129be87e

15 years agoBeen meaning to do this for years: introduce a configuration option
simon [Sun, 1 Jun 2008 11:16:32 +0000 (11:16 +0000)]
Been meaning to do this for years: introduce a configuration option
to manually tweak the host name and port number under which the SSH
host key is read and written.

I've put it in the cross-platform Connection panel. Partly under the
flimsy pretext that other backends _can_ use it if they so wish (and
in fact it overrides the host name for title-bar purposes in all
network backends, though it has no other effect in anything but
SSH); but mostly because the SSH panel was too full already :-)

git-svn-id: svn://svn.tartarus.org/sgt/putty@8033 cda61777-01e9-0310-a592-d414129be87e

15 years agoApparently Vista's printf-like functions don't support %n by default.
jacob [Sat, 31 May 2008 17:22:29 +0000 (17:22 +0000)]
Apparently Vista's printf-like functions don't support %n by default.
We could explicitly re-enable %n, but we only use it in one place, so take
the path of least resistance and remove that single instance. This stops
dupvprintf() getting stuck in a loop (a behaviour that's caused by a workaround
for a broken libc).

<http://msdn.microsoft.com/en-us/library/ms175782(VS.80).aspx>

git-svn-id: svn://svn.tartarus.org/sgt/putty@8030 cda61777-01e9-0310-a592-d414129be87e

15 years agoUpdate for `win-randseed-location' fix.
jacob [Sat, 31 May 2008 17:11:16 +0000 (17:11 +0000)]
Update for `win-randseed-location' fix.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8029 cda61777-01e9-0310-a592-d414129be87e

15 years agoOS X Leopard, it turns out, has a new and exciting strategy for
simon [Wed, 28 May 2008 19:23:57 +0000 (19:23 +0000)]
OS X Leopard, it turns out, has a new and exciting strategy for
addressing X displays. Update PuTTY's display-name-to-Unix-socket-
path translation code to cope with it, thus causing X forwarding to
start working again on Leopard.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8020 cda61777-01e9-0310-a592-d414129be87e

15 years agoUpdate the FAQ to state more explicitly that PuTTY contains no
simon [Wed, 21 May 2008 09:48:40 +0000 (09:48 +0000)]
Update the FAQ to state more explicitly that PuTTY contains no
OpenSSL code.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8004 cda61777-01e9-0310-a592-d414129be87e

16 years agoMention Vista.
jacob [Sat, 26 Apr 2008 18:45:06 +0000 (18:45 +0000)]
Mention Vista.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7993 cda61777-01e9-0310-a592-d414129be87e

16 years agoUtterly hideous new approach to extracting install-sh from the
simon [Fri, 11 Apr 2008 13:28:38 +0000 (13:28 +0000)]
Utterly hideous new approach to extracting install-sh from the
autoconf/automake edifice, since my previous approach of guessing
its pathname turns out not to work on at least one kind of system.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7984 cda61777-01e9-0310-a592-d414129be87e

16 years agoFix misleading parameter name.
jacob [Sat, 5 Apr 2008 12:26:49 +0000 (12:26 +0000)]
Fix misleading parameter name.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7970 cda61777-01e9-0310-a592-d414129be87e

16 years agoFor convenience of debugging, and perhaps some real convenience at
simon [Sat, 22 Mar 2008 12:01:16 +0000 (12:01 +0000)]
For convenience of debugging, and perhaps some real convenience at
some point too: introduce a bunch of environment variables which can
override Unix PuTTY's usual idea of where to find its dotfiles.
Setting PUTTYDIR moves the entire ~/.putty directory; setting
PUTTYSESSIONS, PUTTYSSHHOSTKEYS or PUTTYRANDOMSEED move specific
things within that directory.

While I'm here, also be prepared to fall back to password file
lookups if $HOME is undefined (though we still use $HOME in
preference when it is defined, because that's polite and useful).
Also, on general principles, tweak the make_filename() function
prototype so it doesn't rely on fixed-size buffers.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7934 cda61777-01e9-0310-a592-d414129be87e

16 years agoUnder OS X Leopard, we seem not to consistently get the Tab key
simon [Sun, 9 Mar 2008 15:32:20 +0000 (15:32 +0000)]
Under OS X Leopard, we seem not to consistently get the Tab key
translated for us. Be prepared to do it manually as a fallback.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7913 cda61777-01e9-0310-a592-d414129be87e

16 years agoFix a cursor positioning infelicity.
simon [Fri, 7 Mar 2008 18:30:37 +0000 (18:30 +0000)]
Fix a cursor positioning infelicity.

The scenario: I start a small, say 80x24, pterm. I do some work in
it, generating plenty of scrollback, and eventually I `less' a file.
`less' switches to the alt screen. Then I want more vertical space
to look at the file, so I enlarge the window to more like 80x60.
When I quit `less' and switch back to the primary screen, some
scrollback has been pulled down into the screen, as expected - but
the saved _cursor position_ is still at line 24, not at the bottom
of the new terminal where the prompt it goes with has moved to.

Solution: term_size() should adjust the alt-screen saved cursor
positions as well as the normal cursor position.

(Curiously, the problem doesn't happen on my home Debian box, even
without this fix. It happens on my RH9 box at work, though.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@7911 cda61777-01e9-0310-a592-d414129be87e

16 years agoIt's a new year (and we've even made a code checkin).
jacob [Sun, 24 Feb 2008 00:16:29 +0000 (00:16 +0000)]
It's a new year (and we've even made a code checkin).

git-svn-id: svn://svn.tartarus.org/sgt/putty@7883 cda61777-01e9-0310-a592-d414129be87e

16 years agoAttempt to clarify what the various IP version selection options do.
jacob [Sat, 23 Feb 2008 23:56:22 +0000 (23:56 +0000)]
Attempt to clarify what the various IP version selection options do.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7882 cda61777-01e9-0310-a592-d414129be87e

16 years agoTunnels: more explicit link from introductory to reference section.
jacob [Sat, 23 Feb 2008 22:00:48 +0000 (22:00 +0000)]
Tunnels: more explicit link from introductory to reference section.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7880 cda61777-01e9-0310-a592-d414129be87e

16 years agoAha, _that's_ why I've been periodically getting blocking-write
simon [Thu, 21 Feb 2008 09:18:24 +0000 (09:18 +0000)]
Aha, _that's_ why I've been periodically getting blocking-write
problems using Unix PuTTY port forwarding. Sockets we create by
connect() are immediately set into nonblocking mode by fcntl, but
sockets we create by accept() were not. This trivial fix should help.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7864 cda61777-01e9-0310-a592-d414129be87e

16 years agoUpdate web-SVN URL for kh2reg.py.
jacob [Sun, 10 Feb 2008 14:00:51 +0000 (14:00 +0000)]
Update web-SVN URL for kh2reg.py.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7843 cda61777-01e9-0310-a592-d414129be87e

16 years agoTypo in winadj@ name.
jacob [Wed, 9 Jan 2008 19:59:16 +0000 (19:59 +0000)]
Typo in winadj@ name.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7834 cda61777-01e9-0310-a592-d414129be87e

16 years agoMake the text about our interest in new mirror sites significantly
simon [Thu, 20 Dec 2007 11:03:45 +0000 (11:03 +0000)]
Make the text about our interest in new mirror sites significantly
less fluffy and welcoming.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7824 cda61777-01e9-0310-a592-d414129be87e

16 years agor7804 neglected to add a help context #define to winhelp.h.
simon [Sat, 15 Dec 2007 10:41:40 +0000 (10:41 +0000)]
r7804 neglected to add a help context #define to winhelp.h.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7815 cda61777-01e9-0310-a592-d414129be87e

16 years agoDocument maxpkt bug under garbled packet error message.
ben [Wed, 5 Dec 2007 00:28:22 +0000 (00:28 +0000)]
Document maxpkt bug under garbled packet error message.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7806 cda61777-01e9-0310-a592-d414129be87e

16 years agoAdd a new bug-compatibility mode that limits the window size we'll
ben [Wed, 5 Dec 2007 00:02:06 +0000 (00:02 +0000)]
Add a new bug-compatibility mode that limits the window size we'll
advertise so that the server can't exceed our maximum packet size.
Enable it for "1.36_sshlib GlobalSCAPE" which apparently sends oversize
packets otherwise.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7804 cda61777-01e9-0310-a592-d414129be87e

16 years agoDuplicate r7795 in uxnet.c.
simon [Wed, 28 Nov 2007 20:45:50 +0000 (20:45 +0000)]
Duplicate r7795 in uxnet.c.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7796 cda61777-01e9-0310-a592-d414129be87e

16 years agosktree is indexed on the numeric value of the socket structure's
simon [Mon, 26 Nov 2007 21:09:54 +0000 (21:09 +0000)]
sktree is indexed on the numeric value of the socket structure's
underlying WinSock SOCKET. Therefore, if we plan to modify the
SOCKET in a socket, we must remove it from the tree before doing so,
and put it back again afterwards. Otherwise it'll violate the tree's
sorting order, and sooner or later someone will try to find it and
get back NULL.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7795 cda61777-01e9-0310-a592-d414129be87e

16 years agoReset mouse reporting mode as part of resetting the terminal.
jacob [Sat, 27 Oct 2007 16:05:02 +0000 (16:05 +0000)]
Reset mouse reporting mode as part of resetting the terminal.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7773 cda61777-01e9-0310-a592-d414129be87e

16 years agoMarc TERRIER pointed out a couple of places that claim there is an X11
jacob [Fri, 19 Oct 2007 21:47:47 +0000 (21:47 +0000)]
Marc TERRIER pointed out a couple of places that claim there is an X11
forwarding checkbox on the Tunnels panel, which hasn't been the case for
a while.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7771 cda61777-01e9-0310-a592-d414129be87e

16 years agoReplace mentions of SSH-2 I-Ds with references to the corresponding RFCs.
ben [Wed, 3 Oct 2007 21:21:18 +0000 (21:21 +0000)]
Replace mentions of SSH-2 I-Ds with references to the corresponding RFCs.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7759 cda61777-01e9-0310-a592-d414129be87e

16 years agosnew() always returns non-NULL, so checking if its return value is NULL
ben [Wed, 3 Oct 2007 21:06:00 +0000 (21:06 +0000)]
snew() always returns non-NULL, so checking if its return value is NULL
is pointless.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7758 cda61777-01e9-0310-a592-d414129be87e

16 years agoFactor out the increasingly complicated SSH-2 channel structure initialisation
ben [Wed, 3 Oct 2007 21:04:26 +0000 (21:04 +0000)]
Factor out the increasingly complicated SSH-2 channel structure initialisation
into its own function.  Maintaining four copies was getting boring.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7757 cda61777-01e9-0310-a592-d414129be87e

16 years agoTake the code that does flow control in SSH-1, and make it work in SSH-2
ben [Wed, 3 Oct 2007 20:29:27 +0000 (20:29 +0000)]
Take the code that does flow control in SSH-1, and make it work in SSH-2
as well.  This won't be triggered in the usual case, but it's useful
if the remote end ignores our window, or if we're in "simple" mode and
setting the window far larger than is necessary.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7756 cda61777-01e9-0310-a592-d414129be87e

16 years agoMore fixes to stdout and stderr. When the backlog on either clears, call
ben [Tue, 2 Oct 2007 21:43:53 +0000 (21:43 +0000)]
More fixes to stdout and stderr.  When the backlog on either clears, call
the backend's unthrottle function.  If we don't, we'll deadlock.  While
we're here, also pump as much data as possible out during each call to
try_output(), rather than restricting ourselves to a single call to
write().

git-svn-id: svn://svn.tartarus.org/sgt/putty@7755 cda61777-01e9-0310-a592-d414129be87e

16 years agoAs far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent,
ben [Tue, 2 Oct 2007 21:07:52 +0000 (21:07 +0000)]
As far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent,
except that O_NONBLOCK is standardised and FIONBIO isn't.  In consequence,
replace our only use of FIONBIO with O_NONBLOCK.

Inspired by Jonathan H N Chin, who had problems with this on Solaris.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7753 cda61777-01e9-0310-a592-d414129be87e

16 years agoRather than rejecting spurious SSH_MSG_CHANNEL_SUCCESSes, and ignoring
ben [Mon, 1 Oct 2007 21:11:11 +0000 (21:11 +0000)]
Rather than rejecting spurious SSH_MSG_CHANNEL_SUCCESSes, and ignoring
spurious SSH_MSG_CHANNEL_FAILUREs, treat them as the protocol errors
they are and forcibly disconnect.  Inspired by recent traffic on
comp.security.ssh.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7752 cda61777-01e9-0310-a592-d414129be87e

16 years agoMerge the looking up of channel numbers for SSH-2 channel messages into
ben [Sun, 30 Sep 2007 19:42:31 +0000 (19:42 +0000)]
Merge the looking up of channel numbers for SSH-2 channel messages into
a single function which also handles checking that channels exist and
are properly open.  This should make PuTTY a little less tolerant of
servers that send bogus messages.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7751 cda61777-01e9-0310-a592-d414129be87e

16 years agoSet cfg.ssh_simple if there are no forwardings.
ben [Sun, 30 Sep 2007 14:14:29 +0000 (14:14 +0000)]
Set cfg.ssh_simple if there are no forwardings.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7750 cda61777-01e9-0310-a592-d414129be87e

16 years agoWhen writing session data to stdout or stderr, switch the relevant file
ben [Sun, 30 Sep 2007 12:45:49 +0000 (12:45 +0000)]
When writing session data to stdout or stderr, switch the relevant file
descriptor into non-blocking mode temporarily, and correctly handle returns
of EAGAIN from write().  This should fix unix-plink-stdout-nonblock, while
avoiding EAGAIN turning up where we aren't expecting it.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7748 cda61777-01e9-0310-a592-d414129be87e

16 years agoNow that PuTTY is actually using names "@putty.projects.tartarus.org", it
ben [Sat, 29 Sep 2007 14:20:55 +0000 (14:20 +0000)]
Now that PuTTY is actually using names "@putty.projects.tartarus.org", it
seems like a good idea to document them.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7747 cda61777-01e9-0310-a592-d414129be87e

16 years agoAdd support for resetting the terminal modes on stderr to something sensible
ben [Sat, 29 Sep 2007 12:27:45 +0000 (12:27 +0000)]
Add support for resetting the terminal modes on stderr to something sensible
before printing error messages to it.  This should fix the stair-stepping
in Plink's progress messages.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7745 cda61777-01e9-0310-a592-d414129be87e

16 years agoMy changes in r7738 (O_NONBLOCK for Unix Plink) were half-arsed, and
ben [Mon, 24 Sep 2007 21:43:48 +0000 (21:43 +0000)]
My changes in r7738 (O_NONBLOCK for Unix Plink) were half-arsed, and
completely broke interactive logins.  The problem, or at least one of the
problems, was that in interactive use stdin, stdout, and stderr tend to be
the same file, so setting O_NONBLOCK on the latter two also sets it on the
former.  Thus, we need to cope with all of them being non-blocking.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7742 cda61777-01e9-0310-a592-d414129be87e

16 years agoManifest constants are good. Introduce plink to STD{IN,OUT,ERR}_FILENO,
ben [Mon, 24 Sep 2007 21:31:45 +0000 (21:31 +0000)]
Manifest constants are good.  Introduce plink to STD{IN,OUT,ERR}_FILENO,
TRUE, and FALSE.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7741 cda61777-01e9-0310-a592-d414129be87e

16 years agostdout and stderr should be made O_NONBLOCK so that we don't end up blocking
ben [Mon, 24 Sep 2007 19:26:08 +0000 (19:26 +0000)]
stdout and stderr should be made O_NONBLOCK so that we don't end up blocking
the entire process because stdout is busy.

Arguably, this shouldn't apply to stderr when we're printing our own error
messages to it, but I'll leave that fix for another time.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7738 cda61777-01e9-0310-a592-d414129be87e

16 years agoAdd support for automatically tuning the SSH-2 window size for decent
ben [Mon, 24 Sep 2007 15:18:11 +0000 (15:18 +0000)]
Add support for automatically tuning the SSH-2 window size for decent
performance.  The theory behind this is fairly simple, though the
implementation turns out to be a little trickier than it looks.

The basic idea is that when the connection isn't being limited by our ability
to process data, we want to ensure that the window size _as seen by the server_
never drops to zero.  Measuring the server's view of the window size is done
by arranging for it to acknowledge every SSH_MSG_CHANNEL_WINDOW_ADJUST, or
rather an SSH_MSG_CHANNEL_REQUEST sent just before it.  That way we can tell
when it its outgoing data stream it received the window adjustment, and
thus how small the server's view of the window got.

At present, we only ever increase the window size.  In theory, we could
arrange to reduce it again if the server's view of it seemed to be persistently
too large, but my experiments suggest that getting this right will be tricky.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7735 cda61777-01e9-0310-a592-d414129be87e

16 years agoDocument "No supported authentication methods available", and make it clear
ben [Sat, 22 Sep 2007 13:55:25 +0000 (13:55 +0000)]
Document "No supported authentication methods available", and make it clear
that TIS/CryptoCard auth can be used for simple passwords too.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7730 cda61777-01e9-0310-a592-d414129be87e

16 years agoHarvey Kwok observes that EnumPrinters() can sometimes fail to fill
simon [Fri, 21 Sep 2007 18:04:08 +0000 (18:04 +0000)]
Harvey Kwok observes that EnumPrinters() can sometimes fail to fill
in its output parameters. Hence, we initialise them before calling
it.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7729 cda61777-01e9-0310-a592-d414129be87e

16 years agoDon't try SSH-1 RSA authentication unless the server has advertised support
ben [Thu, 20 Sep 2007 21:33:21 +0000 (21:33 +0000)]
Don't try SSH-1 RSA authentication unless the server has advertised support
for it.  It's possible that this obsoletes BUG_CHOKES_ON_RSA.  Certainly
the one SSH-1.5-Cisco-1.25 server I found was correctly not advertising RSA
auth.  For now, leave it in, because I'm not feeling entirely confident.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7726 cda61777-01e9-0310-a592-d414129be87e

16 years agoIn SSH-1, don't attempt password authentication unless the server has
ben [Thu, 20 Sep 2007 21:07:24 +0000 (21:07 +0000)]
In SSH-1, don't attempt password authentication unless the server has
announced support for it.  Instead exit with a fatal error (since password
auth is our last resort).

git-svn-id: svn://svn.tartarus.org/sgt/putty@7724 cda61777-01e9-0310-a592-d414129be87e

16 years agoAvoid "unused variable" warning when NO_IPV6 defined.
ben [Mon, 3 Sep 2007 20:52:56 +0000 (20:52 +0000)]
Avoid "unused variable" warning when NO_IPV6 defined.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7710 cda61777-01e9-0310-a592-d414129be87e

16 years agoSuggest another ttymode we could usefully set automatically.
ben [Mon, 3 Sep 2007 20:33:40 +0000 (20:33 +0000)]
Suggest another ttymode we could usefully set automatically.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7709 cda61777-01e9-0310-a592-d414129be87e

16 years agossh->mainchan can be NULL; try not to segfault in that situation.
simon [Mon, 3 Sep 2007 19:09:56 +0000 (19:09 +0000)]
ssh->mainchan can be NULL; try not to segfault in that situation.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7705 cda61777-01e9-0310-a592-d414129be87e

16 years agoCorrectly terminate nc target hostname when copying it.
ben [Tue, 7 Aug 2007 22:02:03 +0000 (22:02 +0000)]
Correctly terminate nc target hostname when copying it.
While we're here, use memcpy rather than strncpy when we've already worked
out how much we're going to copy.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7685 cda61777-01e9-0310-a592-d414129be87e

16 years agoUse "int" rather than "unsigned" as the argument to ssh2_set_window, not
ben [Mon, 6 Aug 2007 20:56:52 +0000 (20:56 +0000)]
Use "int" rather than "unsigned" as the argument to ssh2_set_window, not
because it can ever be negative, but because we'll be comparing it with
another int.  This way, C's promotion rules don't bite us and we should
stand slightly more chance of coping with broken servers that overrun our
window.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7683 cda61777-01e9-0310-a592-d414129be87e

16 years agoMay as well reference an RFC rather than an Internet Draft where we can.
ben [Sun, 5 Aug 2007 22:18:59 +0000 (22:18 +0000)]
May as well reference an RFC rather than an Internet Draft where we can.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7682 cda61777-01e9-0310-a592-d414129be87e

16 years agoSmall window-handling tweaks. Set the default big window to 0x7fffffff bytes,
ben [Sun, 5 Aug 2007 14:18:43 +0000 (14:18 +0000)]
Small window-handling tweaks.  Set the default big window to 0x7fffffff bytes,
and tweak ssh2_set_window() so it can cope with that.  Also arrange to send
a private channel message in simple mode to tell the server that it can safely
use a large window too.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7679 cda61777-01e9-0310-a592-d414129be87e

16 years agoRemember to clear ssh_simple when initialising config.
ben [Sat, 4 Aug 2007 22:19:12 +0000 (22:19 +0000)]
Remember to clear ssh_simple when initialising config.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7674 cda61777-01e9-0310-a592-d414129be87e

16 years agoIn the file-transfer applications, which only ever use the main
ben [Sat, 4 Aug 2007 22:14:19 +0000 (22:14 +0000)]
In the file-transfer applications, which only ever use the main
channel, arrange to set the SSH-2 window size to something very
large.  This prevents the connection stalling when the window fills
up, and means that PSCP receives data _much_ faster.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7672 cda61777-01e9-0310-a592-d414129be87e

16 years ago"CR implies LF" patch, based on one from Paul Coldrey.
ben [Sat, 4 Aug 2007 19:16:46 +0000 (19:16 +0000)]
"CR implies LF" patch, based on one from Paul Coldrey.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7669 cda61777-01e9-0310-a592-d414129be87e

16 years agoTweak window handling so that we send a window adjust if the window is half
ben [Sat, 4 Aug 2007 16:04:08 +0000 (16:04 +0000)]
Tweak window handling so that we send a window adjust if the window is half
used up, rather than over half.  That this increases the throughput of PSCP
by 50% indicates just how broken our window handling is.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7667 cda61777-01e9-0310-a592-d414129be87e

16 years agoWhen omitting session data from logs, don't omit the length of the session
ben [Sat, 4 Aug 2007 15:48:52 +0000 (15:48 +0000)]
When omitting session data from logs, don't omit the length of the session
data string.  This isn't strictly necessary, but it makes the logs easier to
use.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7666 cda61777-01e9-0310-a592-d414129be87e

16 years agoTweak to window handling: Keep the local window in a signed integer, and
ben [Sat, 4 Aug 2007 14:32:06 +0000 (14:32 +0000)]
Tweak to window handling:  Keep the local window in a signed integer, and
arrange to handle usefully the case where the server sends us more data
than it's allowed to.  There's no danger of overflow, since the maximum is
OUR_V2_WINSIZE and the minimum is -OUR_V2_MAXPKT (at least if the server is
nice).

git-svn-id: svn://svn.tartarus.org/sgt/putty@7661 cda61777-01e9-0310-a592-d414129be87e

16 years agoDon't throw away data that we receive before we're ready for it. Just save
ben [Sun, 29 Jul 2007 14:02:00 +0000 (14:02 +0000)]
Don't throw away data that we receive before we're ready for it.  Just save
it up for later.  This should prevent hangs when talking to particularly
enthusiastic servers.

Thanks to JCA for tracking this bug down.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7651 cda61777-01e9-0310-a592-d414129be87e

16 years agoNote lack of proxy auto-detection.
jacob [Sun, 22 Jul 2007 14:34:27 +0000 (14:34 +0000)]
Note lack of proxy auto-detection.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7648 cda61777-01e9-0310-a592-d414129be87e

16 years agoSplit pkt_ctx into a separate enumeration for each of kex and userauth
ben [Sat, 21 Jul 2007 21:39:36 +0000 (21:39 +0000)]
Split pkt_ctx into a separate enumeration for each of kex and userauth
instead of a bitfield for both.  This doesn't gain much here, but it should
make it easier to make things other than logging use the context.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7647 cda61777-01e9-0310-a592-d414129be87e

16 years agoArrange that log_packet() isn't called for raw data logging if logctx is null.
ben [Sat, 21 Jul 2007 13:43:57 +0000 (13:43 +0000)]
Arrange that log_packet() isn't called for raw data logging if logctx is null.
This allows us to send data in ssh_init(), albeit at the expense of its not
being properly logged, so arrange to send the version string then if that's
sensible, which should reduce the number of round-trips required to bring
up an SSH-2 connection.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7646 cda61777-01e9-0310-a592-d414129be87e

16 years agoSeparate out the code for creating and sending SSH version strings so that in
ben [Thu, 19 Jul 2007 23:53:02 +0000 (23:53 +0000)]
Separate out the code for creating and sending SSH version strings so that in
the SSH-2-only case, we can send it as soon as we connect rather than waiting
for the server's one.  Unfortunately, actually doing so will take a little
more effort -- there are subtleties to do with having a working log context
at the right moment that need to be sorted out.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7645 cda61777-01e9-0310-a592-d414129be87e

16 years agoUpdate an outdated comment.
ben [Wed, 18 Jul 2007 22:54:31 +0000 (22:54 +0000)]
Update an outdated comment.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7642 cda61777-01e9-0310-a592-d414129be87e

16 years agoImplement Marcin Bulandra's suggestion of only automatically updating the
jacob [Sun, 1 Jul 2007 15:47:31 +0000 (15:47 +0000)]
Implement Marcin Bulandra's suggestion of only automatically updating the
port number in the GUI when the connection type is changed if the current
port number is the standard one for the current protocol.
It's not perfect, but it should make the common case of tabbing through the
Session panel easier when starting non-SSH connections on odd ports.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7635 cda61777-01e9-0310-a592-d414129be87e

16 years agoRemove port number validation from Windows PuTTY -- it could cause unnecessary
jacob [Sun, 1 Jul 2007 15:41:09 +0000 (15:41 +0000)]
Remove port number validation from Windows PuTTY -- it could cause unnecessary
trouble with serial connections, and a port number of zero gets caught later
anyway.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7634 cda61777-01e9-0310-a592-d414129be87e

16 years agoRationalise access to, and content of, backends[] array.
jacob [Sat, 30 Jun 2007 21:56:44 +0000 (21:56 +0000)]
Rationalise access to, and content of, backends[] array.
Should be no significant change in behaviour.
(Well, entering usernames containing commas on Plink's command line will be
a little harder now.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@7628 cda61777-01e9-0310-a592-d414129be87e

16 years agoFix a couple of signedness compiler warnings, presumably due to me
simon [Sat, 30 Jun 2007 18:18:20 +0000 (18:18 +0000)]
Fix a couple of signedness compiler warnings, presumably due to me
using a different version of gcc from before.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7627 cda61777-01e9-0310-a592-d414129be87e

16 years agoTong Ho points out a missing ssh_pkt_ensure().
simon [Sat, 30 Jun 2007 18:17:12 +0000 (18:17 +0000)]
Tong Ho points out a missing ssh_pkt_ensure().

git-svn-id: svn://svn.tartarus.org/sgt/putty@7626 cda61777-01e9-0310-a592-d414129be87e

16 years agoIndex "MAC" a bit more thoroughly.
jacob [Tue, 29 May 2007 20:06:45 +0000 (20:06 +0000)]
Index "MAC" a bit more thoroughly.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7610 cda61777-01e9-0310-a592-d414129be87e

16 years agoExplicitly spell out that "incorrect MAC" type errors can be caused by
jacob [Tue, 29 May 2007 20:01:32 +0000 (20:01 +0000)]
Explicitly spell out that "incorrect MAC" type errors can be caused by
data corruption in the network.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7609 cda61777-01e9-0310-a592-d414129be87e

16 years agoRetire the e-gold link. Nobody's used it in years; I honestly don't
simon [Tue, 22 May 2007 18:37:17 +0000 (18:37 +0000)]
Retire the e-gold link. Nobody's used it in years; I honestly don't
know how I'd go about retrieving money from them any more because my
last exchange transaction went through a company who subsequently
turned out to be dodgy; and a user points out that e-gold is in
legal trouble, which suggests that avoiding it is probably wise.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7604 cda61777-01e9-0310-a592-d414129be87e

17 years agoThese days, you _can_ save a host name in Default Settings.
ben [Wed, 9 May 2007 21:35:24 +0000 (21:35 +0000)]
These days, you _can_ save a host name in Default Settings.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7566 cda61777-01e9-0310-a592-d414129be87e

17 years agoMake bounds of automatic array constant.
ben [Tue, 1 May 2007 20:29:11 +0000 (20:29 +0000)]
Make bounds of automatic array constant.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7503 cda61777-01e9-0310-a592-d414129be87e

17 years agoSince r7496, Pageant needs sshsh256 to build (although it doesn't need
jacob [Tue, 1 May 2007 13:14:23 +0000 (13:14 +0000)]
Since r7496, Pageant needs sshsh256 to build (although it doesn't need
SHA-256 to actually do its job).

git-svn-id: svn://svn.tartarus.org/sgt/putty@7500 cda61777-01e9-0310-a592-d414129be87e

17 years agoReindent the section that was marked `XXX The lines below should be
simon [Tue, 1 May 2007 12:26:44 +0000 (12:26 +0000)]
Reindent the section that was marked `XXX The lines below should be
reindented before this is committed'. Unfortunately not before it
was committed, but you can't have everything :-)

git-svn-id: svn://svn.tartarus.org/sgt/putty@7499 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for RFC 4432 RSA key exchange, the patch for which has been
ben [Mon, 30 Apr 2007 22:09:26 +0000 (22:09 +0000)]
Add support for RFC 4432 RSA key exchange, the patch for which has been
lying around in my home directory for _years_.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7496 cda61777-01e9-0310-a592-d414129be87e

17 years agoCreate installations directories before installing into them, like GNU
ben [Mon, 30 Apr 2007 20:09:58 +0000 (20:09 +0000)]
Create installations directories before installing into them, like GNU
packages do.

Problem reported by Manfred Pausch.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7494 cda61777-01e9-0310-a592-d414129be87e

17 years agoUpdate version numbers for 0.60 release.
simon [Sun, 29 Apr 2007 11:28:54 +0000 (11:28 +0000)]
Update version numbers for 0.60 release.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7488 cda61777-01e9-0310-a592-d414129be87e

17 years agoAvoid creating the Session/hostport control set in mid-session.
simon [Sun, 22 Apr 2007 14:39:01 +0000 (14:39 +0000)]
Avoid creating the Session/hostport control set in mid-session.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7477 cda61777-01e9-0310-a592-d414129be87e

17 years agoCapitalisation error.
simon [Sun, 22 Apr 2007 08:56:31 +0000 (08:56 +0000)]
Capitalisation error.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7476 cda61777-01e9-0310-a592-d414129be87e

17 years agoWhen we get an error writing to a local file, stop the download rather than
ben [Tue, 10 Apr 2007 21:46:44 +0000 (21:46 +0000)]
When we get an error writing to a local file, stop the download rather than
pretending we just got -1 bytes.  Not actually tested, but it looks pretty
obvious.
Bug reported by dking wang.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7459 cda61777-01e9-0310-a592-d414129be87e

17 years agoWhen the comments say `if we're in restart mode', the code in
simon [Mon, 2 Apr 2007 08:44:00 +0000 (08:44 +0000)]
When the comments say `if we're in restart mode', the code in
question should actually be conditional on restart mode!

git-svn-id: svn://svn.tartarus.org/sgt/putty@7438 cda61777-01e9-0310-a592-d414129be87e

17 years agoIn the wake of r7415, let's have some better error reporting.
simon [Tue, 27 Mar 2007 19:10:10 +0000 (19:10 +0000)]
In the wake of r7415, let's have some better error reporting.
Instead of passing -1 to its gotdata and sentdata callbacks on
error, winhandl.c will now pass the negation of the Windows error
number; and the Plink front end will now format that into an error
message and pass it on to the user.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7416 cda61777-01e9-0310-a592-d414129be87e

17 years agoWindows apparently sends ERROR_BROKEN_PIPE when a pipe we're reading
simon [Tue, 27 Mar 2007 18:49:59 +0000 (18:49 +0000)]
Windows apparently sends ERROR_BROKEN_PIPE when a pipe we're reading
from is closed normally from the writing end. This is ludicrous; if
that situation isn't a natural EOF, _nothing_ is. So if we get that
particular error, we pretend it's EOF.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7415 cda61777-01e9-0310-a592-d414129be87e

17 years agoPatch from John Sullivan: process double-clicks in the session list
simon [Tue, 27 Mar 2007 18:16:36 +0000 (18:16 +0000)]
Patch from John Sullivan: process double-clicks in the session list
box on button-up rather than button-down. The effect of this is that
if a saved session is already selected in the list box and then you
double-click it, it will open rather than beeping annoyingly.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7414 cda61777-01e9-0310-a592-d414129be87e

17 years agoFix a stupid one-character typo that was breaking 256-colour support on GTK.
ben [Mon, 19 Mar 2007 12:05:34 +0000 (12:05 +0000)]
Fix a stupid one-character typo that was breaking 256-colour support on GTK.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7403 cda61777-01e9-0310-a592-d414129be87e

17 years agoget_random_data() can return NULL (for instance, if we can't open /dev/random
jacob [Tue, 13 Mar 2007 14:43:14 +0000 (14:43 +0000)]
get_random_data() can return NULL (for instance, if we can't open /dev/random
on Unix), yet cmdgen failed to deal with this. Spotted by Darren Tucker.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7396 cda61777-01e9-0310-a592-d414129be87e

17 years agoProcess -t/-T later than -m, so that they can override -m's default behaviour
jacob [Wed, 28 Feb 2007 23:31:49 +0000 (23:31 +0000)]
Process -t/-T later than -m, so that they can override -m's default behaviour
of no pty.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7348 cda61777-01e9-0310-a592-d414129be87e

17 years agoPrepend \\.\ to configured serial line string, to allow easy access to ports
jacob [Wed, 28 Feb 2007 21:30:06 +0000 (21:30 +0000)]
Prepend \\.\ to configured serial line string, to allow easy access to ports
above COM9.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7345 cda61777-01e9-0310-a592-d414129be87e

17 years agoAttempt to scrub -pw's argument in argv[], to make it less obvious.
jacob [Sun, 25 Feb 2007 02:15:20 +0000 (02:15 +0000)]
Attempt to scrub -pw's argument in argv[], to make it less obvious.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7323 cda61777-01e9-0310-a592-d414129be87e

17 years agoDelay evaluating the "-pw" option, so we can criticise the user's choice of
jacob [Sun, 25 Feb 2007 00:51:38 +0000 (00:51 +0000)]
Delay evaluating the "-pw" option, so we can criticise the user's choice of
backend, bailing out if anything other than SSH is in use.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7322 cda61777-01e9-0310-a592-d414129be87e

17 years agoSince r7265, a user could not launch a PuTTY session to a specific host by
jacob [Sun, 25 Feb 2007 00:50:24 +0000 (00:50 +0000)]
Since r7265, a user could not launch a PuTTY session to a specific host by
simply specifying a hostname on the command line -- this would bring up the
config dialog. Use a slightly more sophisticated notion of whether the user
meant to launch a session.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7321 cda61777-01e9-0310-a592-d414129be87e

17 years ago"-noagent" and friends should be marked SAVEABLE, to ensure they're not
jacob [Sat, 24 Feb 2007 22:43:57 +0000 (22:43 +0000)]
"-noagent" and friends should be marked SAVEABLE, to ensure they're not
clobbered by "-load".

git-svn-id: svn://svn.tartarus.org/sgt/putty@7320 cda61777-01e9-0310-a592-d414129be87e

17 years agoGareth pointed out yesterday that the Unix terminal front end treats
simon [Sat, 24 Feb 2007 13:36:11 +0000 (13:36 +0000)]
Gareth pointed out yesterday that the Unix terminal front end treats
BELL_DISABLED as BELL_DEFAULT. How embarrassing.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7316 cda61777-01e9-0310-a592-d414129be87e

17 years agoThis reordering of the Unix Makefiles (requested by Michael Shigorin) allows
jacob [Sun, 18 Feb 2007 22:05:45 +0000 (22:05 +0000)]
This reordering of the Unix Makefiles (requested by Michael Shigorin) allows
use of -Wl,--as-needed.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7299 cda61777-01e9-0310-a592-d414129be87e

17 years agoIn controls where a list of entries is manipulated by Add/Remove buttons
jacob [Sun, 18 Feb 2007 19:56:16 +0000 (19:56 +0000)]
In controls where a list of entries is manipulated by Add/Remove buttons
(SSH tunnels, TTY modes, and environment variables), when the Remove button is
pressed, populate the edit controls from the entry that has just been deleted.

Several users have requested this, as it makes editing an entry easier (read-
modify-write) in the cases where order is unimportant, and also provides a
degree of undo-ability.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7298 cda61777-01e9-0310-a592-d414129be87e

17 years agoAllow dlg_listbox_index() to be called on multi-selection list boxes.
jacob [Sun, 18 Feb 2007 19:50:41 +0000 (19:50 +0000)]
Allow dlg_listbox_index() to be called on multi-selection list boxes.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7297 cda61777-01e9-0310-a592-d414129be87e

17 years agoBring the OS X front end up to date with recent changes to the main
simon [Sun, 18 Feb 2007 15:59:38 +0000 (15:59 +0000)]
Bring the OS X front end up to date with recent changes to the main
code base.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7296 cda61777-01e9-0310-a592-d414129be87e