u/mdw/putty
15 years agoRevamp of the local X11 connection code. We now parse X display
simon [Mon, 17 Nov 2008 18:38:09 +0000 (18:38 +0000)]
Revamp of the local X11 connection code. We now parse X display
strings more rigorously, and then we look up the local X authority
data in .Xauthority _ourself_ rather than delegating to an external
xauth program. This is (negligibly) more efficient on Unix, assuming
I haven't got it wrong in some subtle way, but its major benefit is
that we can now support X authority lookups on Windows as well
provided the user points us at an appropriate X authority file in
the standard format. A new Windows-specific config option has been
added for this purpose.

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

15 years agoAvoid freeing the backend in notify_remote_exit(), since that's
simon [Mon, 17 Nov 2008 18:36:27 +0000 (18:36 +0000)]
Avoid freeing the backend in notify_remote_exit(), since that's
called from within a backend function which will expect its own
backend pointer to still be valid on return. Instead, move all the
real functionality of notify_remote_exit() out into a GTK idle
function.

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

15 years agoIn SSH packet logging mode, log SSH-2 packet sequence numbers, in
simon [Tue, 11 Nov 2008 07:47:27 +0000 (07:47 +0000)]
In SSH packet logging mode, log SSH-2 packet sequence numbers, in
both directions. We had a bug report yesterday about a Cisco router
sending SSH2_MSG_UNIMPLEMENTED and it wasn't clear for which packet;
logging the sequence numbers should make such problems much easier
to diagnose.

(In fact this logging fix wouldn't have helped in yesterday's case,
because the router also didn't bother to fill in the sequence number
field in the SSH2_MSG_UNIMPLEMENTED packet! This is a precautionary
measure against the next one of these problems.)

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

15 years agoImplement sk_addr_dup().
simon [Sat, 8 Nov 2008 16:58:55 +0000 (16:58 +0000)]
Implement sk_addr_dup().

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

15 years agoMove out of the SockAddr structure the mutable fields "ai" and
simon [Sat, 8 Nov 2008 16:45:45 +0000 (16:45 +0000)]
Move out of the SockAddr structure the mutable fields "ai" and
"curraddr", and turn "family" into a macro-derived property of the
other fields. The idea is that this renders SockAddrs immutable once
created, which should open up the possibility of duplicating and
reusing one without having to redo the actual DNS lookup.

I _hope_ I haven't broken anything. The new code architecture
contains several rather dubious-looking operations (namely the
arbitrary choice of the first returned address in functions like
sk_getaddr and sk_address_is_local - what if, for instance, a DNS
lookup returned a local and a non-local address?), but I think they
were functionally just as dubious beforehand and all this change has
done is to make them more obviously so to a reader.

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

15 years agoPatch from Iain Patterson: fix crash on Windows when GSSAPI auth is attempted
jacob [Fri, 17 Oct 2008 20:55:08 +0000 (20:55 +0000)]
Patch from Iain Patterson: fix crash on Windows when GSSAPI auth is attempted
but fails for some reason (such as not having a tgt for the server's realm).

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

15 years agoRejig the Translation panel controls and documentation to remove the emphasis
jacob [Mon, 13 Oct 2008 22:34:57 +0000 (22:34 +0000)]
Rejig the Translation panel controls and documentation to remove the emphasis
on received data. Experiment and suggestion suggest that the character set
configuration applies equally to keystrokes sent to the server, or at least
that that's close enough to being true that we should document it as a first
approximation.

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

15 years agoErroneously invisible index term.
jacob [Mon, 13 Oct 2008 22:16:25 +0000 (22:16 +0000)]
Erroneously invisible index term.

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

15 years agoFix inability to save session on Unix when ~/.putty doesn't exist introduced
jacob [Sun, 12 Oct 2008 11:32:23 +0000 (11:32 +0000)]
Fix inability to save session on Unix when ~/.putty doesn't exist introduced
in r7934.

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

15 years agoAhem. Make sure I NULL out any unused pointer field that I later
simon [Wed, 8 Oct 2008 18:09:56 +0000 (18:09 +0000)]
Ahem. Make sure I NULL out any unused pointer field that I later
plan to free if it isn't NULL.

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

15 years agosshrsa.c now obeys the RFC793 Robustness Principle when it comes to
simon [Tue, 7 Oct 2008 17:48:59 +0000 (17:48 +0000)]
sshrsa.c now obeys the RFC793 Robustness Principle when it comes to
the ordering of the primes in a fully specified RSA private key:
when the key format typically has p > q, it will always output p > q
but be willing to tolerate p < q on input. (Inspired by seeing an
OpenSSH-format key file in the wild which had p < q, which I've
never seen before; I suspect a third-party application incautiously
generating the format.)

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

15 years agoThe "server refused our key" bit didn't link to the public-key auth chapter,
jacob [Thu, 25 Sep 2008 19:00:42 +0000 (19:00 +0000)]
The "server refused our key" bit didn't link to the public-key auth chapter,
which has some hints on server-side setup. Now it does.

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

15 years agoDocument that PSFTP's "open" command allows an optional port number.
jacob [Sun, 21 Sep 2008 20:39:21 +0000 (20:39 +0000)]
Document that PSFTP's "open" command allows an optional port number.

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

15 years agoFurther correction: on reflection, after examining all the call
simon [Tue, 16 Sep 2008 22:56:08 +0000 (22:56 +0000)]
Further correction: on reflection, after examining all the call
sites for uint64_make(), we _shouldn't_ attempt to preserve high
bits in the low-order argument; it turns out not to be what the call
sites want.

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

15 years ago64-bit cleanliness in int64.c. This is all hideous; really I ought
simon [Tue, 16 Sep 2008 18:21:33 +0000 (18:21 +0000)]
64-bit cleanliness in int64.c. This is all hideous; really I ought
to be trying harder to find a 32-bit type rather than making a
uint64 structure out of two potentially 64-bit unsigned longs. And
really I ought to be using the C99 64-bit integers anyway if they're
available. But this should do for the moment.

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

15 years agoTim Kosse points out that xfer_upload_gotpkt can return a negative
simon [Tue, 16 Sep 2008 12:48:38 +0000 (12:48 +0000)]
Tim Kosse points out that xfer_upload_gotpkt can return a negative
value on error, so the check at the call site shouldn't test for
exactly zero.

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

15 years agoSome Windows keymaps, it turns out, don't translate the key
simon [Sun, 14 Sep 2008 15:11:42 +0000 (15:11 +0000)]
Some Windows keymaps, it turns out, don't translate the key
combination Ctrl + \ as the Ctrl-\ character. All of mine have, but
at least one laptop turns out not to. Do so explicitly.

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

15 years agoIf we got a keyboard-interactive INFO_REQUEST with an "instruction" string but
jacob [Tue, 9 Sep 2008 20:36:40 +0000 (20:36 +0000)]
If we got a keyboard-interactive INFO_REQUEST with an "instruction" string but
no actual prompts, we weren't displaying the former, which was wrong. We
should now (although I haven't found a server to test it against).

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

15 years agoFix punctuation in the large print statements. In particular, one
simon [Mon, 1 Sep 2008 17:56:20 +0000 (17:56 +0000)]
Fix punctuation in the large print statements. In particular, one
semicolon which crept in in r8138 was causing a lot of the "make
install" implementation to be missing from Makefile.gtk.

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

15 years agoGood grief. When I originally wrote the local proxy code two years
simon [Sun, 31 Aug 2008 21:45:39 +0000 (21:45 +0000)]
Good grief. When I originally wrote the local proxy code two years
ago, I apparently caused all data received from local proxies to be
unconditionally tagged as TCP Urgent. Most network backends ignore
this, but it's critical to the Telnet backend, which will ignore all
Urgent-marked data in the assumption that there's a SYNCH on its way
that it should wait for. Nobody has noticed in two years, presumably
meaning that nobody has ever tried to do Telnet over a local proxy
in that time.

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

15 years agoColin Watson points out an apparently erroneous cast: Ssh_gss_name
simon [Sun, 31 Aug 2008 19:18:17 +0000 (19:18 +0000)]
Colin Watson points out an apparently erroneous cast: Ssh_gss_name
and gss_name_t are supposed to be congruent types, so a pointer to
one should never be cast to a non-indirect instance of the other.

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

15 years agoMinor code cleanup: I just happened to be looking at this file for
simon [Sun, 31 Aug 2008 17:12:37 +0000 (17:12 +0000)]
Minor code cleanup: I just happened to be looking at this file for
other reasons and I noticed that the list of TELOPTs is given twice
and hence needs to be kept in sync. Replace with my now-standard
second-order-macro approach which allows the list to be maintained
in only one place.

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

15 years agoFix for portfwd-addr-family: on Unix, when a tunnel is specified as "Auto"
jacob [Wed, 20 Aug 2008 22:21:04 +0000 (22:21 +0000)]
Fix for portfwd-addr-family: on Unix, when a tunnel is specified as "Auto"
(rather than IPv4 or IPv6-only; this is the default), try to open up listening
sockets on both address families, rather than (unhelpfully) just IPv6. (And
don't open one if the other can't be bound, in a nod to CVE-2008-1483.)
Based on a patch from Ben A L Jemmett.

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

15 years agoJames has made the URL syntax for http://svn.tartarus.org/ more
simon [Mon, 11 Aug 2008 18:03:34 +0000 (18:03 +0000)]
James has made the URL syntax for svn.tartarus.org/ more
sensible. Update the FAQ link to it.

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

15 years agoLink to pTerm, an SSH client for the iPhone that's apparently based on PuTTY.
jacob [Sun, 10 Aug 2008 14:28:51 +0000 (14:28 +0000)]
Link to pTerm, an SSH client for the iPhone that's apparently based on PuTTY.
Attempts at damage limitation from the name similarity with pterm.

Also try to refresh the ports section of the FAQ a bit.

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

15 years agoInitial commit of GSSAPI Kerberos support.
owen [Sun, 10 Aug 2008 13:10:31 +0000 (13:10 +0000)]
Initial commit of GSSAPI Kerberos support.

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

15 years agowww.winputty.com
jacob [Sat, 19 Jul 2008 16:41:52 +0000 (16:41 +0000)]
www.winputty.com

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

15 years agoAnother, subtly different version string for ssh2-bug-maxpkt, from Tim Kosse.
jacob [Fri, 18 Jul 2008 21:39:49 +0000 (21:39 +0000)]
Another, subtly different version string for ssh2-bug-maxpkt, from Tim Kosse.

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

15 years agoAt least one version of gcc won't figure out that "clear" is never
simon [Thu, 17 Jul 2008 17:01:27 +0000 (17:01 +0000)]
At least one version of gcc won't figure out that "clear" is never
read uninitialised (because the only circumstance under which it
isn't initialised is when "update" is FALSE, in which case it isn't
read either). Placate it.

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

15 years agoReplicate r8110 from PSFTP to PSCP, and various other minor patchery from
jacob [Fri, 11 Jul 2008 19:24:56 +0000 (19:24 +0000)]
Replicate r8110 from PSFTP to PSCP, and various other minor patchery from
Roger Picton.

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

15 years agoPatch from Tim Kosse: check back->exitcode() in both loops on
simon [Sun, 6 Jul 2008 12:24:56 +0000 (12:24 +0000)]
Patch from Tim Kosse: check back->exitcode() in both loops on
ssh_sftp_loop_iteration(), not just one. Fixes exiting on a negative
response to the host key confirmation prompt on Windows (because
winsftp.c doesn't have the equivalent of uxsftp.c's no_fds_ok); on
Unix it worked already but gave a suboptimal error message, which is
fixed too by this patch.

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

15 years agoPatch from Tim Kosse to make PSFTP remember to close files on
simon [Sun, 6 Jul 2008 12:11:34 +0000 (12:11 +0000)]
Patch from Tim Kosse to make PSFTP remember to close files on
various error conditions.

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

15 years agoPatch from Aidan Kehoe to extend the Arabic shaping code to Urdu and
simon [Sun, 29 Jun 2008 09:14:26 +0000 (09:14 +0000)]
Patch from Aidan Kehoe to extend the Arabic shaping code to Urdu and
Persian, by adding some additional Unicode code points to the
shapetypes[] array.

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

15 years agoCosmetic: use `appname' in more places, so that Unix PuTTYtel announces itself
jacob [Sun, 15 Jun 2008 13:26:08 +0000 (13:26 +0000)]
Cosmetic: use `appname' in more places, so that Unix PuTTYtel announces itself
thus.

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

15 years agoExorcise beeps from the Colours pane in Gtk.
jacob [Sun, 15 Jun 2008 12:39:09 +0000 (12:39 +0000)]
Exorcise beeps from the Colours pane in Gtk.

The colour list box beeped at the user whenever it found that
something other than exactly one colour was selected. This seems to
happen implicitly in Gtk when the pane is changed. In Gtk1, this gave
you a beep whenever you left the Colours dialog after having selected
a colour from the list; in Gtk2, you additionally got a beep _every_
time you subsequently re-entered the Colours dialog (for reasons I
haven't investigated). Windows was unaffected.

Also, in Gtk (unlike Windows), it's possible for the user to go back
to the state where no items in the list box are selected at all.

For these reasons, stop beeping at the user, and instead blank the RGB
edit boxes as a hint that edits to them would be futile. (Really we
should be disabling them entirely, but the cross-platform edit
controls aren't up to that yet.)

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

15 years agoWork around a bug in early versions of GTK (which I'm still forced
simon [Wed, 11 Jun 2008 18:03:35 +0000 (18:03 +0000)]
Work around a bug in early versions of GTK (which I'm still forced
to use, gah) in which the "model" argument to
gtk_tree_selection_get_selected_rows() couldn't be NULL.

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

15 years agoManfred Schwarb points out that scroll wheel support stopped working
simon [Tue, 10 Jun 2008 20:18:23 +0000 (20:18 +0000)]
Manfred Schwarb points out that scroll wheel support stopped working
with the switch to GTK2. This turns out to be because, where GTK1
represented the scroll wheel as mouse buttons 4 and 5 and generated
GdkEventButton when it was moved, GTK2 has moved wheel actions out
into a new event type GdkEventScroll which we were not handling. Now
we do, so scroll wheel support should be back in place.

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

15 years agoManfred Schwarb also mentions that Alt+drag is captured by at least
simon [Sat, 7 Jun 2008 16:30:45 +0000 (16:30 +0000)]
Manfred Schwarb also mentions that Alt+drag is captured by at least
one well known window manager (KDE's); document that Shift+Alt+drag
is worth trying as a workaround.

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

15 years agoManfred Schwarb points out that the README contains an outdated
simon [Sat, 7 Jun 2008 16:25:46 +0000 (16:25 +0000)]
Manfred Schwarb points out that the README contains an outdated
comment about GTK 2 not being supported.

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

15 years agoAdd an include statement to Makefile.gtk that imports if present a
simon [Thu, 5 Jun 2008 17:06:39 +0000 (17:06 +0000)]
Add an include statement to Makefile.gtk that imports if present a
file called Makefile.local. This means that if you're compiling on a
platform that needs COMPAT definitions, you can put them in a local
file and not have to type them on the command line every time.

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

15 years agoBah, there's always something. Check in missing files.
simon [Wed, 4 Jun 2008 23:12:30 +0000 (23:12 +0000)]
Bah, there's always something. Check in missing files.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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