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

3670 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 76a27757e6 Call sshfwd_unclean_close() in the event of a local socket error on a
forwarded X connection. (I somehow forgot to do this in r9364, despite
making the identical change in portfwd.c.)

[originally from svn r9470]
[r9364 == 49927f6c4d]
2012-04-23 17:59:53 +00:00
Simon Tatham 3225f3743e Patch from Robert de Bath to ifdef out the Windows-specific hack for
the offset horizontal line characters in the VT100 line-drawing set
(o,p,r,s), so that no trace of it - and hence no pointless performance
hit - is compiled into the cross-platform modules on non-Windows
platforms.

[originally from svn r9467]
2012-04-22 14:22:10 +00:00
Simon Tatham bb1d656dd4 Bug fix from Robert de Bath: if the utf8_override setting is changed
in mid-session, it affects translation and hence display, so it should
be listed among the settings that require a redraw.

[originally from svn r9466]
2012-04-22 14:22:08 +00:00
Simon Tatham b81b04f9b2 Bug fix from Robert de Bath: if wc_to_mb returns a length of zero, it
will not even initialise sbstring[0], so we shouldn't even look at it
let alone depend on it to tell us the desired character was absent.

[originally from svn r9465]
2012-04-22 14:22:08 +00:00
Simon Tatham f030975da7 Conditionalise the calls to premsg and postmsg in uxcons.c's
logevent(), which temporarily turn off the raw mode we've put stderr
into, so that they don't get called if the log_eventlog() call between
them is not _actually_ going to write to stderr.

Fixes a bug in which, if you define a Unix PuTTY saved session which
uses 'plink -nc' as a local proxy command and then run PuTTY
backgrounded from the shell with that session loaded, the subprocess
Plink would get SIGTTOU when it tried to muck about with stderr and
the whole thing would grind to a halt. I'm prepared to consider that
acceptable if Plink _really_ wants to write on standard error, but if
it doesn't, it should just carry on working in the background!

[originally from svn r9462]
2012-04-18 06:36:46 +00:00
Simon Tatham 5c743effc0 Fix a Perl warning about useless use of a constant in void context.
[originally from svn r9458]
2012-04-16 18:21:31 +00:00
Simon Tatham 76cdb3f523 New utility script to parse an SSH packet dump and write out an
interpretation with some analysis done on it. The script will do its
own tracking of the set of open channels and their states, and its
output is in a one-line-per-packet format such that every distinct
channel has a unique identifier in it which should make it easy to
grep out all lines relating to that channel. The script also matches
up {CHANNEL,REQUEST}_{SUCCESS,FAILURE} to the requests that caused
them, by tracking a queue of requests in each direction per channel
and for global requests. Command-line options permit generating a
final dump of all channels ever known to the script and their various
ids and final state, and also dumping out the data transferred over
each channel in each direction.

Output is not complete, in the sense that some parameters in some
messages (e.g. pixel sizes in window-size specifications) are
deliberately omitted due to being boring, and the entire contents of
some messages (e.g. KEXINIT) are omitted because I haven't yet seen
any purpose in decoding them. Filling them in might be a useful thing,
although I'm inclined to think that the default should still be to
show only the potentially interesting stuff (e.g. still not pixel
sizes!) and enable the rest using a -v option.

Hopefully this should do a lot of the legwork in debugging issues in
which a channel mysteriously remains partially open and prevents PuTTY
closing.

[originally from svn r9457]
2012-04-14 17:24:12 +00:00
Simon Tatham 047dc326b4 Add code in dlg_filesel_set and dlg_fontsel_set which makes them
duplicate the strings they pass to gtk_entry_set_text. I was already
doing that in dlg_editbox_set, but forgot to add the same code when I
revamped FontSpec and Filename to contain dynamically allocated
strings (r9314 and r9316 respectively). This fixes a bug where, on
some versions of GTK (but apparently not up-to-date versions), loading
a saved session causes gibberish to appear in file-selector edit boxes
accompanied by a valgrind error.

[originally from svn r9456]
[r9314 == 9c75fe9a3f]
[r9316 == 62cbc7dc0b]
2012-04-13 18:02:30 +00:00
Simon Tatham 63cb9c8356 Fallout from the big revamp in r9214: colour handling was going a bit
wonky because I'd used the subkey for the red component in four places
where I should have used the green/blue subkeys instead. Thanks to
Martin Kletzander for spotting it.

[originally from svn r9449]
[r9214 == a1f3b7a358]
2012-04-08 09:42:58 +00:00
Simon Tatham 947fa8f0ae Fix another type mismatch introduced by r9409.
[originally from svn r9427]
[r9409 == 053d2ba6d1]
2012-03-05 18:40:36 +00:00
Simon Tatham 78dc12eec7 Fix a type mismatch in minibidi.c - r9409 changed the 'wc' fields in
bidi_char from wchar_t to unsigned int, but omitted to similarly
adjust the parameter to doMirror which is passed a pointer to that
field.

[originally from svn r9426]
[r9409 == 053d2ba6d1]
2012-03-05 18:34:40 +00:00
Simon Tatham 9ecfbee08f Initialise some variables to NULL, to placate optimisers.
[originally from svn r9425]
2012-03-05 18:32:27 +00:00
Jacob Nevins 24f0a6f13b Remove comment about 1024/1023 RSA key lengths that's no longer true as of
r9421.

[originally from svn r9422]
[r9421 == 9604c2b367]
2012-03-04 01:01:11 +00:00
Simon Tatham 9604c2b367 Generate keys more carefully, so that when the user asks for an n-bit
key they always get an n-bit number instead of n-1. The latter was
perfectly harmless but kept confusing users.

[originally from svn r9421]
2012-03-04 00:24:49 +00:00
Simon Tatham e59f1ac827 Long overdue rewrapping of the primes[] array for legibility. I think
the previous ghastly formatting arose when I ran the whole source base
through GNU indent...

[originally from svn r9420]
2012-03-04 00:24:47 +00:00
Simon Tatham 948203f2c7 Update default key length in PuTTYgen to 2048.
[originally from svn r9414]
2012-02-19 10:44:04 +00:00
Simon Tatham 46bd2b0721 Update to 2007-05-26 version of upstream wcwidth.c.
[originally from svn r9413]
2012-02-19 10:32:44 +00:00
Simon Tatham 21b04f5e00 Patch from Matsui Nag to implement xterm's "bracketed paste mode", in
which text pasted into the terminal is preceded and followed by
special function-key-like escape sequences ESC[200~ and ESC[201~ so
that the application can identify it and treat it specially (e.g.
disabling auto-indent-same-as-previous-line in text editors). Enabled
and disabled by ESC[?2004h and ESC[?2004l, and of course off by
default.

[originally from svn r9412]
2012-02-19 10:27:18 +00:00
Simon Tatham 053d2ba6d1 Patch from Yoshida Masato to fill in the missing pieces of Windows
UTF-16 support. High Unicode characters in the terminal are now
converted back into surrogates during copy and draw operations, and
the Windows drawing code takes account of that when splitting up the
UTF-16 string for display. Meanwhile, accidental uses of wchar_t have
been replaced with 32-bit integers in parts of the cross-platform code
which were expecting not to have to deal with UTF-16.

[originally from svn r9409]
2012-02-17 19:28:55 +00:00
Simon Tatham e350ca2b4e WM_SIZE/SIZE_MAXIMIZED can show up even during an interactive resize,
so we should ensure we treat it the same way as other WM_SIZEs that
show up during that time: set the width and height in conf, and set
the flag to have that width and height enacted on WM_EXITSIZEMOVE.

Fixes a bug in which dragging a PuTTY window directly from the Win7
snapped-to-half-screen position to the snapped-to-maximised state
would leave the terminal in the pre-snapped size.

[originally from svn r9404]
2012-02-05 10:08:20 +00:00
Jacob Nevins f9a6c2e4a5 New FAQ: "When I put PuTTY in C:\WINDOWS\SYSTEM32 on my 64-bit Windows system,
`Duplicate Session' doesn't work." (Explanation courtesy Owen.)

[originally from svn r9391]
2012-01-30 00:29:32 +00:00
Jacob Nevins 0e6f6ff4eb It's a new year.
[originally from svn r9390]
[this svn revision also touched putty-website]
2012-01-26 18:53:53 +00:00
Simon Tatham 7c61b3c733 If we're called on to uncleanly close an SSH channel for which we've
already sent SSH2_MSG_CHANNEL_CLOSE, we should not skip the _whole_ of
sshfwd_unclean_close(), only the part about sending
SSH2_MSG_CHANNEL_CLOSE. It's still important to retag the SSH channel
as CHAN_ZOMBIE and clean up its previous data provider.

[originally from svn r9389]
2012-01-26 18:22:28 +00:00
Simon Tatham 736c5f86eb Patch from Colin Watson to use g_ascii_strcasecmp in place of the
deprecated g_strcasecmp (since all the strings being compared are
parts of XLFDs and won't be in interesting character sets anyway).

[originally from svn r9376]
2012-01-03 19:43:19 +00:00
Simon Tatham a80ba74239 Checklist update following the 0.62 release. I managed to send out the
announcement email without a subject line, so I'm reorganising the
announcement entry in the checklist in the hope that it'll make it
harder for me to get that one wrong in future!

[originally from svn r9371]
2011-12-10 14:03:02 +00:00
Simon Tatham c968d9fe8e Bump version number on trunk prior to tagging 0.62 on the branch.
[originally from svn r9365]
2011-12-10 12:07:46 +00:00
Simon Tatham 49927f6c4d Introduce a function sshfwd_unclean_close(), supplied by ssh.c to
subsidiary network modules like portfwd.c. To be called when the
subsidiary module experiences a socket error: it sends an emergency
CHANNEL_CLOSE (not just outgoing CHANNEL_EOF), and immediately deletes
the local side of the channel. (I've invented a new channel type in
ssh.c called CHAN_ZOMBIE, for channels whose original local side has
already been thrown away and they're just hanging around waiting to
receive the acknowledging CHANNEL_CLOSE.)

As a result of this and the last few commits, I can now run a port
forwarding session in which a local socket error occurs on a forwarded
port, and PuTTY now handles it apparently correctly, closing both the
SSH channel and the local socket and then actually recognising that
it's OK to terminate when all _other_ channels have been closed.
Previously the channel corresponding to the duff connection would
linger around (because of net_pending_errors never being called), and
keep being selected on (hence chewing CPU), and inhibit program
termination at the end of the session (because not all channels were
closed).

[originally from svn r9364]
2011-12-08 19:15:58 +00:00
Simon Tatham f892af999e Arrange to call net_pending_errors on Unix, which we've never actually
remembered to do before! Also some related fixes, such as that after
we do so we should immediately stop selecting on the socket in
question.

[originally from svn r9363]
2011-12-08 19:15:57 +00:00
Simon Tatham 8aa218e894 When we receive CHANNEL_CLOSE on an SSH-2 channel and haven't sent EOF
on it yet, we should send EOF on _that channel_, not the main session
channel! Oops.

[originally from svn r9362]
2011-12-08 19:15:55 +00:00
Simon Tatham 69a01afe48 Whitespace fix while I was passing.
[originally from svn r9361]
2011-12-08 19:15:54 +00:00
Simon Tatham 8e9868bda0 Make sure we never send window adjustments (or winadjes) on channels
for which we've already sent CHANNEL_CLOSE. It would be embarrassing
if the remote end had also sent CHANNEL_CLOSE in response and then
received our communication once it had forgotten about the channel.

[originally from svn r9360]
2011-12-08 19:15:53 +00:00
Simon Tatham 66ea8dc1b9 Block SIGPIPE in Unix plink. In a port-forwarding run we may have lots
of local sockets and pipes all open at once, and if one of them is
uncleanly closed from the remote end we don't want the whole
application to die - we want to close that socket's SSH channel and
continue with the rest of the run.

[originally from svn r9359]
2011-12-08 19:15:52 +00:00
Simon Tatham bb542eaeff Add a missing free_prompts() call in the keyboard-interactive code.
[originally from svn r9357]
2011-12-07 19:07:02 +00:00
Simon Tatham 1682b42b87 Tiny patch from Martin Packman to fix a Windows handle leak in
Pageant's IPC mechanism. It's incomplete (he sent a much more
comprehensive set of fixes that I haven't reviewed), but should be
adequate to mitigate a particular issue for Bazaar users.

[originally from svn r9355]
2011-11-28 19:23:43 +00:00
Simon Tatham 7d4789dccb I missed a bit in r9343: windows/version.rc2 also needed updating for
the new 'pre-release' version type.

[originally from svn r9353]
[r9343 == 1dff23a214]
2011-11-28 19:17:04 +00:00
Simon Tatham ce5be27773 Add a release checklist entry to remind me to get rid of 'pre-release'
sections on the Download page.

[originally from svn r9351]
2011-11-27 11:10:15 +00:00
Simon Tatham 1dff23a214 Introduce a new version type, 'prerelease'. Quotes the version number
it's a pre-release of, and the revision number so you can tell two
pre-releases apart. I intend to use this for builds from branch-0.61
until I call it 0.62 proper.

[originally from svn r9343]
2011-11-26 17:35:21 +00:00
Simon Tatham c72d4b413f Support code page 852. Thanks to Tamas Tevesz.
[originally from svn r9326]
2011-10-14 07:03:29 +00:00
Simon Tatham 6cfe48cde4 Private files saved on Unix should have mode 0600, not 0700. They're
generally private-key files, which have no need to be executable.

[originally from svn r9321]
2011-10-02 14:16:08 +00:00
Simon Tatham a27605c784 More arbitrary-limit hunting: retire PASSPHRASE_MAXLEN in the Windows
GUIs of Pageant and PuTTYgen. With that and the prompts_t redesign,
there should no longer be any limit on passphrase length other than
the patience of the user.

[originally from svn r9320]
2011-10-02 14:14:21 +00:00
Simon Tatham ff5a9c77fd Another utility function, to free a string containing sensitive data.
[originally from svn r9319]
2011-10-02 14:03:47 +00:00
Simon Tatham 535d77abf0 Move a recently introduced utility function out of the file in which I
declared it static, and into winutils.c where it can be more generally
accessible.

[originally from svn r9318]
2011-10-02 13:53:58 +00:00
Simon Tatham da66c0656a 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.

[originally from svn r9317]
2011-10-02 11:50:45 +00:00
Simon Tatham 62cbc7dc0b Turn 'Filename' into a dynamically allocated type with no arbitrary
length limit, just as I did to FontSpec yesterday.

[originally from svn r9316]
2011-10-02 11:01:57 +00:00
Jacob Nevins 342690f7cb Fix copy-and-paste error in command-line font selection in r9314.
[originally from svn r9315]
[r9314 == 9c75fe9a3f]
2011-10-01 18:00:49 +00:00
Simon Tatham 9c75fe9a3f 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.

[originally from svn r9314]
2011-10-01 17:38:59 +00:00
Simon Tatham f69591412c 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).

[originally from svn r9309]
2011-09-19 16:38:23 +00:00
Simon Tatham 73444adc50 Add a missing initialisation to NULL.
[originally from svn r9308]
2011-09-19 16:21:25 +00:00
Simon Tatham 0c4a041f9b Cope with XFontStructs having a NULL per_char array, which happened to
me this morning under strange circumstances.

[originally from svn r9303]
2011-09-17 14:50:18 +00:00
Simon Tatham f5b9da6f31 Fix x11font_has_glyph so it doesn't get caught out by signed chars.
[originally from svn r9295]
2011-09-17 08:11:11 +00:00