u/mdw/putty
13 years agoPatch from Alejandro Sedeno, somewhat modified by me, which
simon [Wed, 19 May 2010 18:22:17 +0000 (18:22 +0000)]
Patch from Alejandro Sedeno, somewhat modified by me, which
reorganises the GSSAPI support so that it handles alternative
implementations of the GSS-API. In particular, this means PuTTY can
now talk to MIT Kerberos for Windows instead of being limited to
SSPI. I don't know for sure whether further tweaking will be needed
(to the UI, most likely, or to automatic selection of credentials),
but testing reports suggest it's now at least worth committing to
trunk to get it more widely tested.

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

14 years agoWhen doing custom bob builds from a given SVN revision, include the
simon [Mon, 26 Apr 2010 17:28:42 +0000 (17:28 +0000)]
When doing custom bob builds from a given SVN revision, include the
date and time in the About box.

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

14 years agoBah, missed out a tiny but build-breaking part of r8926.
simon [Sat, 24 Apr 2010 07:14:29 +0000 (07:14 +0000)]
Bah, missed out a tiny but build-breaking part of r8926.

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

14 years agoNew SSH bug flag, for 'can't handle SSH2_MSG_IGNORE'. Another user
simon [Fri, 23 Apr 2010 18:32:15 +0000 (18:32 +0000)]
New SSH bug flag, for 'can't handle SSH2_MSG_IGNORE'. Another user
today reported an SSH2_MSG_UNIMPLEMENTED from a Cisco router which
looks as if it was triggered by SSH2_MSG_IGNORE, so I'm
experimentally putting this flag in. Currently must be manually
enabled, though if it turns out to solve the user's problem then
I'll probably add at least one version string...

[Edited commit message: actually, I also committed in error a piece
of experimental code as part of this checkin. Serve me right for not
running 'svn diff' first.]

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

14 years agoAdd comments on OpenSSH AES-encrypted key support, including one
simon [Mon, 12 Apr 2010 11:02:06 +0000 (11:02 +0000)]
Add comments on OpenSSH AES-encrypted key support, including one
mentioning that I haven't yet switched to _exporting_ OpenSSH keys
in the new style.

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

14 years agoSupport importing of new-style OpenSSH private keys (encrypted by
simon [Mon, 12 Apr 2010 10:55:31 +0000 (10:55 +0000)]
Support importing of new-style OpenSSH private keys (encrypted by
AES rather than 3DES).

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

14 years agoRemove SECURITY_WIN32 (knock-on from r8910, which validates it somewhat).
jacob [Fri, 26 Mar 2010 00:54:05 +0000 (00:54 +0000)]
Remove SECURITY_WIN32 (knock-on from r8910, which validates it somewhat).

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

14 years agor8909 broke the Visual Studio build.
jacob [Thu, 25 Mar 2010 18:41:27 +0000 (18:41 +0000)]
r8909 broke the Visual Studio build.

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

14 years agoWhen looking for a local username on Windows, if we can get hold of the
jacob [Wed, 24 Mar 2010 20:12:25 +0000 (20:12 +0000)]
When looking for a local username on Windows, if we can get hold of the
NameUserPrincipal, use that; this avoids an issue with SSPI/GSSAPI where
the user logged in to the local machine with a different case of username
to the (case-sensitive) Kerberos username. Falls back to GetUserName as
before if that doesn't work (for machines not on a domain, and Win9x).
Based on a patch by SebastianUnger.

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

14 years agor8854/5 broke compilation with Gtk 1.2. Grow a hack to cope.
jacob [Sun, 14 Mar 2010 18:58:20 +0000 (18:58 +0000)]
r8854/5 broke compilation with Gtk 1.2. Grow a hack to cope.

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

14 years agoI think r8738 broke IPv6 in MSVC Windows builds due to conflict with the
jacob [Sat, 13 Mar 2010 15:14:30 +0000 (15:14 +0000)]
I think r8738 broke IPv6 in MSVC Windows builds due to conflict with the
WspiapiGetAddrInfo wrapper for getaddrinfo() in MSVC. Split GET_WINDOWS_FUNCTION
into two variants, one with the old behaviour (bypassing the preprocessor) and
another with the new behaviour (for ANSI/Unicode, although it's not actually
used anywhere currently).

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

14 years agoTweak description of dynamic port forwarding, and point people running into
jacob [Sat, 13 Mar 2010 14:47:14 +0000 (14:47 +0000)]
Tweak description of dynamic port forwarding, and point people running into
'Out of space for port forwardings' at it.

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

14 years agoCentralise generation of the control sequences for arrow keys into a
simon [Sat, 6 Mar 2010 15:50:26 +0000 (15:50 +0000)]
Centralise generation of the control sequences for arrow keys into a
function in terminal.c, and replace the cloned-and-hacked handling
code in all our front ends with calls to that.

This was intended for code cleanliness, but a side effect is to make
the GTK arrow-key handling support disabling of application cursor
key mode in the Features panel. Previously that checkbox was
accidentally ignored, and nobody seems to have noticed before!

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

14 years agoUnix console utilities should send prompts to /dev/tty or failing
simon [Sat, 20 Feb 2010 19:15:25 +0000 (19:15 +0000)]
Unix console utilities should send prompts to /dev/tty or failing
that stderr, not to stdout.

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

14 years agoColin Watson reports that linking with 'gold' doesn't work, because
simon [Sat, 20 Feb 2010 19:06:30 +0000 (19:06 +0000)]
Colin Watson reports that linking with 'gold' doesn't work, because
PuTTY makes explicit use of libX11 without including -lX11 on the
link line. (GNU ld appears to pull in libX11 automatically because
it's needed for the dependencies of GTK, but gold expects that
dependency to be satisfied at run time via DT_NEEDED and hence
doesn't bother.) Hence, add explicit -lX11 to both Makefile.gtk and
the autoconf world.

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

14 years agoUpdate to r8614: another -D_FORTIFY_SOURCE=2 fix.
simon [Sat, 20 Feb 2010 11:21:25 +0000 (11:21 +0000)]
Update to r8614: another -D_FORTIFY_SOURCE=2 fix.

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

14 years agoNull out the socket pointers in X- and port-forwarding channels for
simon [Wed, 17 Feb 2010 19:02:04 +0000 (19:02 +0000)]
Null out the socket pointers in X- and port-forwarding channels for
which we close the socket without destroying the channel. John
Peterson reports periodic crashes under heavy load which appear to
be fixed by this, though I don't know the exact circumstances
induced by that load.

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

14 years ago...and the rest of r8854.
jacob [Mon, 25 Jan 2010 14:33:39 +0000 (14:33 +0000)]
...and the rest of r8854.

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

14 years agoOur handling of timers in Gtk was truncating times on 64-bit systems; one
jacob [Sat, 23 Jan 2010 12:25:31 +0000 (12:25 +0000)]
Our handling of timers in Gtk was truncating times on 64-bit systems; one
symptom was that the terminal window would not update until a focus-change
event. Spotted and patched by Max Kellermann.

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

14 years agoRevert r8847, which was bilge; I can't magically change the order of a tree
jacob [Sun, 17 Jan 2010 23:53:29 +0000 (23:53 +0000)]
Revert r8847, which was bilge; I can't magically change the order of a tree
just by giving a different sorting function to find234().

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

14 years agoIt's a new year.
jacob [Sun, 17 Jan 2010 17:27:27 +0000 (17:27 +0000)]
It's a new year.

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

14 years agoChange expiry of timers when their contexts go away from lazy to eager.
jacob [Sun, 17 Jan 2010 16:22:35 +0000 (16:22 +0000)]
Change expiry of timers when their contexts go away from lazy to eager.
Intended to be of benefit to derived code making many connections from a single
process.

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

14 years agoPlug a few minor memory leaks, based on a patch by Sirp Potijk.
jacob [Sun, 17 Jan 2010 16:20:45 +0000 (16:20 +0000)]
Plug a few minor memory leaks, based on a patch by Sirp Potijk.
While I'm here, add an assertion in sshrand.c to catch mistakes in reference
counting.

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

14 years agoOn Windows, character set specifications of the form 'IBM437' would never have
jacob [Sun, 22 Nov 2009 19:10:11 +0000 (19:10 +0000)]
On Windows, character set specifications of the form 'IBM437' would never have
worked due to a typo. Spotted by Todd Burkey.

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

14 years agoAdd a keyboard shortcut for the "serial" protocol to the GUI.
jacob [Fri, 13 Nov 2009 13:24:32 +0000 (13:24 +0000)]
Add a keyboard shortcut for the "serial" protocol to the GUI.
Will cause non-zero, but hopefully acceptable, disruption to people's finger
macros.

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

14 years agoPatch from Tim Kosse to fix 64-bit-cleanness in SHA-512.
simon [Tue, 10 Nov 2009 19:14:15 +0000 (19:14 +0000)]
Patch from Tim Kosse to fix 64-bit-cleanness in SHA-512.

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

14 years agoWe defined tried_shgetfolderpath but never actually set it. Harmless, but fixed.
jacob [Sun, 8 Nov 2009 19:25:22 +0000 (19:25 +0000)]
We defined tried_shgetfolderpath but never actually set it. Harmless, but fixed.

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

14 years agoUse DECL/GET_WINDOWS_FUNCTION in a few more places in place of ad-hoc
jacob [Sun, 8 Nov 2009 19:22:28 +0000 (19:22 +0000)]
Use DECL/GET_WINDOWS_FUNCTION in a few more places in place of ad-hoc
GetProcAddress().

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

14 years agoMove the two existing DECL/GET_foo_FUNCTION macro sets used for dynamic
jacob [Sun, 8 Nov 2009 18:47:41 +0000 (18:47 +0000)]
Move the two existing DECL/GET_foo_FUNCTION macro sets used for dynamic
linking on Windows into a single global one, which can cope with function
renaming. Intended to enable eventual removal of ANSI-specific DoSomethingA
references (although I've not removed any).

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

14 years agoImprove buffer handling in Windows sk_getaddr() -- we were passing
jacob [Sun, 8 Nov 2009 18:25:29 +0000 (18:25 +0000)]
Improve buffer handling in Windows sk_getaddr() -- we were passing
uninitialised storage into WSAAddressToString()'s length function (and
presumably getting away with it by luck).
Also improve error handling (exposed by my Wine installation, which returns
an error from WSAAddressToString() for connections to localhost for some
reason).

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

14 years agoStop trying to enumerate all the kinds of Windows we support on the download
jacob [Sun, 1 Nov 2009 22:06:05 +0000 (22:06 +0000)]
Stop trying to enumerate all the kinds of Windows we support on the download
page. Define in more detail what we mean by "Windows" in the Ports section of
the FAQ.

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

14 years agoRemove is_shift_pressed() -- it's not been used since r4906.
jacob [Sun, 27 Sep 2009 16:20:39 +0000 (16:20 +0000)]
Remove is_shift_pressed() -- it's not been used since r4906.

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

14 years agoAnother warning fix and cosmetic tweakage.
jacob [Sun, 27 Sep 2009 16:07:10 +0000 (16:07 +0000)]
Another warning fix and cosmetic tweakage.

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

14 years agoQuell more warnings and, perhaps, avoid alignment faults on 64-bit Windows.
jacob [Sun, 27 Sep 2009 15:52:13 +0000 (15:52 +0000)]
Quell more warnings and, perhaps, avoid alignment faults on 64-bit Windows.

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

14 years agoFix some (probably harmless) warnings.
jacob [Sun, 27 Sep 2009 15:31:08 +0000 (15:31 +0000)]
Fix some (probably harmless) warnings.

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

14 years agoChange manifest files to declare Windows GUI apps to be "DPI-aware", that is,
jacob [Fri, 25 Sep 2009 23:32:14 +0000 (23:32 +0000)]
Change manifest files to declare Windows GUI apps to be "DPI-aware", that is,
not fazed by being displayed at other than 96DPI; testing on Vista at a range
of DPIs indicates that we cope (with the minor and inevitable exception of the
drag-list control).
This stops pixel scaling and hence fuzzy display on high-resolution displays.
(Hope this is last disastrous than my last set of manifest tweaks! --
<http://support.fogcreek.com/default.asp?copilot.6.26840.1> suggests that this
is an OK thing to do.)

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

14 years agoFix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse.
jacob [Wed, 16 Sep 2009 22:28:20 +0000 (22:28 +0000)]
Fix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse.

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

14 years agoSince r7266, it's been possible to get a hostname into Default Settings; but
jacob [Mon, 14 Sep 2009 21:26:48 +0000 (21:26 +0000)]
Since r7266, it's been possible to get a hostname into Default Settings; but
plink did not cope gracefully with this -- it was not possible to override that
hostname on the command line (attempts at doing so would be treated as part of
the remote command).
Fix this by applying the principle of r7265: if the user didn't explicitly
specify that they wanted to launch the hostname in the default (for instance
with '-load "Default Settings"', we assume they don't want to, and such a
hostname doesn't count when deciding whether to treat a non-option argument as
hostname or command.

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

14 years agoIn Unix PuTTY, grey out "Restart Session" when it doesn't apply (as the Windows
jacob [Sun, 13 Sep 2009 23:41:55 +0000 (23:41 +0000)]
In Unix PuTTY, grey out "Restart Session" when it doesn't apply (as the Windows
version does), rather than hiding it completely.

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

14 years agoAdd a couple of ellipses in Unix context menu (like r759 on Windows).
jacob [Sun, 13 Sep 2009 23:37:55 +0000 (23:37 +0000)]
Add a couple of ellipses in Unix context menu (like r759 on Windows).

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

14 years agoIf there are no saved sessions, put a grayed "(No sessions)" entry on the saved
jacob [Sun, 13 Sep 2009 23:29:11 +0000 (23:29 +0000)]
If there are no saved sessions, put a grayed "(No sessions)" entry on the saved
sessions submenu of the terminal window context menu (as Pageant does), rather
than an empty menu (which often renders poorly).

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

14 years agoAvoid compiling autoconf test programs with -Wall -Werror; doing so causes
jacob [Sun, 30 Aug 2009 13:16:50 +0000 (13:16 +0000)]
Avoid compiling autoconf test programs with -Wall -Werror; doing so causes
trouble on Ubuntu, where the Gtk test programs don't check the return value
from system() and thus fall foul of the combination of our -Werror and
<https://wiki.ubuntu.com/CompilerFlags#-D_FORTIFY_SOURCE=2>.

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

14 years agoMinor improvements to error reporting in logging.
jacob [Sun, 30 Aug 2009 11:09:22 +0000 (11:09 +0000)]
Minor improvements to error reporting in logging.

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

14 years agoRemove outdated comment.
jacob [Fri, 21 Aug 2009 23:25:48 +0000 (23:25 +0000)]
Remove outdated comment.

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

14 years agoFrom Corey Stup: when we're declaring stuff for WSAAddressToStringA, we should
jacob [Fri, 21 Aug 2009 22:29:58 +0000 (22:29 +0000)]
From Corey Stup: when we're declaring stuff for WSAAddressToStringA, we should
use the explicitly-narrow type LPSTR, not the switchable type LPTSTR. (Since
we currently build without UNICODE this makes no practical difference to us
now.)

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

14 years agoCorey Stup points out a memory leak in the local-proxy implementations.
jacob [Fri, 21 Aug 2009 21:16:22 +0000 (21:16 +0000)]
Corey Stup points out a memory leak in the local-proxy implementations.

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

14 years agoCorey Stup points out that any attempt to display the message "Unable to load
jacob [Fri, 21 Aug 2009 20:05:24 +0000 (20:05 +0000)]
Corey Stup points out that any attempt to display the message "Unable to load
any WinSock library" will lead to a segfault.

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

14 years agoAttempt to filter out duplicate port forwardings in the GUI.
jacob [Tue, 18 Aug 2009 23:51:49 +0000 (23:51 +0000)]
Attempt to filter out duplicate port forwardings in the GUI.

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

14 years agoFix handling of duplicate port forwardings; they were effectively cancelling
jacob [Tue, 18 Aug 2009 23:38:48 +0000 (23:38 +0000)]
Fix handling of duplicate port forwardings; they were effectively cancelling
out, but are now just ignored.
(We should make more effort to prevent duplicates before they get as far as
ssh_setup_portfwd() -- it's currently trivially easy to enter them in the
GUI and on the command line, let alone both -- but there's bound to be someone
with a saved session containing dupes out there by now, and anyway there are
duplicates we can't detect before getting this far, for instance
"1234:localhost:22" vs "1234:localhost:ssh".)

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

14 years agoQuell "config.status: WARNING: Makefile.in seems to ignore the --datarootdir
jacob [Sun, 16 Aug 2009 22:51:20 +0000 (22:51 +0000)]
Quell "config.status: WARNING:  Makefile.in seems to ignore the --datarootdir
setting" warning when running ./configure, per
<http://www.gnu.org/software/autoconf/manual/html_node/Changed-Directory-Variables.html>

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

14 years agoKeep the state of the "Full Screen" menu item on the Ctrl+right-click context
jacob [Sat, 15 Aug 2009 17:45:17 +0000 (17:45 +0000)]
Keep the state of the "Full Screen" menu item on the Ctrl+right-click context
menu in sync with reality and the system menu.

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

14 years agoAdd "-serial" to Plink's usage message.
jacob [Thu, 13 Aug 2009 22:01:20 +0000 (22:01 +0000)]
Add "-serial" to Plink's usage message.

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

14 years agoPatch from Alan Clucas (somewhat polished) providing command-line
simon [Mon, 10 Aug 2009 20:55:19 +0000 (20:55 +0000)]
Patch from Alan Clucas (somewhat polished) providing command-line
options to select and configure serial port mode.

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

14 years agoFixes for re-entrant calls in the serial configuration list boxes.
simon [Mon, 10 Aug 2009 20:38:46 +0000 (20:38 +0000)]
Fixes for re-entrant calls in the serial configuration list boxes.
(I'm starting to think I made an egregious design error somewhere in
this mechanism.)

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

14 years agoWorkarounds for compiling with -D_FORTIFY_SOURCE=2 (as Ubuntu does), which
jacob [Fri, 7 Aug 2009 00:19:04 +0000 (00:19 +0000)]
Workarounds for compiling with -D_FORTIFY_SOURCE=2 (as Ubuntu does), which
doesn't like you to ignore the return value from read()/write()/etc (and
apparently can't be shut up with a cast to void).

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

14 years agoMore use of sockaddr_union (above and beyond that necessary to remove current
jacob [Thu, 6 Aug 2009 22:55:15 +0000 (22:55 +0000)]
More use of sockaddr_union (above and beyond that necessary to remove current
warnings).

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

14 years agoAvoid "dereferencing pointer 'sa' does break strict-aliasing rules" warnings
jacob [Thu, 6 Aug 2009 22:12:05 +0000 (22:12 +0000)]
Avoid "dereferencing pointer 'sa' does break strict-aliasing rules" warnings
from recent versions of GCC.

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

14 years agoAlex Besogonov suggests that our Unix autoconf GSSAPI library search order is
jacob [Tue, 28 Jul 2009 23:45:48 +0000 (23:45 +0000)]
Alex Besogonov suggests that our Unix autoconf GSSAPI library search order is
sub-optimal -- apparently it prefers shishi above Heimdal, and apparently
that's bad.

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

14 years agoMention Makefile.ux.
jacob [Tue, 28 Jul 2009 23:30:38 +0000 (23:30 +0000)]
Mention Makefile.ux.
Be less certain about the possibility of building with vanilla VC6.
Provide more details of actively tested toolchains.

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

14 years agoInclude putty.h (and hence uxconfig.h) before testing for NO_GSSAPI, so that
jacob [Tue, 28 Jul 2009 23:20:50 +0000 (23:20 +0000)]
Include putty.h (and hence uxconfig.h) before testing for NO_GSSAPI, so that
"./configure --without-gssapi" actually works. Spotted by Rob Shinn.

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

14 years agoTypo: replace a \i with a \I.
simon [Sun, 12 Jul 2009 12:02:58 +0000 (12:02 +0000)]
Typo: replace a \i with a \I.

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

14 years agoClearing and refilling the code-pages list box can cause a
simon [Wed, 10 Jun 2009 17:42:15 +0000 (17:42 +0000)]
Clearing and refilling the code-pages list box can cause a
re-entrant call to its handler in config.c, which destroys the
previous value in cfg->line_codepage. Therefore, preserve the right
value in an automatic variable until all the re-entrant calls have
finished.

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

15 years agoAdd a 'unix' Makefile type, for building the non-GUI parts of the
simon [Mon, 11 May 2009 18:48:43 +0000 (18:48 +0000)]
Add a 'unix' Makefile type, for building the non-GUI parts of the
PuTTY suite on non-GTK-enabled build platforms.

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

15 years agoPango-based font handling: combine display of adjacent characters
simon [Mon, 11 May 2009 08:46:17 +0000 (08:46 +0000)]
Pango-based font handling: combine display of adjacent characters
into a single gdk_draw_layout() where conveniently feasible, after
some work with xtrace revealed this as a major source of pterm's
slow display updates when using client-side fonts.

Ideally we ought to be able to do better. I know exactly what
sequence of X protocol operations I want to see on the wire, but I
don't know how to persuade Pango to generate them.

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

15 years agoAnsgar Wiechers points out that known_hosts (at least OpenSSH's) has grown a
jacob [Sun, 26 Apr 2009 23:44:28 +0000 (23:44 +0000)]
Ansgar Wiechers points out that known_hosts (at least OpenSSH's) has grown a
means of specifying port numbers, so we should support that.

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

15 years agoDiscard hashed hostnames from input.
jacob [Sun, 26 Apr 2009 23:03:02 +0000 (23:03 +0000)]
Discard hashed hostnames from input.

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

15 years agoReported by Tim Kosse: on Unix, read_random_seed() wasn't correctly checking
jacob [Sun, 26 Apr 2009 22:32:41 +0000 (22:32 +0000)]
Reported by Tim Kosse: on Unix, read_random_seed() wasn't correctly checking
the return from open() and behaved wrongly in the absence of a seed file.

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

15 years agoSeveral people have spotted an uninitialised structure member leading to a
jacob [Sun, 26 Apr 2009 22:19:30 +0000 (22:19 +0000)]
Several people have spotted an uninitialised structure member leading to a
potential crash on "reget" in Unix PSFTP.

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

15 years agoRichard Clark points out a missing check for ssh->mainchan being NULL.
simon [Fri, 24 Apr 2009 18:45:22 +0000 (18:45 +0000)]
Richard Clark points out a missing check for ssh->mainchan being NULL.

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

15 years agoWhen giving authorisation errors from the proxy code in x11fwd.c,
simon [Thu, 23 Apr 2009 17:39:36 +0000 (17:39 +0000)]
When giving authorisation errors from the proxy code in x11fwd.c,
name the proxy using the global 'appname' variable, instead of
statically calling it PuTTY.

(Knock-on effect is that PSCP and PSFTP have to declare that
variable, though of course they shouldn't ever actually _use_ the X
forwarding code. Probably I ought to replace it with a stub
nox11fwd.c for those applications.)

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

15 years agoWhen starting a SOCKS connection in dynamic forwarding, freeze the
simon [Thu, 23 Apr 2009 17:33:42 +0000 (17:33 +0000)]
When starting a SOCKS connection in dynamic forwarding, freeze the
local socket _before_ calling the SSH setup functions. This makes no
difference to ssh.c itself, but it makes portfwd.c easier to reuse
for other purposes (e.g. as a component of a standalone SOCKS
server), because now ssh_send_port_open() can itself call
pfd_confirm() without the freeze and unfreeze happening in the wrong
order.

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

15 years agoSupport in the cross-platform code for translating to and from
simon [Tue, 24 Mar 2009 22:24:31 +0000 (22:24 +0000)]
Support in the cross-platform code for translating to and from
UTF-16 when exchanging wchar_t strings with the front end. Enabled
by a #define in the platform's header file (one should not
promiscuously translate UTF-16 surrogate pairs on 32-bit wchar_t
platforms since that could give rise to redundant encoding attacks),
which is present on Windows.

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

15 years agoFix cosmetic keyboard-interactive issue: at the end of a normal k-i session,
jacob [Tue, 3 Mar 2009 19:57:58 +0000 (19:57 +0000)]
Fix cosmetic keyboard-interactive issue: at the end of a normal k-i session,
some servers (Debian in particular seems prone to this) send a k-i packet with
no prompts and nothing to display. We were printing an extra "Using
keyboard-interactive authentication" message in this case. (Introduced by me
in r8172, I think.)

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

15 years agoHandle more gracefully the possibility of a keyboard-interactive
simon [Tue, 3 Mar 2009 18:35:53 +0000 (18:35 +0000)]
Handle more gracefully the possibility of a keyboard-interactive
prompts packet containing no actual prompts (perhaps due to odd
server organisation, or perhaps so it can print a banner message and
do nothing else). Previously, the get_userpass_input functions
always returned failure when in '-batch' mode, even in this case
where no actual input would be required.

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

15 years agoStop using physical tabs in Python. (I was goaded into doing this by
simon [Sat, 28 Feb 2009 23:04:58 +0000 (23:04 +0000)]
Stop using physical tabs in Python. (I was goaded into doing this by
my editor, which has defaulted to showing them as explicit ^I for a
while now, but it seems like a generally prudent idea in any case.)

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

15 years agoDebian bug #517535: we were unconditionally interpreting the
simon [Sat, 28 Feb 2009 16:52:42 +0000 (16:52 +0000)]
Debian bug #517535: we were unconditionally interpreting the
'string' field in a GdkEventKey structure as ISO-8859-1, which was
correct for GTK 1.2 but in 2.0 that field is encoded according to
the current C library locale. Hence, we now process that field by
converting it to UTF-8 via trips through both libc and libcharset,
and then let lpage_send() convert from UTF-8 back to whatever it's
supposed to actually go down the line in.

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

15 years agoFix inaccurate error message.
jacob [Tue, 24 Feb 2009 22:56:44 +0000 (22:56 +0000)]
Fix inaccurate error message.

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

15 years agoSince r8305, Unix PuTTY has always "upgraded" an X11 display like "localhost:0"
jacob [Tue, 24 Feb 2009 01:01:23 +0000 (01:01 +0000)]
Since r8305, Unix PuTTY has always "upgraded" an X11 display like "localhost:0"
to a Unix-domain socket. This typically works fine when PuTTY is run on the
same machine as the X server, but it's broken multi-hop X forwarding through
OpenSSH; when OpenSSH creates a proxy X server "localhost:10", it only listens
on TCP, not on a Unix-domain socket.

Instead, when deciding on the details of the display, we actively probe to see
if there's a Unix-domain socket we can use instead, and only use it if it's
there, falling back to the specified IP "localhost" if not.

Independently, when looking for local auth details in Xauthority for a
"localhost" TCP display, we prefer a matching Unix-domain entry, but will fall
back to an IP "localhost" entry (which would be unusual, but we don't trust a
Windows X server not to do it) -- this is a generalisation of the special case
added in r2538 (but removed in r8305, as the automatic upgrade masked the need
for it).
(This is now done in platform-independent code, so a side-effect is that
get_hostname() is now part of the networking abstraction on all platforms.)

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

15 years agoStop attempting to make session logs private on Unix. This was introduced in
jacob [Mon, 23 Feb 2009 22:40:09 +0000 (22:40 +0000)]
Stop attempting to make session logs private on Unix. This was introduced in
r7084 at the same time as sensible permissions when writing private key files;
however, it causes an assertion failure whenever an attempt is made to append
to an existing log file on Unix, and it's not clear what "is_private" *should*
do for append, so revert to log file security being the user's responsibility.
(Fixes Ubuntu LP#212711.)

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

15 years agoThe Windows config option to point at an X authority file is only
simon [Tue, 3 Feb 2009 21:22:52 +0000 (21:22 +0000)]
The Windows config option to point at an X authority file is only
read at connection setup time, so don't offer it in the Change
Settings dialog box.

(In particular, this fixes an assertion failure when selecting
Change Settings on a non-SSH connection, since wincfg.c would have
added that control to Connection/SSH/X11 when the parent panel
Connection/SSH didn't exist. Making the control conditional on the
selected protocol would have been sufficient to fix that failure,
but I now realise that the setting should never have been presented
in mid-session in any case.)

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

15 years agoDon't call ReleaseCapture() on any mouse-button-up event. Instead,
simon [Wed, 21 Jan 2009 18:47:03 +0000 (18:47 +0000)]
Don't call ReleaseCapture() on any mouse-button-up event. Instead,
only call it when the _last_ mouse button comes back up. Otherwise,
xterm mouse tracking will lose a button-up event if you press down
two buttons, move the mouse outside the window, then release them
one at a time.

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

15 years agoCheck the two popen() calls in noise_get_heavy for NULL.
simon [Tue, 13 Jan 2009 18:18:35 +0000 (18:18 +0000)]
Check the two popen() calls in noise_get_heavy for NULL.

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

15 years agoPatch from Gert-Jan Vons: create an event handle to go in the
simon [Mon, 12 Jan 2009 20:41:28 +0000 (20:41 +0000)]
Patch from Gert-Jan Vons: create an event handle to go in the
OVERLAPPED structure in output threads, as we already do for input
threads. This apparently sorts out a hanging issue with serial ports
when trying to do simultaneous read and write, because (GJV says,
and it sounds plausible to me) in the absence of that event object
Windows signals the file handle itself to notify GetOverlappedResult
that it can return - and since the file handle might be being
signalled by a read operation instead, that leads to ambiguity.
Using an explicit event object in both directions means Windows
always knows which way the data is going.

Also a trivial fix in handle_output_new(), which was referencing the
wrong element of a union due to a copy and paste error. (Since the
result was address-taken and cast to void *, this wasn't a
functional error, but it was conceptually wrong.)

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

15 years agoArguments to ctype functions are required to be either EOF or representable
ben [Sun, 11 Jan 2009 14:26:27 +0000 (14:26 +0000)]
Arguments to ctype functions are required to be either EOF or representable
as unsigned char.  This means that passing in a bare char is incorrect on
systems where char is signed.  Sprinkle some appropriate casts to prevent
this.

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

15 years agoPropagate my ctype fixes (r8404) from libcharset.
ben [Sun, 11 Jan 2009 14:20:34 +0000 (14:20 +0000)]
Propagate my ctype fixes (r8404) from libcharset.

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

15 years agoWeaken the assertion in general_textout(). It was failing in the
simon [Fri, 9 Jan 2009 18:55:45 +0000 (18:55 +0000)]
Weaken the assertion in general_textout(). It was failing in the
case of double-width text (ESC # 3, ESC # 4, ESC # 6), because the
string passed to it was not truncated to the same width as the
clipping rectangle. (In fact, it _can't_ reliably be, in the case
where the window width is odd.) So instead we just assert that we
managed to _at least_ fill the clipping rectangle, not that we
exactly filled it.

The problem is easily reproduced by sending ESC # 8 (fill the screen
with Es) followed by ESC # 3. It doesn't typically happen, though,
if you _manually_ fill the screen with Es, because in that case
PuTTY's terminal buffer ends up being filled with CSET_ACP | 'E' or
similar, which means that general_textout() never gets called
because one of the other branches of do_text_internal() does the
work instead. ESC # 8 will fill the terminal buffer with genuine
_Unicode_ 'E' characters, which exercises the failing code path.

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

15 years agoAnother patch from Colin, providing a "make distclean" target in the
simon [Thu, 8 Jan 2009 18:21:33 +0000 (18:21 +0000)]
Another patch from Colin, providing a "make distclean" target in the
autoconf makefile.

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

15 years agoColin also suggests that we can replace the backticks in the GTK
simon [Thu, 8 Jan 2009 18:19:52 +0000 (18:19 +0000)]
Colin also suggests that we can replace the backticks in the GTK
makefile with make's own $(shell ...) function, which means that
gtk-config and krb5-config and so on only get run once per make
invocation instead of once per gcc invocation.

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

15 years agoColin Watson reports a strange problem whereby krb5-config
simon [Thu, 8 Jan 2009 18:18:14 +0000 (18:18 +0000)]
Colin Watson reports a strange problem whereby krb5-config
incorporates the environment variable CFLAGS into its output. Avoid
exporting our version of it from the Makefile (which actually causes
build failures, since quoting phase issues mean that the backticks
in our version end up unexpanded).

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

15 years agoRejig windlg.c:verify_ssh_host_key() to silence a warning.
jacob [Tue, 6 Jan 2009 00:25:07 +0000 (00:25 +0000)]
Rejig windlg.c:verify_ssh_host_key() to silence a warning.

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

15 years agoRemove a couple of unused variables.
jacob [Tue, 6 Jan 2009 00:16:35 +0000 (00:16 +0000)]
Remove a couple of unused variables.

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

15 years agoIt's a new year (and there have even been checkins).
jacob [Mon, 5 Jan 2009 23:49:19 +0000 (23:49 +0000)]
It's a new year (and there have even been checkins).

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

15 years agosk_address_is_local() failed to cope when presented with a Unix-domain socket.
jacob [Mon, 5 Jan 2009 23:36:14 +0000 (23:36 +0000)]
sk_address_is_local() failed to cope when presented with a Unix-domain socket.
This could cause Unix PuTTY to segfault when X forwarding over an SSH session
through a proxy.
(sk_getaddr() wouldn't cope either -- in that case, add an assertion to make it
more obvious; I don't think it should ever happen.)

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

15 years agoBe prepared for x11_setup_display() to return NULL (for instance, if DISPLAY
jacob [Mon, 5 Jan 2009 22:53:14 +0000 (22:53 +0000)]
Be prepared for x11_setup_display() to return NULL (for instance, if DISPLAY
has invalid contents). Simply refuse to try X forwarding in this circumstance.

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

15 years agor5080 didn't go far enough -- since 0.58, anyone on Unix who didn't previously
jacob [Mon, 5 Jan 2009 19:39:27 +0000 (19:39 +0000)]
r5080 didn't go far enough -- since 0.58, anyone on Unix who didn't previously
have default settings for "bell overload" mode will have inherited a twitchy
set of defaults where bells are disabled after 2ms and enabled after 5ms,
rather than 2s and 5s as intended. This error has probably propagated into some
people's saved sessions by now, but there's not much to be done.

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

15 years agoAdd some hard-coded textual literal-IP representations of localhost to
jacob [Mon, 5 Jan 2009 02:45:38 +0000 (02:45 +0000)]
Add some hard-coded textual literal-IP representations of localhost to
sk_hostname_is_local(), to catch the case where we're doing something like X11
forwarding over SSH through a proxy, and we've thus disabled local lookup of
hostnames.
(I think this is what's behind the report in
<e9a86996-5dc2-4428-9b0c-c65693ca6351@m32g2000hsf.googlegroups.com>
in comp.security.ssh, although I'd like to know more of the circumstances.)

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

15 years ago...and fix an unlikely memory leak.
jacob [Mon, 5 Jan 2009 01:15:06 +0000 (01:15 +0000)]
...and fix an unlikely memory leak.

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

15 years agoCope with a (non-standard) ENAMETOOLONG return from gethostname(); glibc will
jacob [Mon, 5 Jan 2009 01:01:58 +0000 (01:01 +0000)]
Cope with a (non-standard) ENAMETOOLONG return from gethostname(); glibc will
do this if the supplied buffer isn't big enough, which shouldn't lead to
complete abandonment of X11 auth. (Would only have bitten with hostnames
>255 chars anyway.)

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

15 years agor8305 made platform_x11_best_transport[] obsolete, but there still seem to be a
jacob [Sun, 4 Jan 2009 23:36:24 +0000 (23:36 +0000)]
r8305 made platform_x11_best_transport[] obsolete, but there still seem to be a
few instances around; expunge them.

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

15 years agor8305 seems to have made Unix PuTTY rather over-keen on Unix-domain sockets;
jacob [Sun, 4 Jan 2009 23:28:25 +0000 (23:28 +0000)]
r8305 seems to have made Unix PuTTY rather over-keen on Unix-domain sockets;
unless a protocol is explicitly specified with "tcp/foovax:0", it assume a
Unix-domain socket, thus not allowing a remote display on a machine other than
the client.

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