]> asedeno.scripts.mit.edu Git - PuTTY.git/log
PuTTY.git
12 years agoRevamp of EOF handling in all network connections, pipes and other
Simon Tatham [Tue, 13 Sep 2011 11:44:03 +0000 (11:44 +0000)]
Revamp of EOF handling in all network connections, pipes and other
data channels. Should comprehensively fix 'half-closed', in principle,
though it's a big and complicated change and so there's a good chance
I've made at least one mistake somewhere.

All connections should now be rigorous about propagating end-of-file
(or end-of-data-stream, or socket shutdown, or whatever) independently
in both directions, except in frontends with no mechanism for sending
explicit EOF (e.g. interactive terminal windows) or backends which are
basically always used for interactive sessions so it's unlikely that
an application would be depending on independent EOF (telnet, rlogin).

EOF should now never accidentally be sent while there's still buffered
data to go out before it. (May help fix 'portfwd-corrupt', and also I
noticed recently that the ssh main session channel can accidentally
have MSG_EOF sent before the output bufchain is clear, leading to
embarrassment when it subsequently does send the output).

[originally from svn r9279]

12 years agoIn term_init(), copy stuff out of the conf _before_ calling
Simon Tatham [Tue, 13 Sep 2011 10:27:00 +0000 (10:27 +0000)]
In term_init(), copy stuff out of the conf _before_ calling
power_on(), since the latter calls term_schedule_cblink which expects
term->blink_cur to have been initialised.

[originally from svn r9278]

12 years agoFix assertion failure in wprefs() when the list is zero-length. Breaks
Simon Tatham [Tue, 13 Sep 2011 07:35:14 +0000 (07:35 +0000)]
Fix assertion failure in wprefs() when the list is zero-length. Breaks
any session-save operation in PuTTYtel due to the empty GSS list.

[originally from svn r9276]

12 years agoInstead of testing for different versions of GTK in increasing order
Simon Tatham [Sat, 20 Aug 2011 08:18:56 +0000 (08:18 +0000)]
Instead of testing for different versions of GTK in increasing order
of preference so that the later ones overwrite the configured stuff
from the older ones, test in decreasing order of preference and stop
as soon as one is successful. Fixes a problem in which
autoconfiguration on a system containing only GTK 1 would go wrong
because the _failed_ test for GTK 2 would overwrite some but not all
of the variables set by the successful test for v1.

[originally from svn r9270]

12 years agoAdd a -U option to mkfiles.pl, which is just like -u except that it
Simon Tatham [Sat, 20 Aug 2011 07:56:19 +0000 (07:56 +0000)]
Add a -U option to mkfiles.pl, which is just like -u except that it
runs configure at the top level rather than the unix subdirectory. I'm
getting into the idea of even doing it that way myself, because then I
can do VPATH builds from the same source tree elsewhere.

(Autoconf seems to be fine with doing multiple VPATH builds from the
same source tree in different build directories, but gets upset if you
try to do a VPATH build when you've done a normal build in the real
configure directory. So this way I do what autoconf sees as _only_
VPATH builds.)

[originally from svn r9269]

12 years agoFix bug with setting window title on Unix that came in with r9214.
Jacob Nevins [Fri, 19 Aug 2011 14:55:24 +0000 (14:55 +0000)]
Fix bug with setting window title on Unix that came in with r9214.

[originally from svn r9268]
[r9214 == a1f3b7a358adaa7c2a98359cd0373aa823eeb14b]

12 years agoFix a suspected bug in PSCP's SCP protocol fallback from r9214 (untested since
Jacob Nevins [Thu, 18 Aug 2011 10:47:45 +0000 (10:47 +0000)]
Fix a suspected bug in PSCP's SCP protocol fallback from r9214 (untested since
I don't have access to a server that still needs this fallback).

[originally from svn r9267]
[r9214 == a1f3b7a358adaa7c2a98359cd0373aa823eeb14b]

12 years agoRestore data-bits options for "-sercfg" that were accidentally lost in r9214.
Jacob Nevins [Thu, 18 Aug 2011 10:45:25 +0000 (10:45 +0000)]
Restore data-bits options for "-sercfg" that were accidentally lost in r9214.

[originally from svn r9266]
[r9214 == a1f3b7a358adaa7c2a98359cd0373aa823eeb14b]

12 years agoReadjust Pageant's SID check _again_, to make it the union of the
Simon Tatham [Sat, 13 Aug 2011 14:48:36 +0000 (14:48 +0000)]
Readjust Pageant's SID check _again_, to make it the union of the
policies before and after r9178, and hence able to talk to both
0.60-like and 0.61-like clients.

I had failed to consider that many pieces of code derived from PuTTY
would have imported the Pageant client code, so we shouldn't randomly
stop supporting things just because _we_ aren't using them any more.

[originally from svn r9264]
[r9178 == af78191a9c8a76281fe35b5e168b794d8cf328f9]

12 years agoIf we're printing password prompts to /dev/tty rather than standard
Simon Tatham [Thu, 11 Aug 2011 18:13:34 +0000 (18:13 +0000)]
If we're printing password prompts to /dev/tty rather than standard
error, we should also read the corresponding password inputs from
/dev/tty. That way, redirection of Plink's standard input will play
nicely with SSH sessions that need interactive login.

(This is what we get for disdaining getpass(3) and going it alone, of
course. But we had no choice, due to the extra output part way through
keyboard-interactive.)

[originally from svn r9262]

12 years agoPropagate file permissions in both directions in Unix pscp and psftp.
Simon Tatham [Thu, 11 Aug 2011 17:59:30 +0000 (17:59 +0000)]
Propagate file permissions in both directions in Unix pscp and psftp.

I think I have to consider this to be a separate but related change to
the wishlist item 'pscp-filemodes'; that was written before the Unix
port existed, and referred to the ability to configure the permissions
used for files copied from Windows to Unix - which is still not done.

[originally from svn r9260]

12 years agoFix bug in which the SSH-only tools (pscp, psftp) did not honour a
Simon Tatham [Wed, 27 Jul 2011 18:43:16 +0000 (18:43 +0000)]
Fix bug in which the SSH-only tools (pscp, psftp) did not honour a
nonstandard port number when loading a saved session.

Occurs because those tools include be_none.c which defines no entries
in backends[] at all, as a result of which settings.c doesn't
recognise the word 'ssh' in the saved session's protocol field and
instead sets the protocol to something idiotic - which _then_ means
that when pscp.c forces the protocol to PROT_SSH, it also resets the
port number as it would when overriding a saved session specifying a
protocol other than SSH.

The immediate solution is to define a new be_ssh.c citing only
ssh_backend, and include that in the SSH-only tools. However, I wonder
if a better approach (perhaps when I redesign session loading and
saving) would be not to be so clever, and just have all the tools
contain a complete list of known protocol names for purposes of
understanding what's in the saved session data, and complain if you
try to use one they don't know how to actually speak.

[originally from svn r9254]

12 years agoMake the top-level configure wrapper executable. (I thought I'd done
Simon Tatham [Sat, 23 Jul 2011 12:10:14 +0000 (12:10 +0000)]
Make the top-level configure wrapper executable. (I thought I'd done
that in the last commit, but svn must have ignored the permissions.)

[originally from svn r9243]

12 years agoAdd a convenience option to mkfiles.pl for Unix users. If you run
Simon Tatham [Sat, 23 Jul 2011 11:58:37 +0000 (11:58 +0000)]
Add a convenience option to mkfiles.pl for Unix users. If you run
'mkfiles.pl -u', it will do its normal processing, then run mkauto.sh
to regenerate configure and Makefile.in, then run configure in the
Unix subdirectory to regenerate unix/Makefile. So it's a handy
one-stop shop for going all the way from a modified Recipe to the
end-product Unix makefile, if you're adding source files during
development.

[originally from svn r9242]

12 years agoAdd a wrapper script called 'configure' at the top level, which runs
Simon Tatham [Sat, 23 Jul 2011 11:40:26 +0000 (11:40 +0000)]
Add a wrapper script called 'configure' at the top level, which runs
the real configure script from the unix subdirectory, but with cwd
unchanged so that you end up doing a VPATH build in the top-level
source directory.

Should, ideally, placate the people who expect 'configure' to be at
the top level, while still letting _me_ keep all the Unix-specific
stuff in the Unix subdirectory.

[originally from svn r9241]

12 years agoRename --with-gtk-version to --with-gtk, and support its negation
Simon Tatham [Sat, 23 Jul 2011 11:36:25 +0000 (11:36 +0000)]
Rename --with-gtk-version to --with-gtk, and support its negation
--without-gtk as a means of manually overriding the makefile into one
building the command-line tools only (as it would if GTK were not
found at all at configure time).

[originally from svn r9240]

12 years agoSwitch to using automake for the Unix autoconfigured build.
Simon Tatham [Sat, 23 Jul 2011 11:33:29 +0000 (11:33 +0000)]
Switch to using automake for the Unix autoconfigured build.

mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.

Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).

The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.

[originally from svn r9239]

12 years agoWhen we check for libX11 in the autoconf script, add it to $GTK_LIBS
Simon Tatham [Wed, 20 Jul 2011 17:50:02 +0000 (17:50 +0000)]
When we check for libX11 in the autoconf script, add it to $GTK_LIBS
on success rather than to $LIBS, because it's only used in the GUI
tools and we don't want the command-line tools linked against it.

[originally from svn r9238]

12 years agoFix 'Duplicate Session' on Windows, broken during the config revamp.
Simon Tatham [Wed, 20 Jul 2011 15:55:07 +0000 (15:55 +0000)]
Fix 'Duplicate Session' on Windows, broken during the config revamp.

(In an embarrassingly silly way, too. No end of difficult stuff about
Conf serialisation done with great care and working just fine, and
then a trivial goof in using sscanf lets the whole lot down.)

[originally from svn r9237]

12 years agoTrivial fix for assertion failure introduced by the config revamp.
Simon Tatham [Tue, 19 Jul 2011 17:06:43 +0000 (17:06 +0000)]
Trivial fix for assertion failure introduced by the config revamp.
Spotted by Leonid Lisovskiy.

[originally from svn r9236]

12 years agoMinor amendment to r9226: don't log GSSAPI failure in the Event Log
Simon Tatham [Mon, 18 Jul 2011 18:09:36 +0000 (18:09 +0000)]
Minor amendment to r9226: don't log GSSAPI failure in the Event Log
twice. (Once in the GSSAPI code, once at the top of the main auth
loop. Removed the latter.)

[originally from svn r9232]
[r9226 == 0b79fe0bcbfd4113e8ed413fe0c8e0bbd34ea5b2]

12 years agoReinstate a missing invocation of the FONT_QUALITY macro which I
Simon Tatham [Mon, 18 Jul 2011 18:04:39 +0000 (18:04 +0000)]
Reinstate a missing invocation of the FONT_QUALITY macro which I
accidentally removed in the big config revamp.

[originally from svn r9231]

12 years agoFix a typo in r9214 that plausibly explains a resizing weirdness I had with
Jacob Nevins [Sun, 17 Jul 2011 22:35:08 +0000 (22:35 +0000)]
Fix a typo in r9214 that plausibly explains a resizing weirdness I had with
today's snapshot on Windows.

[originally from svn r9230]
[r9214 == a1f3b7a358adaa7c2a98359cd0373aa823eeb14b]

12 years agoFix version reporting in Unix builds versioned by a specific svn
Simon Tatham [Sun, 17 Jul 2011 22:17:53 +0000 (22:17 +0000)]
Fix version reporting in Unix builds versioned by a specific svn
revision ('Custom build r1234'). Those builds were passing
'-DSVN_REV=r1234' to version.c, instead of -DSVN_REV=1234 as they
should have, leading to silly run-time version messages such as
'plink: Custom build rr9226'.

To chop the r off the front of the revision string passed in, I've
used a bashism in mkunxarc.sh. I think this is an acceptable extra
dependency.

[originally from svn r9229]

12 years ago--with-gtk-version option to configure, so you can explicitly tell it
Simon Tatham [Sun, 17 Jul 2011 22:17:40 +0000 (22:17 +0000)]
--with-gtk-version option to configure, so you can explicitly tell it
which GTK version you want to build with if both are installed. Based
on a patch by Malcolm Smith, though somewhat modified.

[originally from svn r9228]

12 years agoSupport for re-running autoconf in the absence of the autoconf macro
Simon Tatham [Sun, 17 Jul 2011 22:17:30 +0000 (22:17 +0000)]
Support for re-running autoconf in the absence of the autoconf macro
files which provide auto-detection of GTK 1 and GTK 2. This makes it
easier for casual PuTTY developers to rerun autoconf for their own
purposes without having to install obscure extra packages. Obviously
the resulting configure script will not know how to detect whichever
version of GTK they didn't have support for, so it won't be product-
quality by my standards, but it should be good enough that they can
prepare unrelated patches to send to us.

[originally from svn r9227]

12 years agoReorganise the logging and display of messages about SSH
Simon Tatham [Sat, 16 Jul 2011 12:06:32 +0000 (12:06 +0000)]
Reorganise the logging and display of messages about SSH
authentication. We should now produce an Event Log entry for every
authentication attempted and every authentication failure; meanwhile,
messages in the PuTTY window will not be generated for the failure of
auth types unless we also announced in the PuTTY window that we were
trying them. (GSSAPI was getting the latter wrong, leading to spurious
'Access denied' for many users of 0.61.)

[originally from svn r9226]

12 years agoMostly cosmetic change: don't claim to have found an SSH agent if
Simon Tatham [Sat, 16 Jul 2011 12:03:14 +0000 (12:03 +0000)]
Mostly cosmetic change: don't claim to have found an SSH agent if
SSH_AUTH_SOCK is defined to the empty string. (Because a common way to
'unset' it is to run commands like 'SSH_AUTH_SOCK= putty -load thing'.)

[originally from svn r9225]

12 years agoFix display of VT100 vertically-offset horizontal line characters
Simon Tatham [Sat, 16 Jul 2011 11:13:00 +0000 (11:13 +0000)]
Fix display of VT100 vertically-offset horizontal line characters
(o,p,r,s). They are displayed in Windows by actually writing the
centred one (q) with a vertical offset, in case fonts don't have the
offset versions; this requires terminal.c to separate those characters
into distinct calls to do_text(). Unfortunately, it was only breaking
up a text-drawing call _before_ one of those characters, not after
one. Spotted by Robert de Bath.

[originally from svn r9221]

12 years agoDon't delete everything under a string-subkeyed primary key by using a
Simon Tatham [Fri, 15 Jul 2011 18:30:47 +0000 (18:30 +0000)]
Don't delete everything under a string-subkeyed primary key by using a
loop that fetches the next item using conf_get_str_strs and passing
the previous key as a parameter, because the previous key will have
been freed by the intervening conf_del_str_str. Instead, use the
technique of repeatedly using conf_get_str_nthstrkey with index 0 and
deleting what comes back, as PSCP and PSFTP do.

Spotted by Minefield with the aid of Jacob, or possibly vice versa.

[originally from svn r9220]

12 years agoMissing free.
Simon Tatham [Fri, 15 Jul 2011 18:21:30 +0000 (18:21 +0000)]
Missing free.

[originally from svn r9219]

12 years agoconf_copy_into must empty the entire target conf before filling it
Simon Tatham [Fri, 15 Jul 2011 18:18:28 +0000 (18:18 +0000)]
conf_copy_into must empty the entire target conf before filling it
with the entries from the source one, otherwise add234 will keep
failing ("this key already exists"). Completely broke Plink, ahem.

[originally from svn r9218]

12 years agoWhen doing manual underlining, underline the text in question rather than a box
Jacob Nevins [Fri, 15 Jul 2011 16:03:06 +0000 (16:03 +0000)]
When doing manual underlining, underline the text in question rather than a box
to the right of it. Probably introduced sometime around r9063.

[originally from svn r9217]
[r9063 == 00b32eda3cc76187e18ef1332e6f7b56fe460f9e]

12 years agoPost-release destabilisation! Completely remove the struct type
Simon Tatham [Thu, 14 Jul 2011 18:52:21 +0000 (18:52 +0000)]
Post-release destabilisation! Completely remove the struct type
'Config' in putty.h, which stores all PuTTY's settings and includes an
arbitrary length limit on every single one of those settings which is
stored in string form. In place of it is 'Conf', an opaque data type
everywhere outside the new file conf.c, which stores a list of (key,
value) pairs in which every key contains an integer identifying a
configuration setting, and for some of those integers the key also
contains extra parts (so that, for instance, CONF_environmt is a
string-to-string mapping). Everywhere that a Config was previously
used, a Conf is now; everywhere there was a Config structure copy,
conf_copy() is called; every lookup, adjustment, load and save
operation on a Config has been rewritten; and there's a mechanism for
serialising a Conf into a binary blob and back for use with Duplicate
Session.

User-visible effects of this change _should_ be minimal, though I
don't doubt I've introduced one or two bugs here and there which will
eventually be found. The _intended_ visible effects of this change are
that all arbitrary limits on configuration strings and lists (e.g.
limit on number of port forwardings) should now disappear; that list
boxes in the configuration will now be displayed in a sorted order
rather than the arbitrary order in which they were added to the list
(since the underlying data structure is now a sorted tree234 rather
than an ad-hoc comma-separated string); and one more specific change,
which is that local and dynamic port forwardings on the same port
number are now mutually exclusive in the configuration (putting 'D' in
the key rather than the value was a mistake in the first place).

One other reorganisation as a result of this is that I've moved all
the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
out into config.c, because I can't really justify calling them generic
any more. When they took a pointer to an arbitrary structure type and
the offset of a field within that structure, they were independent of
whether that structure was a Config or something completely different,
but now they really do expect to talk to a Conf, which can _only_ be
used for PuTTY configuration, so I've renamed them all things like
conf_editbox_handler and moved them out of the nominally independent
dialog-box management module into the PuTTY-specific config.c.

[originally from svn r9214]

12 years agoReadjust checklist, because actually the section on updating the
Simon Tatham [Tue, 12 Jul 2011 19:59:15 +0000 (19:59 +0000)]
Readjust checklist, because actually the section on updating the
website _wasn't_ missing - I just looked straight past it somehow.
Fold the two versions together into one more complete than either.

[originally from svn r9206]

12 years agoVarious updates to the release checklist:
Simon Tatham [Tue, 12 Jul 2011 19:56:00 +0000 (19:56 +0000)]
Various updates to the release checklist:
 - for 'ixion' read 'atreus' throughout
 - the signature-checking commands needed minor modifications to cope
   with more *sums files
 - stated a few things explicitly which were previously implied, in
   case the next inter-release gap is also long enough for me to
   forget them.

[originally from svn r9205]

12 years agoBump version number prior to tagging 0.61 release. 0.61
Simon Tatham [Tue, 12 Jul 2011 18:26:18 +0000 (18:26 +0000)]
Bump version number prior to tagging 0.61 release.

[originally from svn r9202]

12 years agoFix the _rest_ of the Windows compile warnings. (ahem)
Simon Tatham [Tue, 12 Jul 2011 18:13:33 +0000 (18:13 +0000)]
Fix the _rest_ of the Windows compile warnings. (ahem)

[originally from svn r9201]

12 years agoFix Windows compile warnings by adding explicit casts.
Simon Tatham [Tue, 12 Jul 2011 18:09:46 +0000 (18:09 +0000)]
Fix Windows compile warnings by adding explicit casts.

[originally from svn r9200]

12 years agoAdd a directory 'contrib/cygtermd', containing the source code for my
Simon Tatham [Sun, 10 Jul 2011 14:22:32 +0000 (14:22 +0000)]
Add a directory 'contrib/cygtermd', containing the source code for my
hacky helper program to let PuTTY act as a local pterm-oid on
Cygwin-enabled Windows systems.

[originally from svn r9191]

12 years agoGenerate some checksum files with more up-to-date hash functions than
Simon Tatham [Sun, 10 Jul 2011 11:45:52 +0000 (11:45 +0000)]
Generate some checksum files with more up-to-date hash functions than
MD5. Shipped (and signed) alongside the existing 'md5sums' file.

[originally from svn r9189]

12 years agoFix 'winadj-success': since at least one server (boks_sshd) blithely responds
Jacob Nevins [Fri, 1 Jul 2011 21:53:41 +0000 (21:53 +0000)]
Fix 'winadj-success': since at least one server (boks_sshd) blithely responds
to "winadj@putty.projects.tartarus.org" with SSH_MSG_CHANNEL_SUCCESS despite
probably having no idea what it means, treat this just the same as
SSH_MSG_CHANNEL_FAILURE instead of killing the connection.
Tested only as far as making sure that winadj/FAILURE with a normal server
isn't _completely_ broken.

[originally from svn r9185]
[this svn revision also touched putty-wishlist]

12 years agoRewrite gprefs() in settings.c so that its input mapping includes
Simon Tatham [Sat, 25 Jun 2011 17:37:31 +0000 (17:37 +0000)]
Rewrite gprefs() in settings.c so that its input mapping includes
information about where to put items that aren't mentioned in the
saved configuration. So far the only nontrivial use I've made of this
facility is to default to placing KEX_RSA just above KEX_WARN in the
absence of any other information, which should fix
'ssh2-rsa-kex-pref'.

While I'm here I've rewritten wprefs() on general principles to remove
the needless length limit, since I was touching it anyway. The length
limit is still in gprefs (but I've lengthened it just in case).

[originally from svn r9181]

12 years agoMake Pageant use the same SID-selection logic as the Pageant client
Simon Tatham [Wed, 8 Jun 2011 20:47:07 +0000 (20:47 +0000)]
Make Pageant use the same SID-selection logic as the Pageant client
code (as introduced in r9043), so that it uses the user SID rather
than the default SID.

This does change the access-control model, in that a Pageant running
with administrator privilege will now serve keys to an unprivileged
PuTTY running as the same user who started Pageant. Owen and I think
this isn't a problem (in particular, it will still not serve keys to a
_different_ user).

More importantly, making the Pageant client and server code work the
same way means that PuTTY and Pageant can still talk to each other
when UAC is turned off, which we've had several reports of r9043
having broken.

[originally from svn r9178]
[r9043 == 05f22632eb45c9b8d17e8ffe7aa97e2590f8f11c]

12 years agoWhen we fail to get a response from Pageant, we should log the fact.
Simon Tatham [Wed, 8 Jun 2011 20:39:06 +0000 (20:39 +0000)]
When we fail to get a response from Pageant, we should log the fact.
Currently, if the IPC exchange goes wrong, the Event Log just prints
"Pageant is running. Requesting keys." and then goes on to the next
step without ever saying what happened.

[originally from svn r9177]

13 years agoFixes (mostly from Colin Watson, a couple redone by me) to make Unix
Simon Tatham [Sat, 7 May 2011 10:57:19 +0000 (10:57 +0000)]
Fixes (mostly from Colin Watson, a couple redone by me) to make Unix
PuTTY compile cleanly under gcc 4.6.0 without triggering any of its
new warnings.

[originally from svn r9169]

13 years agoThe documentation was still claiming that we don't support x11-auth.
Jacob Nevins [Fri, 8 Apr 2011 15:52:02 +0000 (15:52 +0000)]
The documentation was still claiming that we don't support x11-auth.

[originally from svn r9149]

13 years agoNote the possibility of a pause due to /dev/random blocking.
Jacob Nevins [Wed, 9 Mar 2011 18:10:47 +0000 (18:10 +0000)]
Note the possibility of a pause due to /dev/random blocking.

[originally from svn r9125]

13 years agoImplement zlib@openssh.com, using the rekey-after-userauth method suggested in
Jacob Nevins [Fri, 4 Mar 2011 22:34:47 +0000 (22:34 +0000)]
Implement zlib@openssh.com, using the rekey-after-userauth method suggested in
the wishlist entry.

[originally from svn r9120]
[this svn revision also touched putty-website,putty-wishlist]

13 years agoColin Watson reports that gnome-session has been known to leave
Simon Tatham [Wed, 2 Mar 2011 19:12:42 +0000 (19:12 +0000)]
Colin Watson reports that gnome-session has been known to leave
SIGPIPE ignored in its child processes, leading to unexpected
behaviour inside pterms. (The gnome-session I'm sitting in front of
doesn't seem to do this as far as I can tell, but I don't doubt there
are some that do.) Add SIGPIPE to the list of signals we reset to
default behaviour before launching pterm's child process.

[originally from svn r9117]

13 years agoSet the 'must_close_session' flag at the end of close_session(), so
Simon Tatham [Wed, 2 Mar 2011 18:52:03 +0000 (18:52 +0000)]
Set the 'must_close_session' flag at the end of close_session(), so
that we won't keep calling close_session() again the next time we go
round the message loop. Should fix unclean-close-hang. Thanks to Simon
Coleman for debugging.

[originally from svn r9115]

13 years agoFix probably-harmless type mismatch in nogss.c (and #include "putty.h" to stop
Jacob Nevins [Wed, 2 Mar 2011 00:18:03 +0000 (00:18 +0000)]
Fix probably-harmless type mismatch in nogss.c (and #include "putty.h" to stop
it happening again; this was spotted by GCC's "-flto" option).

[originally from svn r9114]

13 years agoAdd some extra validation to zlib decompression (primarily to shut up a GCC 4.6
Jacob Nevins [Tue, 1 Mar 2011 23:44:06 +0000 (23:44 +0000)]
Add some extra validation to zlib decompression (primarily to shut up a GCC 4.6
warning).

[originally from svn r9113]

13 years agoAdd some "#ifdef OPTIMISE_SCROLL" scar tissue to placate GCC 4.6
Jacob Nevins [Tue, 1 Mar 2011 23:10:16 +0000 (23:10 +0000)]
Add some "#ifdef OPTIMISE_SCROLL" scar tissue to placate GCC 4.6
-Wunused-but-set-variable.

[originally from svn r9112]

13 years agoRemove an unused variable (should shut up a warning from GCC 4.6).
Jacob Nevins [Tue, 1 Mar 2011 23:04:37 +0000 (23:04 +0000)]
Remove an unused variable (should shut up a warning from GCC 4.6).

[originally from svn r9111]

13 years agoUse pid_t more consistently. Should shut up a warning from GCC 4.6, and may
Jacob Nevins [Tue, 1 Mar 2011 23:00:32 +0000 (23:00 +0000)]
Use pid_t more consistently. Should shut up a warning from GCC 4.6, and may
conceivably help on platforms where int and pid_t aren't sufficiently similar.

[originally from svn r9110]

13 years agoRejig the bottom-level loops in internal_mul_* to use pointers instead
Simon Tatham [Tue, 22 Feb 2011 19:09:27 +0000 (19:09 +0000)]
Rejig the bottom-level loops in internal_mul_* to use pointers instead
of array indices. You'd hope that compilers could automatically turn
the one representation into the other if it was faster to do so, but
apparently not: even on gcc -O3, this source transformation gains over
15% performance.

[originally from svn r9105]

13 years agoMake bignum.py self-contained, by importing versions of the two
Simon Tatham [Tue, 22 Feb 2011 00:06:12 +0000 (00:06 +0000)]
Make bignum.py self-contained, by importing versions of the two
functions I was depending on from my personal Python maths utility
module.

[originally from svn r9104]

13 years agoMove the malloc and free of scratch space out of the internal_mul
Simon Tatham [Mon, 21 Feb 2011 19:47:28 +0000 (19:47 +0000)]
Move the malloc and free of scratch space out of the internal_mul
routines into their callers, where they'll be done once for a whole
modpow rather than many times within each multiply. Doesn't save much
time as far as I can see - perhaps a couple of percent, one second in
the minute it takes to run the new bignum test suite - but seems like
a sensible idea anyway on general principles.

[originally from svn r9103]

13 years agoA few more modpow tests, exercising the fallback option. This is
Simon Tatham [Sun, 20 Feb 2011 15:42:44 +0000 (15:42 +0000)]
A few more modpow tests, exercising the fallback option. This is
mostly so I can valgrind both and make sure they free all their
workspace - a memory leak in this code would be not merely an
inconvenience but a security hazard.

[originally from svn r9101]

13 years agoAdd tests of modpow.
Simon Tatham [Sun, 20 Feb 2011 15:27:48 +0000 (15:27 +0000)]
Add tests of modpow.

[originally from svn r9100]

13 years agoNearly forgot. Reinstate the original unoptimised modpow, as a
Simon Tatham [Sun, 20 Feb 2011 15:14:02 +0000 (15:14 +0000)]
Nearly forgot. Reinstate the original unoptimised modpow, as a
fallback for when Montgomery is inapplicable.

(I may also at some point switch to using it for small exponents, if
speed testing should reveal that there's a noticeable threshold beyond
which preparing the Montgomery setup is uneconomical.)

[originally from svn r9099]

13 years agoFix bug in Karatsuba multiplication, which affected propagation of a
Simon Tatham [Sun, 20 Feb 2011 15:06:39 +0000 (15:06 +0000)]
Fix bug in Karatsuba multiplication, which affected propagation of a
carry by more than one word. Now the current set of test cases all
pass again.

[originally from svn r9098]

13 years agoBeginnings of a test suite for the bignum code. The output of
Simon Tatham [Sun, 20 Feb 2011 14:59:00 +0000 (14:59 +0000)]
Beginnings of a test suite for the bignum code. The output of
testdata/bignum.py is twice the size of the rest of the PuTTY source
put together, so I'm not checking it in.

This reveals bugs in the new multiplication code, which I have yet to
fix.

[originally from svn r9097]

13 years agoPrompt for a remote username in rlogin connections, if one wasn't
Simon Tatham [Fri, 18 Feb 2011 19:12:20 +0000 (19:12 +0000)]
Prompt for a remote username in rlogin connections, if one wasn't
specified in the configuration. Jacob's userpass abstraction proves
its worth in making this a trivial job.

(Actually reported by a user - somebody's still using rlogin!)

[originally from svn r9096]

13 years agoImplement the Chinese Remainder Theorem optimisation for speeding up
Simon Tatham [Fri, 18 Feb 2011 08:25:39 +0000 (08:25 +0000)]
Implement the Chinese Remainder Theorem optimisation for speeding up
RSA private key operations by making use of the fact that we know the
factors of the modulus.

[originally from svn r9095]

13 years agoImplement the Montgomery technique for speeding up modular
Simon Tatham [Fri, 18 Feb 2011 08:25:38 +0000 (08:25 +0000)]
Implement the Montgomery technique for speeding up modular
exponentiation by replacing the modulo operation by a cleverly chosen
multiplication. This was not worth doing in the previous state of the
code (because my multiply was about as slow as my modulo), but now
that multiplication has been sped up by the Karatsuba optimisation,
Montgomery becomes worthwhile.

[originally from svn r9094]

13 years agoImplement the Karatsuba technique for recursive divide-and-conquer
Simon Tatham [Fri, 18 Feb 2011 08:25:37 +0000 (08:25 +0000)]
Implement the Karatsuba technique for recursive divide-and-conquer
optimisation of large multiplies.

[originally from svn r9093]

13 years agoAdd some appropriate bignum typedefs for generic 64-bit systems,
Simon Tatham [Fri, 18 Feb 2011 08:25:36 +0000 (08:25 +0000)]
Add some appropriate bignum typedefs for generic 64-bit systems,
setting BignumInt to 32 bits. gcc defines _LP64 on x86-64 and
presumably on other 64-bit architectures, so I've conditioned my
defines on that in the hope that they won't need redoing for the next
few such architectures.

I've also added a set for _LLP64, but it's untested as yet.

[originally from svn r9092]

13 years agoAllow setting the WM_CLASS X window property as a configuration option
Simon Tatham [Sat, 15 Jan 2011 11:39:44 +0000 (11:39 +0000)]
Allow setting the WM_CLASS X window property as a configuration option
in saved sessions, so that a programmable window manager can
distinguish different PuTTYs/pterms on startup and assign them
different window management properties.

[originally from svn r9078]

13 years agoTweak to r7635: when changing between protocols in the configuration dialog
Jacob Nevins [Fri, 14 Jan 2011 19:57:00 +0000 (19:57 +0000)]
Tweak to r7635: when changing between protocols in the configuration dialog
and avoiding trashing a non-default port, don't treat a port of 0 as special;
this was causing defaults to "freeze in" for sequences of clicks like SSH,
Raw, Telnet.
Arrange that a port of 0 (which in a backend indicates no default) is displayed
as a blank in the port box, to make this less jarring.

[originally from svn r9077]
[r7635 == db7cc1cba6dbd229db63d8ab1b2b86125c5d5933]

13 years agoIt's a new year.
Jacob Nevins [Wed, 5 Jan 2011 12:01:00 +0000 (12:01 +0000)]
It's a new year.

[originally from svn r9072]
[this svn revision also touched putty-website]

13 years agoRemove references to the now-dead Mac OS 9 port.
Jacob Nevins [Wed, 5 Jan 2011 11:58:52 +0000 (11:58 +0000)]
Remove references to the now-dead Mac OS 9 port.

[originally from svn r9071]

13 years agoWhen iterating over all channels for a dead SSH connection, don't miss out
Jacob Nevins [Mon, 3 Jan 2011 16:50:41 +0000 (16:50 +0000)]
When iterating over all channels for a dead SSH connection, don't miss out
those in the CHAN_SOCKDATA_DORMANT state (i.e., local-to-remote forwardings
which the SSH server had not yet acknowledged).
Marcel Kilgus has been running with the ssh_do_close() patch for nearly two
years (*cough*) and reports that it has eliminated frequent
'unclean-close-crash' symptoms for him (due to the unclosed socket generating
a pfd_closing() which accessed freed memory), although I've not reproduced
that. The patch to ssh_free() is mine and not known to fix any symptoms.

[originally from svn r9069]
[this svn revision also touched putty-wishlist]

13 years agoStop general_textout() from trying to slice up the input clipping
Simon Tatham [Thu, 30 Dec 2010 00:06:43 +0000 (00:06 +0000)]
Stop general_textout() from trying to slice up the input clipping
rectangle into smaller ones: it doesn't work any more, since the new
variable-pitch code can now call general_textout() with a larger
clipping rectangle than the text it's meant to be displaying. Instead,
general_textout() now uses the same semantics as the next loop up in
do_text_internal(): the first piece of text it displays uses the
opacity setting passed in, which blanks the entire clipping rectangle
if necessary, and then subsequent overlays are non-opaque. And the
same clipping rectangle is used throughout.

[originally from svn r9067]

13 years agoRationalise the mechanism in do_text_internal for providing the 'lpDx'
Simon Tatham [Wed, 29 Dec 2010 23:48:54 +0000 (23:48 +0000)]
Rationalise the mechanism in do_text_internal for providing the 'lpDx'
array to ExtTextOut:
 - move it inside the new big loop (this should fix a potential bug
   whereby the DBCS handling altered some elements of it but the loop
   did not actually step along it)
 - initialise it more sensibly
 - rename it to lpDx rather than IpDx, since as far as I can tell the
   latter name was derived from a misreading of the former in the
   Windows API docs.

[originally from svn r9066]

13 years agoMove some not-compiled-in debug code somewhere more useful.
Jacob Nevins [Wed, 29 Dec 2010 22:38:36 +0000 (22:38 +0000)]
Move some not-compiled-in debug code somewhere more useful.

[originally from svn r9065]

13 years agoFix segfault in general_textout with variable-pitch fonts: we can't
Simon Tatham [Wed, 29 Dec 2010 16:00:58 +0000 (16:00 +0000)]
Fix segfault in general_textout with variable-pitch fonts: we can't
pass null lpDx, because general_textout depends on it being filled in.
Instead we null it out in the calls to subroutines _from_
general_textout.

[originally from svn r9064]

13 years agoSupport for using variable-pitch fonts for the terminal on Windows.
Simon Tatham [Wed, 29 Dec 2010 14:11:25 +0000 (14:11 +0000)]
Support for using variable-pitch fonts for the terminal on Windows.

Done in much the same way as it is in the GTK front end: the character
cell width is determined using the font's digits (which seems to give
generally not-too-offensive spacing in most cases, at the expense of
Ms and Ws typically overhanging a bit into adjacent cells) and each
character is centred in its cell. Overhangs never leave permanent
droppings on the window, because the existing work done in r5003
handles them just fine even in this stressful scenario.

There's a hacky new checkbox in the Appearance panel to make
variable-pitch fonts appear in the font selector (they still don't by
default, because I still think it's _usually_ not What You Want); the
checkbox state is not actually stored as part of a saved session, but
it should be automatically ticked when reloading a session that's got
a variable pitch font selected.

(I'm half-expecting a potential flurry of requests for this feature in
the wake of http://xkcd.com/840/ , so I thought I'd pre-empt them :-)

[originally from svn r9063]
[r5003 == ba470dec5e37ffbde05425f48e7e9a64219aec2e]

13 years agoVyacheslav Andrejev points out a heap management goof in the new jump
Simon Tatham [Wed, 29 Dec 2010 13:35:44 +0000 (13:35 +0000)]
Vyacheslav Andrejev points out a heap management goof in the new jump
list code. Free the old value of the pointer variable we just
overwrote, not the new one!

[originally from svn r9062]

13 years agoThou shalt not suffer a misplaced apostrophe to live.
Simon Tatham [Wed, 29 Dec 2010 11:57:04 +0000 (11:57 +0000)]
Thou shalt not suffer a misplaced apostrophe to live.

[originally from svn r9061]

13 years agoFix resize handling when enabling and disabling full-screen mode.
Simon Tatham [Mon, 27 Dec 2010 12:58:39 +0000 (12:58 +0000)]
Fix resize handling when enabling and disabling full-screen mode.

I'm not sure whether I broke this in the recent revamp or whether it
was always broken, but: transitions in and out of full-screen mode
work by first maximising or restoring the window, which triggers a
WM_SIZE, whose handler then fiddles with the window style to disable
or re-enable all the furniture, which in turn triggers a recursive
WM_SIZE. The trouble is, after returning from the handler for the
inner WM_SIZE, the rest of the outer handler runs, and its client area
size is now out of date.

So I've added a flag which is set when a resize is handled 'properly',
so that after returning from the inner WM_SIZE handler the outer one
knows not to try to redo badly work that's already been done well.

[originally from svn r9056]

13 years agoAdd an option to disable SSH-2 banners.
Jacob Nevins [Mon, 27 Dec 2010 01:19:13 +0000 (01:19 +0000)]
Add an option to disable SSH-2 banners.

[originally from svn r9055]

13 years agoFix up svn:eol-style and svn:keywords on new files.
Jacob Nevins [Mon, 27 Dec 2010 00:24:48 +0000 (00:24 +0000)]
Fix up svn:eol-style and svn:keywords on new files.

[originally from svn r9054]

13 years agoRemove a couple of unused variables.
Jacob Nevins [Sun, 26 Dec 2010 23:23:11 +0000 (23:23 +0000)]
Remove a couple of unused variables.

[originally from svn r9053]

13 years agoTry to delete jump lists in "-cleanup".
Jacob Nevins [Sun, 26 Dec 2010 20:00:45 +0000 (20:00 +0000)]
Try to delete jump lists in "-cleanup".

[originally from svn r9050]

13 years agoOptionally define PropVariantInit() locally to restore ability to build with
Jacob Nevins [Sun, 26 Dec 2010 18:29:53 +0000 (18:29 +0000)]
Optionally define PropVariantInit() locally to restore ability to build with
MinGW after r9046, and munge the COMPTR() macro to remove a couple of warnings
with my MinGW GCC (3.4.5).

[originally from svn r9049]
[r9046 == 1a03fa9292f2258384d037994d8e8e119ac11458]

13 years agoDocument the behaviour of Alt in the "hybrid" resizing mode alluded to in
Jacob Nevins [Thu, 23 Dec 2010 22:19:13 +0000 (22:19 +0000)]
Document the behaviour of Alt in the "hybrid" resizing mode alluded to in
r9045.

[originally from svn r9047]
[r9045 == 6cd24c839d7f9b96b375e12560b254a1a9013dbf]

13 years agoSupport for Windows 7 jump lists (right-click on a program's taskbar
Simon Tatham [Thu, 23 Dec 2010 17:32:28 +0000 (17:32 +0000)]
Support for Windows 7 jump lists (right-click on a program's taskbar
icon, even if the program isn't running at the time, to be presented
with an application-defined collection of helpful links). The current
jump list is updated every time a saved session is loaded, and shows
the last few launchable saved sessions (i.e. not those like Default
Settings) that were loaded. Also, if Pageant or PuTTYgen or both is in
the same directory as the PuTTY binary, the jump list will present
links to launch those too.

Based on a patch sent last year by Daniel B. Roy, though it's barely
recognisable any more...

[originally from svn r9046]

13 years agoThe special treatment of Alt-resize (to cause resizing to affect the
Simon Tatham [Thu, 23 Dec 2010 17:16:19 +0000 (17:16 +0000)]
The special treatment of Alt-resize (to cause resizing to affect the
font instead of the terminal size) should only be active in
RESIZE_EITHER mode - in RESIZE_TERM it is worse than useless.

[originally from svn r9045]

13 years agoAnother fix to yesterday's window-resizing revamp: when restoring from
Simon Tatham [Thu, 23 Dec 2010 15:44:20 +0000 (15:44 +0000)]
Another fix to yesterday's window-resizing revamp: when restoring from
maximised state, we must be sure to disable the window offset used to
centre the terminal in cases where the window is non-negotiably the
wrong size (e.g. maximised). Hence we must call reset_window after our
terminal resize.

[originally from svn r9044]

13 years agoMore careful owner SID selection in the Pageant client code. This
Simon Tatham [Thu, 23 Dec 2010 15:22:50 +0000 (15:22 +0000)]
More careful owner SID selection in the Pageant client code. This
should solve some of the SID-mismatch issues we've occasionally had
reported. Because it's a modification on the client side, it doesn't
affect the security of Pageant itself.

[originally from svn r9043]

13 years agoPay attention to the width and height provided in WM_SIZE even when
Simon Tatham [Wed, 22 Dec 2010 16:14:11 +0000 (16:14 +0000)]
Pay attention to the width and height provided in WM_SIZE even when
restoring a maximised window.

Failure to do this was noticeable in the following scenario (again
using Aero UI enhancements):
 1. resize window using topmost resize handle, and move pointer to top
    of screen which 'maximises' the window vertically
 2. now maximise the window properly using the maximise button in top
    right
 3. now restore. Notepad restores to its position before step 1,
    because Aero remembers that position for the purpose, but PuTTY
    thinks it knows better. Only now it doesn't any more.

[originally from svn r9041]

13 years agoReorganise handling of WM_SIZE to fix two generality problems.
Simon Tatham [Wed, 22 Dec 2010 15:49:33 +0000 (15:49 +0000)]
Reorganise handling of WM_SIZE to fix two generality problems.

Firstly, maximise and restore events were expected never to occur
during an interactive resize process (i.e. between WM_ENTERSIZEMOVE
and WM_EXITSIZEMOVE), but in fact Aero now allows this to happen if
you move the pointer to the top of the screen while dragging the
window.

Secondly, plain old WM_SIZE events were expected never to occur
_outside_ interactive resizes, but Aero permits that too (e.g.
Windows-left and Windows-right), and also third-party window
repositioning tools will send these.

[originally from svn r9040]

13 years agoProtect against a (non-security-related) buffer overrun if PuTTY is
Simon Tatham [Tue, 21 Dec 2010 10:11:32 +0000 (10:11 +0000)]
Protect against a (non-security-related) buffer overrun if PuTTY is
installed somewhere with an exceptionally long pathname.

[originally from svn r9039]

13 years agoAdd an 'XLFLAGS' make variable to Makefile.vc, permitting user-
Simon Tatham [Mon, 20 Dec 2010 13:04:34 +0000 (13:04 +0000)]
Add an 'XLFLAGS' make variable to Makefile.vc, permitting user-
supplied extra link flags. This makes it reasonably convenient to
compile for Visual Studio debugging: just build using

  nmake /f Makefile.vc XFLAGS="/Zi /Od" XLFLAGS="/debug"

then load the resulting executable into Visual Studio (using 'Open
Project' rather than 'Open File') and the debugger should be able to
access the source.

[originally from svn r9038]

13 years agoAdd more possible baud rates to the Unix serial backend. These are the
Jacob Nevins [Wed, 8 Dec 2010 14:21:35 +0000 (14:21 +0000)]
Add more possible baud rates to the Unix serial backend. These are the
union of rates found in the termios.h of Linux 2.6.24 and "SunOS 5.6
Generic_105181-29 sun4u sparc SUNW,Ultra-4" machines. After a patch by
Thomas Bechtold.

[originally from svn r9028]

13 years agoMore sensible (and also more idiomatic) bounds checking on esc_args.
Simon Tatham [Tue, 7 Dec 2010 00:21:42 +0000 (00:21 +0000)]
More sensible (and also more idiomatic) bounds checking on esc_args.

[originally from svn r9027]

13 years agoDavid Laight reports that sometimes reads on a serial port will
Simon Tatham [Sat, 6 Nov 2010 17:22:38 +0000 (17:22 +0000)]
David Laight reports that sometimes reads on a serial port will
attempt to block, and hence return EAGAIN/EWOULDBLOCK, in spite of
the port having been reported readable by select(2). Don't treat
those errors as fatal.

[originally from svn r9020]

13 years agoBah, r9008 caused an assertion failure on Windows due to a clash with the
Jacob Nevins [Mon, 27 Sep 2010 11:33:40 +0000 (11:33 +0000)]
Bah, r9008 caused an assertion failure on Windows due to a clash with the
shortcuts for the preference list buttons. That'll teach me to only test the
Gtk version.

[originally from svn r9010]
[r9008 == 5981b5e99d30effebe2ce2f7fd5a57d0eba15381]