u/mdw/putty
12 years agoWhile I'm crusading against arbitrary limits, here's a redesign of
simon [Sun, 2 Oct 2011 11:50:45 +0000 (11:50 +0000)]
While I'm crusading against arbitrary limits, here's a redesign of
prompt_t to arrange that the buffer in which each prompt is stored can
be reallocated larger during the input process.

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

12 years agoTurn 'Filename' into a dynamically allocated type with no arbitrary
simon [Sun, 2 Oct 2011 11:01:57 +0000 (11:01 +0000)]
Turn 'Filename' into a dynamically allocated type with no arbitrary
length limit, just as I did to FontSpec yesterday.

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

12 years agoFix copy-and-paste error in command-line font selection in r9314.
jacob [Sat, 1 Oct 2011 18:00:49 +0000 (18:00 +0000)]
Fix copy-and-paste error in command-line font selection in r9314.

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

12 years agoChange the semantics of 'FontSpec' so that it's a dynamically
simon [Sat, 1 Oct 2011 17:38:59 +0000 (17:38 +0000)]
Change the semantics of 'FontSpec' so that it's a dynamically
allocated type.

The main reason for this is to stop it from taking up a fixed large
amount of space in every 'struct value' subunion in conf.c, although
that makes little difference so far because Filename is still doing
the same thing (and is therefore next on my list). However, the
removal of its arbitrary length limit is not to be sneezed at.

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

12 years agoWe shouldn't fork off a utmp helper subprocess when we aren't setuid,
simon [Mon, 19 Sep 2011 16:38:23 +0000 (16:38 +0000)]
We shouldn't fork off a utmp helper subprocess when we aren't setuid,
because (a) under that circumstance we won't be writing to utmp
anyway, and (b) if we aren't setuid, then we won't have created the
pty at the point we fork, so even if our subprocess _could_ have
written to utmp it wouldn't have done it right!

Spotted by valgrind (triggering on the access beyond the end of the
ttyname string in setup_utmp, clueing me in to it having been empty).

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

12 years agoAdd a missing initialisation to NULL.
simon [Mon, 19 Sep 2011 16:21:25 +0000 (16:21 +0000)]
Add a missing initialisation to NULL.

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

12 years agoCope with XFontStructs having a NULL per_char array, which happened to
simon [Sat, 17 Sep 2011 14:50:18 +0000 (14:50 +0000)]
Cope with XFontStructs having a NULL per_char array, which happened to
me this morning under strange circumstances.

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

12 years agoFix x11font_has_glyph so it doesn't get caught out by signed chars.
simon [Sat, 17 Sep 2011 08:11:11 +0000 (08:11 +0000)]
Fix x11font_has_glyph so it doesn't get caught out by signed chars.

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

12 years agoSuppress Pango's bidi, by displaying RTL characters one at a time. I
simon [Fri, 16 Sep 2011 19:18:58 +0000 (19:18 +0000)]
Suppress Pango's bidi, by displaying RTL characters one at a time. I
hadn't previously noticed, but Pango was helpfully re-reversing text
that PuTTY's own bidi module had already reversed, leading to Arabic
text being wrongly displayed and also total chaos when you move the
cursor over it or try to cut and paste it.

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

12 years agoSupport font fallback even when an X11 server-side font is selected,
simon [Fri, 16 Sep 2011 19:18:54 +0000 (19:18 +0000)]
Support font fallback even when an X11 server-side font is selected,
by introducing a wrapper around an individual unifont which falls back
to Pango (which already has built-in fallback) in the case where the
selected font doesn't support the glyph in question.

The wrapper itself is a (vestigial) subclass of unifont, to minimise
disturbance at the call sites.

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

12 years agoChange the unifont API so that text is passed right down to the
simon [Fri, 16 Sep 2011 19:18:53 +0000 (19:18 +0000)]
Change the unifont API so that text is passed right down to the
individual font implementation as wchar_t, rather than having to be
converted by the client into the appropriate MBCS/SBCS.

This also means I can remove 'real_charset' from the public-facing
contents of the unifont structure.

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

12 years agoAdd some missing consts in character set handling.
simon [Fri, 16 Sep 2011 19:18:52 +0000 (19:18 +0000)]
Add some missing consts in character set handling.

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

12 years agoRemove empty.h from CLEANFILES, so that after mkfiles.pl has
simon [Fri, 16 Sep 2011 09:01:41 +0000 (09:01 +0000)]
Remove empty.h from CLEANFILES, so that after mkfiles.pl has
constructed it it won't be deleted again by 'make clean'. The effect
is that not only does this work (as r9288 arranged),

  ./configure; make plink

but these work too:

  ./configure; make; make clean; make plink
  ./configure; make; make distclean; ./configure; make plink

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

12 years agoStop using GDK's wrapper on the X11 font functions (GdkFont). All X11
simon [Fri, 16 Sep 2011 08:49:08 +0000 (08:49 +0000)]
Stop using GDK's wrapper on the X11 font functions (GdkFont). All X11
font operations are now done directly using Xlib calls, and the only
interaction with GDK within the x11font mechanism is to get the X ids
for drawables, GCs and the X display itself.

This should remove an obstacle to porting to GTK3, and also makes the
XFontStruct for loaded fonts more readily available, which I hope will
come in handy for another plan I have in mind.

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

12 years agoCreate empty.h (used to force rebuilds of version.o by the automake
simon [Wed, 14 Sep 2011 15:54:26 +0000 (15:54 +0000)]
Create empty.h (used to force rebuilds of version.o by the automake
makefile) as a side effect of running mkfiles.pl.

The automake docs observe that the BUILT_SOURCES list is only
automatically built by plain 'make' or 'make all' or a couple of other
targets, so the sequence './configure && make plink' from a freshly
unpacked tar file would previously fail for lack of empty.h.

If empty.h had important _content_ that needed to be built at compile
time, of course, I wouldn't be able to fix it like this; but since the
only important thing is the timestamp, I can just make sure it already
exists at the time of first build.

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

12 years agoNo, I take that back: we _do_ have a mechanism for suppressing reads
simon [Wed, 14 Sep 2011 09:49:00 +0000 (09:49 +0000)]
No, I take that back: we _do_ have a mechanism for suppressing reads
from forwarding data sources which will be good enough to last until
we close the socket, in the form of the override_throttle() functions.
So this finishes up the work in r9283, by manufacturing outgoing EOF
in response to incoming CLOSE on all channel types.

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

12 years agoAnother tweak to EOF policy: invent an outgoing EOF on receipt of an
simon [Wed, 14 Sep 2011 09:09:35 +0000 (09:09 +0000)]
Another tweak to EOF policy: invent an outgoing EOF on receipt of an
incoming CHANNEL_CLOSE, if it's the main session channel. The idea is
that invocations such as 'plink -T hostname sh' (running a shell
without a remote pty) can be exited by typing 'exit' to the remote
shell, without plink blocking forever waiting for outgoing EOF.

I think it would be better to do the same for all other channel types
too, but that would need an extra API call which I haven't
implemented yet.

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

12 years agoChanged my mind about the EOF policy in SSH mode: I think the SSH
simon [Tue, 13 Sep 2011 15:38:12 +0000 (15:38 +0000)]
Changed my mind about the EOF policy in SSH mode: I think the SSH
backend should unilaterally assume outgoing EOF when it sees incoming
EOF, if and only if the main session channel is talking to a pty.
(Because ptys don't have a strong concept of EOF in the first place,
that seems like a sensible place to draw the line.) This fixes a bug
introduced by today's revamp in which if you used Unix Plink to run a
console session it would hang after you hit ^D - because the server
had sent EOF, but it was waiting for a client-side EOF too.

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

12 years agoNearly forgot noting this down in the 'half-closed' bug entry: don't
simon [Tue, 13 Sep 2011 11:56:25 +0000 (11:56 +0000)]
Nearly forgot noting this down in the 'half-closed' bug entry: don't
send CHANNEL_CLOSE until we have acks for all our winadj requests.
Should work around https://bugzilla.mindrot.org/show_bug.cgi?id=1818 .

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

12 years agoRevamp of EOF handling in all network connections, pipes and other
simon [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).

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

12 years agoIn term_init(), copy stuff out of the conf _before_ calling
simon [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.

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

12 years agoFix assertion failure in wprefs() when the list is zero-length. Breaks
simon [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.

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

12 years agoInstead of testing for different versions of GTK in increasing order
simon [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.

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

12 years agoAdd a -U option to mkfiles.pl, which is just like -u except that it
simon [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.)

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

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

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

12 years agoFix a suspected bug in PSCP's SCP protocol fallback from r9214 (untested since
jacob [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).

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

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

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

12 years agoReadjust Pageant's SID check _again_, to make it the union of the
simon [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.

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

12 years agoUpdates to svn:ignore: ignore libversion.a in the top-level directory
simon [Fri, 12 Aug 2011 17:28:47 +0000 (17:28 +0000)]
Updates to svn:ignore: ignore libversion.a in the top-level directory
(for people doing their builds there), and ignore 'compile' in the
unix subdirectory (a dropping from autotools that I missed).

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

12 years agoIf we're printing password prompts to /dev/tty rather than standard
simon [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.)

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

12 years agoPropagate file permissions in both directions in Unix pscp and psftp.
simon [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.

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

12 years agoFix bug in which the SSH-only tools (pscp, psftp) did not honour a
simon [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.

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

12 years agoMake the top-level configure wrapper executable. (I thought I'd done
simon [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.)

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

12 years agoAdd a convenience option to mkfiles.pl for Unix users. If you run
simon [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.

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

12 years agoAdd a wrapper script called 'configure' at the top level, which runs
simon [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.

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

12 years agoRename --with-gtk-version to --with-gtk, and support its negation
simon [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).

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

12 years agoSwitch to using automake for the Unix autoconfigured build.
simon [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.

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

12 years agoWhen we check for libX11 in the autoconf script, add it to $GTK_LIBS
simon [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.

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

12 years agoFix 'Duplicate Session' on Windows, broken during the config revamp.
simon [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.)

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

12 years agoTrivial fix for assertion failure introduced by the config revamp.
simon [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.

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

12 years agoMinor amendment to r9226: don't log GSSAPI failure in the Event Log
simon [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.)

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

12 years agoReinstate a missing invocation of the FONT_QUALITY macro which I
simon [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.

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

12 years agoFix a typo in r9214 that plausibly explains a resizing weirdness I had with
jacob [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.

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

12 years agoFix version reporting in Unix builds versioned by a specific svn
simon [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.

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

12 years ago--with-gtk-version option to configure, so you can explicitly tell it
simon [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.

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

12 years agoSupport for re-running autoconf in the absence of the autoconf macro
simon [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.

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

12 years agoReorganise the logging and display of messages about SSH
simon [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.)

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

12 years agoMostly cosmetic change: don't claim to have found an SSH agent if
simon [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'.)

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

12 years agoFix display of VT100 vertically-offset horizontal line characters
simon [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.

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

12 years agoDon't delete everything under a string-subkeyed primary key by using a
simon [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.

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

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

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

12 years agoconf_copy_into must empty the entire target conf before filling it
simon [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.

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

12 years agoWhen doing manual underlining, underline the text in question rather than a box
jacob [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.

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

12 years agoPost-release destabilisation! Completely remove the struct type
simon [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.

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

12 years agoReadjust checklist, because actually the section on updating the
simon [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.

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

12 years agoVarious updates to the release checklist:
simon [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.

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

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

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

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

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

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

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

12 years agoAdd a directory 'contrib/cygtermd', containing the source code for my
simon [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.

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

12 years agoGenerate some checksum files with more up-to-date hash functions than
simon [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.

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

12 years agoFix 'winadj-success': since at least one server (boks_sshd) blithely responds
jacob [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.

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

12 years agoRewrite gprefs() in settings.c so that its input mapping includes
simon [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).

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

12 years agoMake Pageant use the same SID-selection logic as the Pageant client
simon [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.

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

12 years agoWhen we fail to get a response from Pageant, we should log the fact.
simon [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.

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

13 years agoFixes (mostly from Colin Watson, a couple redone by me) to make Unix
simon [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.

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

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

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

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

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

13 years agoImplement zlib@openssh.com, using the rekey-after-userauth method suggested in
jacob [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.

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

13 years agoColin Watson reports that gnome-session has been known to leave
simon [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.

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

13 years agoSet the 'must_close_session' flag at the end of close_session(), so
simon [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.

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

13 years agoFix probably-harmless type mismatch in nogss.c (and #include "putty.h" to stop
jacob [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).

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

13 years agoAdd some extra validation to zlib decompression (primarily to shut up a GCC 4.6
jacob [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).

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

13 years agoAdd some "#ifdef OPTIMISE_SCROLL" scar tissue to placate GCC 4.6
jacob [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.

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

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

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

13 years agoUse pid_t more consistently. Should shut up a warning from GCC 4.6, and may
jacob [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.

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

13 years agoRejig the bottom-level loops in internal_mul_* to use pointers instead
simon [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.

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

13 years agoMake bignum.py self-contained, by importing versions of the two
simon [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.

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

13 years agoMove the malloc and free of scratch space out of the internal_mul
simon [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.

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

13 years agosvn:ignore property mentioning 'bignum.txt', which is what I'm calling
simon [Sun, 20 Feb 2011 15:45:23 +0000 (15:45 +0000)]
svn:ignore property mentioning 'bignum.txt', which is what I'm calling
the output of bignum.py.

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

13 years agoA few more modpow tests, exercising the fallback option. This is
simon [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.

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

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

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

13 years agoNearly forgot. Reinstate the original unoptimised modpow, as a
simon [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.)

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

13 years agoFix bug in Karatsuba multiplication, which affected propagation of a
simon [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.

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

13 years agoBeginnings of a test suite for the bignum code. The output of
simon [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.

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

13 years agoPrompt for a remote username in rlogin connections, if one wasn't
simon [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!)

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

13 years agoImplement the Chinese Remainder Theorem optimisation for speeding up
simon [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.

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

13 years agoImplement the Montgomery technique for speeding up modular
simon [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.

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

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

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

13 years agoAdd some appropriate bignum typedefs for generic 64-bit systems,
simon [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.

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

13 years agoAllow setting the WM_CLASS X window property as a configuration option
simon [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.

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

13 years agoTweak to r7635: when changing between protocols in the configuration dialog
jacob [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.

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

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

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

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

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

13 years agoWhen iterating over all channels for a dead SSH connection, don't miss out
jacob [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.

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

13 years agoStop general_textout() from trying to slice up the input clipping
simon [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.

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

13 years agoRationalise the mechanism in do_text_internal for providing the 'lpDx'
simon [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.

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

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

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

13 years agoFix segfault in general_textout with variable-pitch fonts: we can't
simon [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.

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

13 years agoSupport for using variable-pitch fonts for the terminal on Windows.
simon [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 :-)

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