u/mdw/putty
19 years agoFWHACK has been dead for years. Remove it from the Makefiles.
ben [Sat, 15 Jan 2005 18:30:05 +0000 (18:30 +0000)]
FWHACK has been dead for years.  Remove it from the Makefiles.

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

19 years agoFix prototypes for mactcp_new and ot_new.
owen [Sat, 15 Jan 2005 17:28:44 +0000 (17:28 +0000)]
Fix prototypes for mactcp_new and ot_new.

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

19 years agoThrow away "./" in findfile so that the Mac makefile has valid paths.
owen [Sat, 15 Jan 2005 17:16:48 +0000 (17:16 +0000)]
Throw away "./" in findfile so that the Mac makefile has valid paths.

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

19 years agoINADDR_NONE is nonstandard. Use (in_addr_t)(-1) instead.
ben [Fri, 14 Jan 2005 19:28:18 +0000 (19:28 +0000)]
INADDR_NONE is nonstandard.  Use (in_addr_t)(-1) instead.

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

19 years agoDon't use GNUish pattern rules in the Unix Makefile, since they're not
ben [Fri, 14 Jan 2005 12:26:38 +0000 (12:26 +0000)]
Don't use GNUish pattern rules in the Unix Makefile, since they're not
supported by non-GNU makes.  This allows the standard Solaris /usr/ccs/bin/make
to handle that Makefile.

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

19 years agoMention Cygwin/X as a potential X server, since it's free.
ben [Thu, 13 Jan 2005 21:50:41 +0000 (21:50 +0000)]
Mention Cygwin/X as a potential X server, since it's free.

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

19 years agoFix `disconnect': arrange that we keep track of when we're expecting
simon [Tue, 11 Jan 2005 19:33:41 +0000 (19:33 +0000)]
Fix `disconnect': arrange that we keep track of when we're expecting
to see the server slam the TCP connection shut (i.e. almost never,
unless it's just sent us an SSH_MSG_DISCONNECT), and treat an
unexpected closure as a non-clean session termination. Previously
any server-initiated connection closure was being treated as a clean
exit, which was a hangover from the good old Telnet-only days.

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

19 years agoVersions of OpenSSH before 2.5.4 kill the connection if the client attempts
ben [Tue, 11 Jan 2005 16:33:08 +0000 (16:33 +0000)]
Versions of OpenSSH before 2.5.4 kill the connection if the client attempts
to rekey.  Extend the description of SSH2_BUG_REKEY to cover this situation
and apply it to the relevant OpenSSH versions.

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

19 years agoBah, I left a rogue event log entry lying around.
simon [Tue, 11 Jan 2005 15:33:35 +0000 (15:33 +0000)]
Bah, I left a rogue event log entry lying around.

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

19 years agoSun_SSH_1.0.1 also has BUG_SSH2_REKEY.
ben [Tue, 11 Jan 2005 13:24:47 +0000 (13:24 +0000)]
Sun_SSH_1.0.1 also has BUG_SSH2_REKEY.

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

19 years agoThe Unix `make install' target now allows you to define UTMP_GROUP,
simon [Tue, 11 Jan 2005 10:45:43 +0000 (10:45 +0000)]
The Unix `make install' target now allows you to define UTMP_GROUP,
in which case pterm will be installed setgid that, or to define
UTMP_USER in which case it will be installed setuid that. If you
define neither, it will be installed without any set-id bits as
before.

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

19 years agoServers announcing themselves as `Sun_SSH_1.0' apparently cannot
simon [Tue, 11 Jan 2005 10:37:55 +0000 (10:37 +0000)]
Servers announcing themselves as `Sun_SSH_1.0' apparently cannot
deal with rekeys at all: they totally ignore mid-session KEXINIT
sent by the client. Hence, a new bug entry so we don't try it.

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

19 years agosk_namelookup() on Unix was failing to translate from our platform-
simon [Sun, 9 Jan 2005 14:55:55 +0000 (14:55 +0000)]
sk_namelookup() on Unix was failing to translate from our platform-
independent ADDRTYPE_* constants to real AF_* ones, causing explicit
protocol specification to fail.

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

19 years agoRemove unwanted underscore.
owen [Sun, 9 Jan 2005 14:45:00 +0000 (14:45 +0000)]
Remove unwanted underscore.

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

19 years agoNew function ltime() returns a struct tm of the current local time.
owen [Sun, 9 Jan 2005 14:27:48 +0000 (14:27 +0000)]
New function ltime() returns a struct tm of the current local time.
Fixes crashes when time() returns (time_t)-1 on Windows by using the
Win32 GetLocalTime() function.  (The Unix implementation still just
uses time() and localtime().)

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

19 years agoHaving laboriously constructed a hints parameter for getaddrinfo, it
simon [Sun, 9 Jan 2005 11:58:36 +0000 (11:58 +0000)]
Having laboriously constructed a hints parameter for getaddrinfo, it
would help to _use_ it!

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

19 years agoI've changed my mind about what the IP version selection options in
simon [Sun, 9 Jan 2005 11:44:21 +0000 (11:44 +0000)]
I've changed my mind about what the IP version selection options in
the config should do when IPv6 is configured out. They shouldn't sit
there looking silly with only `Auto' and `IPv4' settings: they
should instead be completely absent. I had thought the former was
acceptable since IPv4-only was a configuration that people should
only be using if their compilers didn't support IPv6, but now it
occurs to me that ports to fundamentally non-IPv6-supporting
platforms are not implausible, and on such ports the presence of a
vestigial config option under the _standard_ build conditions would
be a low-quality solution.

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

19 years agoFor local and dynamic port forwardings (i.e. the ones which listen
simon [Sat, 8 Jan 2005 14:45:26 +0000 (14:45 +0000)]
For local and dynamic port forwardings (i.e. the ones which listen
on a local port), the `Auto' protocol option on the Tunnels panel
should always produce a port you can connect to in _either_ of IPv4
and v6, because the aim is for the user not to have to know or care
which one they're using. This was not the case on Windows, and now
is. Also, updated the docs to give more detail on issues like this.

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

19 years agoCleanups to sk_namelookup(). In particular, it now doesn't segfault
simon [Sat, 8 Jan 2005 14:02:06 +0000 (14:02 +0000)]
Cleanups to sk_namelookup(). In particular, it now doesn't segfault
if you explicitly specify IPv6 and then try to look up a hostname
which doesn't have an IPv6 address.

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

19 years agoClear the kex-specific context in ssh->pkt_ctx for every new key
simon [Sat, 8 Jan 2005 13:28:41 +0000 (13:28 +0000)]
Clear the kex-specific context in ssh->pkt_ctx for every new key
exchange. Without doing this, after we have done one specific-group
DH exchange (group1 or group14), ssh2_pkt_type _always_ translates
30 and 31 as KEXDH_INIT and KEXDH_REPLY, making a subsequent
group-exchange kex look rather strange in an SSH packet log.

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

19 years agoJacob points out that changing TICKSPERSEC in unix.h changed the
simon [Sat, 8 Jan 2005 13:08:32 +0000 (13:08 +0000)]
Jacob points out that changing TICKSPERSEC in unix.h changed the
meaning of BellOverload{T,S} in Unix saved sessions. Add a Unix-
specific backwards compatibility wart to settings.c to compensate.
Of course when I do the serious config format revamp, I will ensure
that no config item depends on internal #defines (these time
intervals will be specified as a floating-point number of seconds)
and this horror will be relegated to the old-config-compatibility
code.

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

19 years agoSimon points out that r5068 broke keyboard-interactive with multiple
jacob [Fri, 7 Jan 2005 16:55:45 +0000 (16:55 +0000)]
Simon points out that r5068 broke keyboard-interactive with multiple
INFO_REQUESTs, and for some reason Debian OpenSSH is sending INFO_REQUESTs
containing no prompts after a normal password authentication, so this
should fix Shai's problem.

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

19 years agoUpdate faq-bce further for changes in 0.54.
jacob [Fri, 7 Jan 2005 15:25:32 +0000 (15:25 +0000)]
Update faq-bce further for changes in 0.54.

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

19 years agoProxy command formatting now recognises `%proxyhost' and
simon [Fri, 7 Jan 2005 14:22:17 +0000 (14:22 +0000)]
Proxy command formatting now recognises `%proxyhost' and
`%proxyport' in addition to the other things it interpolates. This
is useful when using the Unix-only `Local' proxy type: it allows me
to, for example, set up a proxy command such as
  ssh %proxyhost nc -q0 %host %port
and then enter the name of the proxy machine in `Proxy hostname',
which makes it marginally more convenient to quickly change to using
a different proxy to get at the same target.

I haven't documented this, because we currently don't document the
Local proxy type at all. Possibly we should, though.

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

19 years agoUse sk_set_frozen() to ensure that no data will be accepted from an
simon [Fri, 7 Jan 2005 09:24:24 +0000 (09:24 +0000)]
Use sk_set_frozen() to ensure that no data will be accepted from an
SSH connection when we're in the middle of asking the user a
dialog-box-type question. Fixes `unix-kex-packet', which has just
bitten me when connecting to one of the work Suns.

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

19 years agoAdd an explicit message about lack of support for PASSWD_CHANGEREQ in a
jacob [Thu, 6 Jan 2005 17:05:54 +0000 (17:05 +0000)]
Add an explicit message about lack of support for PASSWD_CHANGEREQ in a
half-hearted attempt to flush out any uses of it.

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

19 years agoI can't believe that after all this time we still had a rogue set of
simon [Thu, 6 Jan 2005 15:47:12 +0000 (15:47 +0000)]
I can't believe that after all this time we still had a rogue set of
`' quotes! Changed to \q{}.

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

19 years ago`kbdint-failure': we now offer keyboard-interactive auth to the user for as
jacob [Thu, 6 Jan 2005 13:23:47 +0000 (13:23 +0000)]
`kbdint-failure': we now offer keyboard-interactive auth to the user for as
long as the server offers it, rather than only once, unless the server responds
to our initial USERAUTH_REQUEST("keyboard-interactive") with FAILURE, in which
case we give up on it entirely.

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

19 years agoTry to make it clearer that "-be" and "-bc" must be specified in _addition_
jacob [Thu, 6 Jan 2005 12:37:33 +0000 (12:37 +0000)]
Try to make it clearer that "-be" and "-bc" must be specified in _addition_
to "-b batchfile".

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

19 years agoDon't forget to initialise ret->ai to NULL in sk_nonamelookup. Was
simon [Tue, 4 Jan 2005 17:39:35 +0000 (17:39 +0000)]
Don't forget to initialise ret->ai to NULL in sk_nonamelookup. Was
causing segfaults in IPv6-enabled Unix PuTTY connecting through a
proxy when letting the proxy do the DNS.

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

19 years agoIf we're going to use select(), we need <sys/select.h>.
ben [Tue, 4 Jan 2005 14:37:32 +0000 (14:37 +0000)]
If we're going to use select(), we need <sys/select.h>.

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

19 years agocolon in kex UI
jacob [Sun, 2 Jan 2005 13:17:22 +0000 (13:17 +0000)]
colon in kex UI

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

19 years agoIt's a new year!
simon [Sun, 2 Jan 2005 09:19:14 +0000 (09:19 +0000)]
It's a new year!

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

19 years agoLocalise "not connected to a host" messages.
jacob [Sat, 1 Jan 2005 16:43:19 +0000 (16:43 +0000)]
Localise "not connected to a host" messages.

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

19 years agoNow that rm, mkdir, and rmdir can operate on lots of files, make them more
jacob [Sat, 1 Jan 2005 16:35:57 +0000 (16:35 +0000)]
Now that rm, mkdir, and rmdir can operate on lots of files, make them more
chatty like the other multiple-file commands.

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

19 years agoDocument recent changes to PSFTP (and other documentation tweaks).
jacob [Sat, 1 Jan 2005 16:16:13 +0000 (16:16 +0000)]
Document recent changes to PSFTP (and other documentation tweaks).

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

19 years agoRemove rogue sfree()s inside new wildcard action functions -- were causing
jacob [Sat, 1 Jan 2005 14:06:12 +0000 (14:06 +0000)]
Remove rogue sfree()s inside new wildcard action functions -- were causing
segfaults in failure cases.

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

19 years agoThere's always one: fix small memory leak introduced in last revision.
simon [Sat, 1 Jan 2005 13:01:13 +0000 (13:01 +0000)]
There's always one: fix small memory leak introduced in last revision.

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

19 years ago"Nirwana Nirwana" points out that mget, mput and ls are not the only
simon [Sat, 1 Jan 2005 12:34:32 +0000 (12:34 +0000)]
"Nirwana Nirwana" points out that mget, mput and ls are not the only
PSFTP commands that can make good use of wildcards! Now implemented
wildcard support in rmdir, rm, mv and chmod.

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

19 years agoA couple of people have pointed out that the local variable
simon [Fri, 31 Dec 2004 19:06:20 +0000 (19:06 +0000)]
A couple of people have pointed out that the local variable
`reading' in this file is not reliably initialised.

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

19 years agoRename some of the more stupidly named files in the Unix back end.
simon [Fri, 31 Dec 2004 13:02:46 +0000 (13:02 +0000)]
Rename some of the more stupidly named files in the Unix back end.
Notably pterm.c, which was a sensible name right at the start but
became a misnomer as soon as I created Unix PuTTY.

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

19 years agoIn r5043 Jacob removed the `Load' and `Delete' buttons in the saved-
simon [Fri, 31 Dec 2004 11:46:28 +0000 (11:46 +0000)]
In r5043 Jacob removed the `Load' and `Delete' buttons in the saved-
sessions panel in the reconfig box. I think, given that, the title
of that box also wants work :-)

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

19 years agoAllow reconfiguration of compression and cipher settings in
simon [Fri, 31 Dec 2004 10:51:14 +0000 (10:51 +0000)]
Allow reconfiguration of compression and cipher settings in
mid-session in SSH2: this forces an immediate rekey to activate the
new settings. I'm not sure exactly what this will be useful for
(except possibly it might make comparative performance testing
easier?), but it has wonderful James Bond value for being able to
switch to a more secure cipher before doing anything sensitive :-)
If, that is, you weren't using the most secure one to begin with...

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

19 years agoReinstate the textual service name in port forwarding Event Log
simon [Thu, 30 Dec 2004 17:53:26 +0000 (17:53 +0000)]
Reinstate the textual service name in port forwarding Event Log
messages where specified. (I had removed this in the previous
revision through forgetfulness.)

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

19 years agoJacob points out that when we reconfigure port forwarding, we ought
simon [Thu, 30 Dec 2004 17:48:35 +0000 (17:48 +0000)]
Jacob points out that when we reconfigure port forwarding, we ought
to be destroying old ones _before_ creating new ones, so that we can
reuse a port for a new purpose without colliding with ourselves.

Also fixed port forwarding, which my IPv6 checkin had completely
funted :-)

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

19 years agoIf we're going to define _XOPEN_SOURCE, we should at least define it to a
ben [Thu, 30 Dec 2004 17:29:54 +0000 (17:29 +0000)]
If we're going to define _XOPEN_SOURCE, we should at least define it to a
version that includes putenv().  Make it 600 (the current one) for good
measure.

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

19 years agoIntegrate unfix.org's IPv6 patches up to level 10, with rather a lot
simon [Thu, 30 Dec 2004 16:45:11 +0000 (16:45 +0000)]
Integrate unfix.org's IPv6 patches up to level 10, with rather a lot
of polishing to bring them to what I think should in principle be
release quality. Unlike the unfix.org patches themselves, this
checkin enables IPv6 by default; if you want to leave it out, you
have to build with COMPAT=-DNO_IPV6.

I have tested that this compiles on Visual C 7 (so the nightlies
_should_ acquire IPv6 support without missing a beat), but since I
don't have IPv6 set up myself I haven't actually tested that it
_works_. It still seems to make correct IPv4 connections, but that's
all I've been able to verify for myself. Further testing is needed.

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

19 years agoStray // comments.
simon [Thu, 30 Dec 2004 15:29:38 +0000 (15:29 +0000)]
Stray // comments.

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

19 years agoI've decided that trying to do wildcards in PSFTP as a special case
simon [Thu, 30 Dec 2004 13:51:37 +0000 (13:51 +0000)]
I've decided that trying to do wildcards in PSFTP as a special case
of directory recursion was a strategic error: it obfuscates
sftp_{get,put}_file(), and also it makes it very hard to handle
subdirectory wildcards such as `foo/*'. Accordingly, here's a
completely different approach, in which sftp_{get,put}_file() are
still responsible for directory recursion, but wildcards are
expanded in sftp_general_{get,put}() before being passed thereto.
Subdirectory wildcards are now handled consistently across Unix,
Windows and the remote server.

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

19 years agoRemove "Load" button in mid-session configuration dialog, as it allows the user
jacob [Thu, 30 Dec 2004 10:58:28 +0000 (10:58 +0000)]
Remove "Load" button in mid-session configuration dialog, as it allows the user
to manipulate settings they can't see so could lead to confusion. (Also remove
"Delete" button for some sort of UI consistency even though it's harmless.)
Also conditionalise other aspects of sessionsaver_handler() that don't make
sense mid-session.

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

19 years agoAdd some discussion of rekeys-as-keepalives, and their potential
simon [Wed, 29 Dec 2004 13:44:20 +0000 (13:44 +0000)]
Add some discussion of rekeys-as-keepalives, and their potential
adverse effect on the life expectancy of a low-use connection over a
low-reliability network.

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

19 years agoLoose end from r5031: the Kex panel should only be displayed in
simon [Wed, 29 Dec 2004 12:32:25 +0000 (12:32 +0000)]
Loose end from r5031: the Kex panel should only be displayed in
mid-session if we are not using SSHv1. I've done this by introducing
a generic `cfg_info' function which every back end can use to
communicate an int's worth of data to setup_config_box; in SSH
that's the protocol version in use, and in everything else it's
currently zero.

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

19 years agoThe latest unfix.org IPv6 patch contains these apparently
simon [Tue, 28 Dec 2004 17:12:20 +0000 (17:12 +0000)]
The latest unfix.org IPv6 patch contains these apparently
IPv6-unrelated changes, which convert ints into unsigned in a few
key places in ssh.c. Looks harmless at worst, possibly terribly
useful, so I think we'll have these no matter what the real IPv6
stuff is up to!

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

19 years agoAbility to save in mid-session! Simplest possible resolution to all
simon [Tue, 28 Dec 2004 16:46:30 +0000 (16:46 +0000)]
Ability to save in mid-session! Simplest possible resolution to all
the difficult questions about when it's sensible to offer the option
of saving to the slot we loaded from: _we never do_. The user must
always explicitly specify a slot to save to.

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

19 years agoForgot to initialise ssh->portfwds to NULL. Unusually, this was
simon [Tue, 28 Dec 2004 16:18:17 +0000 (16:18 +0000)]
Forgot to initialise ssh->portfwds to NULL. Unusually, this was
pointed out by the MSVC debugger, not by valgrind :-)

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

19 years agoCan't use `d' for an accelerator in the Kex panel, since it clashes
simon [Tue, 28 Dec 2004 14:11:00 +0000 (14:11 +0000)]
Can't use `d' for an accelerator in the Kex panel, since it clashes
with the `d' used for the Down button in the Windows preference list.

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

19 years agoSupport reconfiguration of key exchange in mid-session. The fiddly
simon [Tue, 28 Dec 2004 14:10:32 +0000 (14:10 +0000)]
Support reconfiguration of key exchange in mid-session. The fiddly
bit is working out when to reschedule the next rekey for when the
timeout or data limit changes; sometimes it will be _right now_
because we're already over the new limit.

Still to do: the Kex panel should not appear in mid-session if we
are using SSHv1.

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

19 years agoSSH port forwarding is now configurable in mid-session. After doing
simon [Tue, 28 Dec 2004 14:07:05 +0000 (14:07 +0000)]
SSH port forwarding is now configurable in mid-session. After doing
Change Settings, the port forwarding setup function is run again,
and tags all existing port forwardings as `do not keep'. Then it
iterates through the config in the normal way; when it encounters a
port forwarding which is already in the tree, it tags it `keep'
rather than setting it up from scratch. Finally, it goes through the
tree and removes any that haven't been labelled `keep'. Hence,
editing the list of forwardings in Change Settings has the effect of
cancelling any forwardings you remove, and adding any new ones.

The SSH panel now appears in the reconfig box, and is empty apart
from a message explaining that it has to be there for subpanels of
it to exist. Better wording for this message would be welcome.

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

19 years agoAbstracted out the rather large port-forwarding setup code into a
simon [Tue, 28 Dec 2004 14:04:58 +0000 (14:04 +0000)]
Abstracted out the rather large port-forwarding setup code into a
routine which is common between SSH1 and SSH2. Since this routine is
not part of the coroutine system, this means it can't sit and wait
to get its various success/failure responses back. Hence, I've
introduced a system of queued packet handlers, each of which waits
for exactly one of a pair of messages (SSH1_SMSG_{SUCCESS,FAILURE}
or SSH2_MSG_REQUEST_{SUCCESS,FAILURE}), handles it when it arrives,
and automatically de-registers itself. Hence the port-forwarding
setup code can be called once, and then subsequent packets related
to it will automatically be handled as they arrive.

The real purpose of all this is that the infrastructure is now there
for me to arrange mid-session configurability of port forwarding.
However, a side benefit is that fewer round trips are involved in
session startup. I'd quite like to move more of the connection setup
(X forwarding, agent forwarding, pty allocation etc) to using the
new queued handler mechanism for this reason.

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

19 years agoFix divide overflow in internal_mod(). Thanks to William Petiot for
simon [Tue, 28 Dec 2004 14:04:26 +0000 (14:04 +0000)]
Fix divide overflow in internal_mod(). Thanks to William Petiot for
spotting a special case that the DIV instruction can't quite cover.

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

19 years agoBasic configurability for client-initiated rekeys.
jacob [Fri, 24 Dec 2004 13:39:32 +0000 (13:39 +0000)]
Basic configurability for client-initiated rekeys.

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

19 years agoDon't offer repeat key exchange as a special command in SSH-1.
jacob [Fri, 24 Dec 2004 10:04:28 +0000 (10:04 +0000)]
Don't offer repeat key exchange as a special command in SSH-1.

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

19 years agoMinimally document "repeat key exchange" special command.
jacob [Thu, 23 Dec 2004 05:54:09 +0000 (05:54 +0000)]
Minimally document "repeat key exchange" special command.

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

19 years agoAdd a preference list for SSH-2 key exchange algorithms, on a new "Kex" panel
jacob [Thu, 23 Dec 2004 02:24:07 +0000 (02:24 +0000)]
Add a preference list for SSH-2 key exchange algorithms, on a new "Kex" panel
(which will gain more content anon).

Retire BUG_SSH2_DH_GEX and add a backwards-compatibility wart, since we never
did find a way of automatically detecting this alleged server bug, and in any
case there was only ever one report (<3D91F3B5.7030309@inwind.it>, FWIW).

Also generalise askcipher() to a new askalg() (thus touching all the
front-ends).

I've made some attempt to document what SSH key exchange is and why you care,
but it could use some review for clarity (and outright lies).

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

19 years agoFix potential access of freed data (only if we couldn't create the
jacob [Wed, 22 Dec 2004 23:17:02 +0000 (23:17 +0000)]
Fix potential access of freed data (only if we couldn't create the
second of two registry keys, so pretty unlikely).

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

19 years agoSupport diffie-hellman-group14-sha1 group exchange. Tested against
simon [Wed, 22 Dec 2004 10:53:58 +0000 (10:53 +0000)]
Support diffie-hellman-group14-sha1 group exchange. Tested against
locally built OpenSSH 3.9, and seems to work fine.

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

19 years agoIn my revamp of cursor handling I had assumed that you were supposed
simon [Wed, 22 Dec 2004 10:21:50 +0000 (10:21 +0000)]
In my revamp of cursor handling I had assumed that you were supposed
to call _either_ do_text() _or_ do_cursor() on a given character
cell. In fact you're supposed to call do_text() no matter what, and
then call do_cursor() as well if it's got the cursor on it, since
do_cursor() _only_ draws the actual cursor, which often doesn't also
cause the text to get drawn.

I'm half tempted to change this in the interface, retire do_cursor()
as an external function and relegate it to an internal function in
each front end, and require that do_text() must fully process all
cursor attributes it is passed. However, I haven't done this yet.

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

19 years agoThe end condition in the binary search loop in the new getType() was
simon [Mon, 20 Dec 2004 09:27:44 +0000 (09:27 +0000)]
The end condition in the binary search loop in the new getType() was
incorrect. I must have written that binary search idiom a hundred
times, so it's rather embarrassing that I can't _automatically_ get
it right! This was causing all kinds of characters to be classified
as ON when they should have been various other classes.

Also while I'm here, I've added another test case to utf8.txt (a
small piece of Arabic within a predominantly L->R line), and also
supplied a means to compile minibidi.c with -DTEST_GETTYPE to
produce a command-line character class lookup tool. (Not sure what
use that'll be _other_ than debugging this precise problem, but I
don't like to throw it away now I've written it :-)

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

19 years agoRestore border around terminal to default background colour rather than
jacob [Sun, 19 Dec 2004 23:37:30 +0000 (23:37 +0000)]
Restore border around terminal to default background colour rather than
something outside colours[] (consistently brown on my system).

(I don't understand why this code was the way it was, but it gave the
correct result before r4917 `256-colours', and now doesn't.)

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

19 years agoCorrect number of configurable colours (NCFGCOLOURS) to match reality
jacob [Sun, 19 Dec 2004 23:15:17 +0000 (23:15 +0000)]
Correct number of configurable colours (NCFGCOLOURS) to match reality
(leftover from `256-colours', r4917).

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

19 years agoFix line cursor colours (fallout from `256-colours'), on both Windows and Unix.
jacob [Sun, 19 Dec 2004 22:37:05 +0000 (22:37 +0000)]
Fix line cursor colours (fallout from `256-colours'), on both Windows and Unix.

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

19 years agoMake sure the docs in a Unix release tarball are generated with the correct
jacob [Sat, 18 Dec 2004 11:34:41 +0000 (11:34 +0000)]
Make sure the docs in a Unix release tarball are generated with the correct
version info.

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

19 years agoMissed options off mput help
jacob [Sat, 18 Dec 2004 10:46:21 +0000 (10:46 +0000)]
Missed options off mput help

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

19 years agozip apparently gives a warning (`-l used on binary file') when you
simon [Sat, 18 Dec 2004 10:00:27 +0000 (10:00 +0000)]
zip apparently gives a warning (`-l used on binary file') when you
use -l on a UTF-8 text file. Move potentially UTF-8 things (the new
testdata files) into a new category of source files, and suppress
zip's warning for that category.

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

19 years agoJacob has pointed out why SIGCHLD was blocked, so I've updated the
simon [Fri, 17 Dec 2004 14:25:53 +0000 (14:25 +0000)]
Jacob has pointed out why SIGCHLD was blocked, so I've updated the
comment when I unblock it in pty.c to reflect reality. Also I've
moved block_signal() out of pterm.c into signal.c, so I can
conveniently use it for unblocking SIGCHLD rather than having to
reinvent it in pty.c.

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

19 years agoThe xfer mechanism wasn't gracefully terminating when an error was
simon [Fri, 17 Dec 2004 13:39:41 +0000 (13:39 +0000)]
The xfer mechanism wasn't gracefully terminating when an error was
encountered part way through transfer. In particular, this caused
psftp to hang (waiting for FXP_READ replies which had already
arrived) if you try `get' (without -r) on a remote directory.

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

19 years agoDocument recent SFTP changes:
jacob [Fri, 17 Dec 2004 13:00:01 +0000 (13:00 +0000)]
Document recent SFTP changes:
 - document behaviour of "-r" with mget/mput/reget/reput
 - document "close" command
 - document SFTP wildcard syntax for those who may not be familiar with Unix
   wildcards

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

19 years agoI _think_ I've just fixed `font-overflow'. term->disptext now tracks
simon [Fri, 17 Dec 2004 12:55:12 +0000 (12:55 +0000)]
I _think_ I've just fixed `font-overflow'. term->disptext now tracks
the start of every contiguous run passed to do_text() or
do_cursor(), and arranges never to overwrite only part of such a run
on the next update.

I'm a bit worried about this checkin because I've also completely
revamped cursor handling: the cursor was previously being drawn
_outside_ the main loop over the display line, and is now drawn as
part of that loop when it gets to the cursor location. It _seems_ to
still work sensibly, even in complex cases involving LATTR_WIDE and
double-width CJK characters etc, but I won't be entirely happy until
it's had some beta use.

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

19 years agoUpdate online help for "-r" and "--" options to get/put commands.
jacob [Fri, 17 Dec 2004 12:15:17 +0000 (12:15 +0000)]
Update online help for "-r" and "--" options to get/put commands.
Use command name in error messages rather than hardcoded "get:"/"put:".

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

19 years agoDivide the do_paint() loop into several subloops. The activity of
simon [Fri, 17 Dec 2004 11:37:16 +0000 (11:37 +0000)]
Divide the do_paint() loop into several subloops. The activity of
going through the line and working out which bits need to be redrawn
is now in a separate loop from the subsequent activity of actually
going through and doing the redraws. This _should_ enable me to
tinker with the which-bits-to-redraw data in between the two, thus
fixing `font-overflow'. However, I thought it would be sensible to
break the work up into two commits so we can track bugs in the
restructuring separately from bugs introduced by the new feature.

Also added a couple more terminal test files.

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

19 years agoI had apparently broken wrapping of double-width characters (again).
simon [Fri, 17 Dec 2004 11:24:25 +0000 (11:24 +0000)]
I had apparently broken wrapping of double-width characters (again).
Also fixed the new UTF-8 test file so that it tests double-width
wrapping both with _and_ without LATTR_WRAPPED2.

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

19 years agoI'd rather not keep losing these little test files, so here's some
simon [Fri, 17 Dec 2004 11:18:13 +0000 (11:18 +0000)]
I'd rather not keep losing these little test files, so here's some
stuff that I can `cat' into a terminal to test particular features
of it.

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

19 years agoApparently SIGCHLD is blocked by default in processes run in a
simon [Fri, 17 Dec 2004 09:43:09 +0000 (09:43 +0000)]
Apparently SIGCHLD is blocked by default in processes run in a
pterm, which was breaking my bash job notification patch. This is
apparently not the case for xterm, so I've fiddled with it. Not
entirely sure _why_ it did this in the first place, but there we go.

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

19 years agoGeneral mechanism for ensuring a dodgy SFTP server can't return
simon [Thu, 16 Dec 2004 19:36:47 +0000 (19:36 +0000)]
General mechanism for ensuring a dodgy SFTP server can't return
malicious filenames via FXP_READDIR.

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

19 years agoImplement the `close' command, which terminates an SFTP session but
simon [Thu, 16 Dec 2004 19:19:59 +0000 (19:19 +0000)]
Implement the `close' command, which terminates an SFTP session but
does not quit PSFTP, so you can then issue another `open' to connect
to somewhere else. This has apparently been trivial for some time,
for exactly the same reasons that `reuse-windows' was so easy, but
it hadn't occurred to me to actually do it until now.

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

19 years agoJacob points out that I introduced a bug in PSFTP when I did the
simon [Thu, 16 Dec 2004 19:15:38 +0000 (19:15 +0000)]
Jacob points out that I introduced a bug in PSFTP when I did the
timing shakeup: just running `psftp' caused the net/stdin select
loop (on both Unix and Windows) to get confused at the lack of any
network connection and give up immediately. Should now be fixed.

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

19 years agoWildcards in `ls'. I think that completes `psftp-multi'. Woo!
simon [Thu, 16 Dec 2004 17:45:29 +0000 (17:45 +0000)]
Wildcards in `ls'. I think that completes `psftp-multi'. Woo!

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

19 years agoImplement mget and mput in PSFTP, supporting wildcards.
simon [Thu, 16 Dec 2004 17:35:20 +0000 (17:35 +0000)]
Implement mget and mput in PSFTP, supporting wildcards.

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

19 years agoSupport for recursive file transfer in PSFTP.
simon [Thu, 16 Dec 2004 16:37:37 +0000 (16:37 +0000)]
Support for recursive file transfer in PSFTP.

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

19 years agoFix obviously stupid segfault. Ahem.
simon [Thu, 16 Dec 2004 15:38:39 +0000 (15:38 +0000)]
Fix obviously stupid segfault. Ahem.

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

19 years agoAbe Crabtree complains that flushing the log file as often as we do in 0.56
jacob [Thu, 16 Dec 2004 15:22:36 +0000 (15:22 +0000)]
Abe Crabtree complains that flushing the log file as often as we do in 0.56
results in unacceptable performance for him on Win2000. Add a checkbox to
revert to the old behaviour.

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

19 years agoRename scp.* to pscp.*, because I always misspell it that way. Also
simon [Thu, 16 Dec 2004 15:01:43 +0000 (15:01 +0000)]
Rename scp.* to pscp.*, because I always misspell it that way. Also
it's more consistent with PSFTP like this: scp.c/pscp.c is more
similar to psftp.c (the main application framework) than it is to
sftp.c (a set of back-end library routines).

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

19 years agoUnix PSCP was tight-looping when connecting through a ProxyCommand.
simon [Fri, 10 Dec 2004 11:41:14 +0000 (11:41 +0000)]
Unix PSCP was tight-looping when connecting through a ProxyCommand.
Turned out that sk_localproxy_close() was closing the pipe fds
without removing them from the uxsel list.

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

19 years agoReplace the RLE-based getType() function with one that binary-
simon [Wed, 8 Dec 2004 19:41:14 +0000 (19:41 +0000)]
Replace the RLE-based getType() function with one that binary-
searches a list of (start,end,type) tuples. This increases data size
by about 5Kb, which is a shame; but on the plus side, it boosts
performance from O(N) to O(log N). As an added bonus, the table now
covers _all_ of Unicode, not just the BMP.

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

19 years agoFurther clarity and speed cleanups of minibidi:
simon [Wed, 8 Dec 2004 19:07:05 +0000 (19:07 +0000)]
Further clarity and speed cleanups of minibidi:
 - rewrote the reversal loop in flipThisRun to be considerably clearer
 - rewrote leastGreaterOdd and leastGreaterEven as bit-twiddling macros
 - replaced malloc/free with snewn/sfree
 - lost some gratuitous repeat calls of getType on the same character
And most noticeably:
 - got rid of minibidi.h, since it was entirely full of minibidi.c
   internals (including constant data definitions!) and wasn't used
   to provide an external interface at all. Everything in it has
   been folded into minibidi.c.

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

19 years agoReformat minibidi.[ch] in line with my coding conventions. It was
simon [Tue, 7 Dec 2004 18:18:28 +0000 (18:18 +0000)]
Reformat minibidi.[ch] in line with my coding conventions. It was
just getting to be too much hassle trying to work with the existing
indentation.

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

19 years agoBidi stability work. I _think_ I've now removed all the failures of
simon [Tue, 7 Dec 2004 18:10:09 +0000 (18:10 +0000)]
Bidi stability work. I _think_ I've now removed all the failures of
array bounds checking.

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

19 years agoFix segfault when HOME not set on Unix.
owen [Tue, 7 Dec 2004 11:50:44 +0000 (11:50 +0000)]
Fix segfault when HOME not set on Unix.

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

19 years ago\n and \r need double backslashes in Halibut.
simon [Thu, 2 Dec 2004 13:48:32 +0000 (13:48 +0000)]
\n and \r need double backslashes in Halibut.

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

19 years agoNULL a couple of members after freeing them in ssh_free(). In particular,
jacob [Thu, 2 Dec 2004 13:37:28 +0000 (13:37 +0000)]
NULL a couple of members after freeing them in ssh_free(). In particular,
should stop ssh_do_close() accessing freed ssh->channels when invoked later
from ssh_free(). Spotted by Fred Sauer.

(Perhaps this is the cause of the crashes people have been reporting on
abnormal closures such as `Software caused connection abort'? I've not been
able to test this.)

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