u/mdw/putty
21 years agoRobustness fixes for KEXINIT handling and others. In particular, I've
simon [Thu, 7 Nov 2002 19:49:03 +0000 (19:49 +0000)]
Robustness fixes for KEXINIT handling and others. In particular, I've
created a self-mallocing variant of sprintf, to obviate any future
need for paranoid %.100s type stuff in format strings.

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

21 years agoBorland makefile needs to define _WINDOWS; apparently this makefile
simon [Thu, 7 Nov 2002 19:37:36 +0000 (19:37 +0000)]
Borland makefile needs to define _WINDOWS; apparently this makefile
hasn't worked since the Unix port started and nobody has noticed
until now :-)

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

21 years agoPacket-level logging should now work properly in Unix Plink.
simon [Tue, 5 Nov 2002 13:21:03 +0000 (13:21 +0000)]
Packet-level logging should now work properly in Unix Plink.

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

21 years agoFix command-line error handling in pterm. (Hint: wrapping a multi-
simon [Tue, 5 Nov 2002 13:20:42 +0000 (13:20 +0000)]
Fix command-line error handling in pterm. (Hint: wrapping a multi-
statement macro in `do ... while (0)' and putting a `continue'
within it don't go well together. Oops.)

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

21 years agoSubstitute `-' (magical hyphen) for `\-' (inert minus sign) in the
simon [Tue, 5 Nov 2002 09:37:31 +0000 (09:37 +0000)]
Substitute `-' (magical hyphen) for `\-' (inert minus sign) in the
manpage. Fixes Debian bug #167761.

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

21 years agoHalf of Lars Gunnarsson's iXplorer compatibility patch: the PSFTP
simon [Sun, 3 Nov 2002 08:46:35 +0000 (08:46 +0000)]
Half of Lars Gunnarsson's iXplorer compatibility patch: the PSFTP
login prompt should be fflushed (presumably fgets fails to implicitly
do this when stdin and stdout are redirected weirdly).

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

21 years agoProbably about time we mentioned the nascent Unix port in the FAQ.
simon [Sat, 2 Nov 2002 16:27:17 +0000 (16:27 +0000)]
Probably about time we mentioned the nascent Unix port in the FAQ.
Not that I desperately want to shout about it just yet, but I feel a
bit bad about the FAQ saying `we don't have a Unix port, anyone who
told you so was wrong'. :-)

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

21 years agoImprove shadow bold mode: set the default shadow bold offset to +1
simon [Sat, 2 Nov 2002 16:16:35 +0000 (16:16 +0000)]
Improve shadow bold mode: set the default shadow bold offset to +1
not -1 (it turns out _most_ X fonts prefer the former, though
irritatingly my favourite real X font used to prefer the latter
which was why I made the X version of my Font Of Choice do so too),
and also clip to the boundaries of the rectangle we should be
drawing text in. This still doesn't completely prevent display
corruption in the case where text drawn in one sweep is partially
overwritten in a future one, but gnome-terminal has this problem
too, and now we've got the right default SB offset _and_ offer the
opportunity to reconfigure it I think this is pretty good for now.

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

21 years agoAnother signal-handling refinement from RJK: the SIGCHLD handler
simon [Sat, 2 Nov 2002 16:05:26 +0000 (16:05 +0000)]
Another signal-handling refinement from RJK: the SIGCHLD handler
should be prepared to reap more than one child per invocation if
necessary, since we do after all have two.

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

21 years agoImprove the noise collection for the internal random pool.
simon [Sat, 2 Nov 2002 15:23:20 +0000 (15:23 +0000)]
Improve the noise collection for the internal random pool.

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

21 years agoRJK's general signal-handling robustness patch. Should fix the weird
simon [Sat, 2 Nov 2002 14:35:57 +0000 (14:35 +0000)]
RJK's general signal-handling robustness patch. Should fix the weird
spin behaviour occasionally seen after pterm's child process dies.

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

21 years agos/public/private/ spotted by Clint Hastings; also change a "public key"
jacob [Fri, 1 Nov 2002 21:50:35 +0000 (21:50 +0000)]
s/public/private/ spotted by Clint Hastings; also change a "public key"
to "key pair"

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

21 years agoIntroduce program category U, for non-GTK-requiring Unix apps. Plink
simon [Fri, 1 Nov 2002 18:51:55 +0000 (18:51 +0000)]
Introduce program category U, for non-GTK-requiring Unix apps. Plink
doesn't need to be linked with libgtk, libgdk, libX11 etc!

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

21 years agoPrevent another segfault. Oops.
simon [Fri, 1 Nov 2002 18:51:22 +0000 (18:51 +0000)]
Prevent another segfault. Oops.

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

21 years ago.HLP files should be ignored as well. Oops.
simon [Fri, 1 Nov 2002 13:49:25 +0000 (13:49 +0000)]
.HLP files should be ignored as well. Oops.

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

21 years agoAdd a .cvsignore for the Unix subdir
simon [Fri, 1 Nov 2002 13:37:39 +0000 (13:37 +0000)]
Add a .cvsignore for the Unix subdir

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

21 years agoImprove handling of oobinline sockets; Plink in telnet mode now
simon [Fri, 1 Nov 2002 13:36:48 +0000 (13:36 +0000)]
Improve handling of oobinline sockets; Plink in telnet mode now
doesn't hang when you hit ^C, which is nice. I think a better
solution would involve nonblocking sockets; as it stands it's a
little dependent on what may be quirks of the Linux socket layer.

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

21 years agoAnother valgrind-caught error. This one has apparently been there
simon [Fri, 1 Nov 2002 13:01:14 +0000 (13:01 +0000)]
Another valgrind-caught error. This one has apparently been there
since the Dawn O' Time, and consisted of me putting the two halves
of a short-circuiting bounds check the wrong way round: instead of
`p_in_range && *p', I had `*p && p_in_range'. Oops. valgrind rocks.

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

21 years agovalgrind has caught two more uninitialised elements in the SSH
simon [Fri, 1 Nov 2002 12:59:09 +0000 (12:59 +0000)]
valgrind has caught two more uninitialised elements in the SSH
context structure. I knew the Unix port would be a good idea!

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

21 years agoImplement access to the SSH agent. This ought to make agent
simon [Fri, 1 Nov 2002 12:55:13 +0000 (12:55 +0000)]
Implement access to the SSH agent. This ought to make agent
forwarding work as well, of course.

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

21 years agoReplace a \r\n with an ordinary \n - this isn't Windows!
simon [Fri, 1 Nov 2002 12:54:51 +0000 (12:54 +0000)]
Replace a \r\n with an ordinary \n - this isn't Windows!

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

21 years agoStop the segfault on failure to resolve a host name.
simon [Fri, 1 Nov 2002 12:54:22 +0000 (12:54 +0000)]
Stop the segfault on failure to resolve a host name.

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

21 years agoAdd a \n at the end of an error message - oops.
simon [Fri, 1 Nov 2002 12:54:03 +0000 (12:54 +0000)]
Add a \n at the end of an error message - oops.

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

21 years agoMove an output newline to make username entry in Plink/SSH2 look
simon [Fri, 1 Nov 2002 12:53:45 +0000 (12:53 +0000)]
Move an output newline to make username entry in Plink/SSH2 look
more sensible.

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

21 years agoPass int rather than char to va_arg (the latter gets promoted).
simon [Fri, 1 Nov 2002 12:53:10 +0000 (12:53 +0000)]
Pass int rather than char to va_arg (the latter gets promoted).

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

21 years agoSplit a trigraph sequence in a string constant.
simon [Fri, 1 Nov 2002 12:52:51 +0000 (12:52 +0000)]
Split a trigraph sequence in a string constant.

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

21 years agoFirst attempt at a Unix port of Plink. Seems to basically work;
simon [Thu, 31 Oct 2002 19:49:52 +0000 (19:49 +0000)]
First attempt at a Unix port of Plink. Seems to basically work;
doesn't yet use the SSH agent, no way to specify arbitrary config
options, no manpage yet, couple of other fiddly things need doing,
but it makes SSH connections and doesn't fall over horribly so I say
it's a good start. Now to run it under valgrind...

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

21 years agoRJK's `pterm --help' patch. I _must_ find a better alternative to
simon [Wed, 30 Oct 2002 18:22:37 +0000 (18:22 +0000)]
RJK's `pterm --help' patch. I _must_ find a better alternative to
this init sequence - it surely can't be right that `pterm --help'
with no DISPLAY complains at the lack of DISPLAY rather than giving
a help message!

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

21 years agoRJK's `make install' patch for the Unix makefile.
simon [Wed, 30 Oct 2002 18:17:56 +0000 (18:17 +0000)]
RJK's `make install' patch for the Unix makefile.

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

21 years agoFurther deglobalisation: settings.c now has a more sensible interface.
simon [Wed, 30 Oct 2002 18:12:46 +0000 (18:12 +0000)]
Further deglobalisation: settings.c now has a more sensible interface.

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

21 years agoFix some consts.
simon [Wed, 30 Oct 2002 18:12:22 +0000 (18:12 +0000)]
Fix some consts.

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

21 years agoMore preparatory work: remove the <windows.h> include from lots of
simon [Wed, 30 Oct 2002 17:57:31 +0000 (17:57 +0000)]
More preparatory work: remove the <windows.h> include from lots of
source files in which it's no longer required (it was previously
required in anything that included <putty.h>, but not any more).
Also moved a couple of stray bits of exposed WinSock back into
winnet.c (getservbyname from ssh.c and AF_INET from proxy.c).

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

21 years agoPreparatory work before attempting a Unix port of plink: mkfiles.pl
simon [Wed, 30 Oct 2002 17:56:05 +0000 (17:56 +0000)]
Preparatory work before attempting a Unix port of plink: mkfiles.pl
needs to be able to handle separate Recipe entries for the same
program with different types (plink [C] and plink [X] for example,
with different object lists).

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

21 years agoYikes - put back a #include I accidentally removed two revs ago!
simon [Tue, 29 Oct 2002 16:54:09 +0000 (16:54 +0000)]
Yikes - put back a #include I accidentally removed two revs ago!
That'd have been embarrassing. Mind you I'd like to remove this
particular #include for good anyway, but the time is not now...

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

21 years agoHmm. Probably best initialise mainchan as well; oops.
simon [Tue, 29 Oct 2002 14:41:10 +0000 (14:41 +0000)]
Hmm. Probably best initialise mainchan as well; oops.

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

21 years agoTry actually initialising ssh->v1_compressing. With any luck this
simon [Tue, 29 Oct 2002 13:05:20 +0000 (13:05 +0000)]
Try actually initialising ssh->v1_compressing. With any luck this
will be what was causing Owen's crash report today.

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

21 years agoterminal.c should call the frontend beep() routine even with
simon [Mon, 28 Oct 2002 21:58:07 +0000 (21:58 +0000)]
terminal.c should call the frontend beep() routine even with
mode==BELL_VISUAL, otherwise taskbar flashing won't happen on visual
bells. It's up to the frontend routine to spot BELL_VISUAL and avoid
making any noise.

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

21 years agoCloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
simon [Mon, 28 Oct 2002 17:39:21 +0000 (17:39 +0000)]
CloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
into line with most other xtermalikes. On Unix, the exit code of a
shell is the last exit code of one of its child processes, even if
it's an interactive shell - so some pterms will close and some will
not for no particularly good reason. Power-detaching a screen
session is especially bad for this.
COE_NORMAL is still useful for specialist purposes (running a single
command in its own pterm), but I don't think it's a sane default,
unfortunately.

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

21 years agoFix Alt+numberpad in pterm. For a start, there was a bug whereby if
simon [Mon, 28 Oct 2002 17:34:45 +0000 (17:34 +0000)]
Fix Alt+numberpad in pterm. For a start, there was a bug whereby if
a pterm came up while Alt was down, then releasing it would cause a
^@ to be generated. Also, though, I've decided that Alt plus a
single numberpad key should not generate a low-numbered control
code, because that's too easy to do by mistake and the codes are too
powerful. Anyone who really _wants_ to create a ^C or ^D from the
numberpad can do Alt-03 or Alt-04 easily enough; two-digit codes and
more such as Alt-65 are unaffected.

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

21 years agoAnother deglobalisation bug: failed to initialise term->curstype.
simon [Mon, 28 Oct 2002 17:30:47 +0000 (17:30 +0000)]
Another deglobalisation bug: failed to initialise term->curstype.
Thanks to valgrind for finding this one (aha! I knew there would be
benefits from doing a Unix port!).

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

21 years agoFirst bug discovered as a result of global-removal: pasting into
simon [Mon, 28 Oct 2002 09:38:28 +0000 (09:38 +0000)]
First bug discovered as a result of global-removal: pasting into
pterm caused a crash because I had the wrong prototype for the
selection_received event handler. Should be fixed.

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

21 years agoArrgh! _Another_ missed commit. I really must do something about
simon [Sun, 27 Oct 2002 09:24:47 +0000 (09:24 +0000)]
Arrgh! _Another_ missed commit. I really must do something about
this bad habit of mine :-/

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

21 years agoRetire another global in favour of adding a feature to the
simon [Sat, 26 Oct 2002 14:06:52 +0000 (14:06 +0000)]
Retire another global in favour of adding a feature to the
terminal.c interface.

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

21 years agoYet more global-removal. The static variables in logging.c are now
simon [Sat, 26 Oct 2002 12:58:13 +0000 (12:58 +0000)]
Yet more global-removal. The static variables in logging.c are now
absent, and also (I think) all the frontend request functions (such
as request_resize) take a context pointer, so that multiple windows
can be handled sensibly. I wouldn't swear to this, but I _think_
that only leaves the Unicode stuff as the last stubborn holdout.

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

21 years agoRichard points out that it would probably help if I committed
simon [Sat, 26 Oct 2002 12:42:07 +0000 (12:42 +0000)]
Richard points out that it would probably help if I committed
ldisc.h. Bah. :-)

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

21 years agoX forwarding authentication is now invented on a per-SSH-connection
simon [Sat, 26 Oct 2002 11:23:15 +0000 (11:23 +0000)]
X forwarding authentication is now invented on a per-SSH-connection
basis, so the statics are gone from x11fwd.c.

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

21 years agoFix proxy.c so that the static variables become const.
simon [Sat, 26 Oct 2002 11:12:24 +0000 (11:12 +0000)]
Fix proxy.c so that the static variables become const.

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

21 years agoReorganised the Unicode layer somewhat: moved luni_send and
simon [Sat, 26 Oct 2002 11:08:59 +0000 (11:08 +0000)]
Reorganised the Unicode layer somewhat: moved luni_send and
lpage_send out into the line discipline, making them _clients_ of
the Unicode layer rather than part of it. This means they can access
ldisc->term, which in turn means I've been able to remove the
temporary global variable `term'. We're slowly getting there.

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

21 years agoPort forwarding module now passes backend handles around properly.
simon [Sat, 26 Oct 2002 10:33:59 +0000 (10:33 +0000)]
Port forwarding module now passes backend handles around properly.
As a result I've now been able to turn the global variables `back'
and `backhandle' into module-level statics in the individual front
ends. Now _that's_ progress!

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

21 years agoLine discipline module now uses dynamically allocated data. Also
simon [Sat, 26 Oct 2002 10:16:19 +0000 (10:16 +0000)]
Line discipline module now uses dynamically allocated data. Also
fixed one or two other minor problems.

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

21 years agoOops; remembering to call term_provide_resize_fn in the Unix front
simon [Fri, 25 Oct 2002 22:00:22 +0000 (22:00 +0000)]
Oops; remembering to call term_provide_resize_fn in the Unix front
end would probably help. Thanks Colin.

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

21 years agoThe Zlib module now uses dynamically allocated contexts. I think
simon [Fri, 25 Oct 2002 13:26:33 +0000 (13:26 +0000)]
The Zlib module now uses dynamically allocated contexts. I think
that completes the static-removal in the crypto library. Ooh.

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

21 years agoDiffie-Hellman key exchange now uses a dynamically allocated context.
simon [Fri, 25 Oct 2002 13:08:01 +0000 (13:08 +0000)]
Diffie-Hellman key exchange now uses a dynamically allocated context.

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

21 years agoFix some compiler warnings.
simon [Fri, 25 Oct 2002 13:00:45 +0000 (13:00 +0000)]
Fix some compiler warnings.

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

21 years agoTidy up and fix a compiler warning.
simon [Fri, 25 Oct 2002 12:59:57 +0000 (12:59 +0000)]
Tidy up and fix a compiler warning.

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

21 years agoSSH CRC attack detector now uses a dynamically allocated context.
simon [Fri, 25 Oct 2002 12:58:21 +0000 (12:58 +0000)]
SSH CRC attack detector now uses a dynamically allocated context.

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

21 years agoSSH2 MACs now use dynamically allocated contexts.
simon [Fri, 25 Oct 2002 12:51:28 +0000 (12:51 +0000)]
SSH2 MACs now use dynamically allocated contexts.

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

21 years agoSSH ciphers now use dynamically allocated contexts.
simon [Fri, 25 Oct 2002 12:35:22 +0000 (12:35 +0000)]
SSH ciphers now use dynamically allocated contexts.

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

21 years agoFix the nasty flashing-light-grey-on-resize problem, after MCV
simon [Fri, 25 Oct 2002 11:58:59 +0000 (11:58 +0000)]
Fix the nasty flashing-light-grey-on-resize problem, after MCV
helpfully alerted me to the existence of gdk_window_set_background().

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

21 years agopty backend now supports the changed function interface, so pterm
simon [Fri, 25 Oct 2002 11:50:51 +0000 (11:50 +0000)]
pty backend now supports the changed function interface, so pterm
now compiles and runs again after the major destabilisation.
Unfortunately it wasn't feasible to actually encapsulate all of the
pty backend's data, since the utmp helper and the need to fork and
drop privileges before doing anything else at all rather confuses
matters. So the data handle passed around to the pty backend is a
null pointer, and the pty backend is just as global-ridden as it
always has been. Shame, but such is life.

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

21 years agoMajor destabilisation, phase 2. This time it's the backends' turn:
simon [Fri, 25 Oct 2002 11:30:33 +0000 (11:30 +0000)]
Major destabilisation, phase 2. This time it's the backends' turn:
each backend now stores all its internal variables in a big struct,
and each backend function gets a pointer to this struct passed to
it. This still isn't the end of the work - lots of subsidiary things
still use globals, notably all the cipher and compressor modules and
the X11 forwarding authentication stuff. But ssh.c itself has now
been transformed, and that was the really painful bit, so from here
on it all ought to be a sequence of much smaller and simpler pieces
of work.

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

21 years agoNeed to stub frontend_keypress() in console.c as well as window.c.
simon [Thu, 24 Oct 2002 14:48:08 +0000 (14:48 +0000)]
Need to stub frontend_keypress() in console.c as well as window.c.

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

21 years agoOops - repercussions of the close-on-exit stuff which I forgot to
simon [Thu, 24 Oct 2002 14:12:55 +0000 (14:12 +0000)]
Oops - repercussions of the close-on-exit stuff which I forgot to
check in. I must stop doing my Unix checkins in the Unix subdir :-(

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

21 years agoMinor compiler nits:
jacob [Wed, 23 Oct 2002 14:24:40 +0000 (14:24 +0000)]
Minor compiler nits:
 - use smalloc/sfree, not malloc/free
 - include <ctype.h>
 - include <string.h> (although this doesn't shut the compiler up about
   non-ANSI stricmp/strnicmp)

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

21 years agoImplement handling of all Close On Exit modes. Default is to close
simon [Wed, 23 Oct 2002 14:21:12 +0000 (14:21 +0000)]
Implement handling of all Close On Exit modes. Default is to close
only on clean exit, which is a departure from most xterm-alikes but
Ian reckons people will love me for it. If this turns out to be
wrong, we can always change the default for Unix.

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

21 years agoFixes for (Backend)->size() changes -- internal declarations didn't include
jacob [Wed, 23 Oct 2002 14:03:11 +0000 (14:03 +0000)]
Fixes for (Backend)->size() changes -- internal declarations didn't include
new arguments and neither did internal calls.

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

21 years agoRemove apparently unnecessary declaration of typedef Config from winstuff.h --
jacob [Wed, 23 Oct 2002 13:46:59 +0000 (13:46 +0000)]
Remove apparently unnecessary declaration of typedef Config from winstuff.h --
it was breaking mingw builds (gcc being more picky than Visual C).

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

21 years agoCleanups from yesterday's destabilisation: lots of stuff in
simon [Wed, 23 Oct 2002 12:41:35 +0000 (12:41 +0000)]
Cleanups from yesterday's destabilisation: lots of stuff in
terminal.c was apparently relying on implicit initialisation to
zero, and also I've removed the backends' dependency on terminal.h
by having terminal sizes explicitly passed in to back->size().

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

21 years agoOops. Forgot to check in terminal.h from yesterday's work. There's
simon [Wed, 23 Oct 2002 09:11:36 +0000 (09:11 +0000)]
Oops. Forgot to check in terminal.h from yesterday's work. There's
always one :-/

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

21 years agoMajor destabilisation, phase 1. In this phase I've moved (I think)
simon [Tue, 22 Oct 2002 16:11:33 +0000 (16:11 +0000)]
Major destabilisation, phase 1. In this phase I've moved (I think)
all the global and function-static variables out of terminal.c into
a dynamically allocated data structure. Note that this does not yet
confer the ability to run more than one of them in the same process,
because other things (the line discipline, the back end) are still
global, and also in particular the address of the dynamically
allocated terminal-data structure is held in a global variable
`term'. But what I've got here represents a reasonable stopping
point at which to check things in. In _theory_ this should all still
work happily, on both Unix and Windows. In practice, who knows?

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

21 years agoMake -ut work the right way round! :-)
simon [Tue, 22 Oct 2002 13:27:58 +0000 (13:27 +0000)]
Make -ut work the right way round! :-)

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

21 years agoStop `pterm -ut-' leaving the unnecessary utmp helper as a zombie
simon [Tue, 22 Oct 2002 13:26:57 +0000 (13:26 +0000)]
Stop `pterm -ut-' leaving the unnecessary utmp helper as a zombie
process (Debian bug #165887).

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

21 years agoThanks to Richard B for pointing out that xterm has its own variants
simon [Tue, 22 Oct 2002 10:31:23 +0000 (10:31 +0000)]
Thanks to Richard B for pointing out that xterm has its own variants
of the alternate-screen and save-cursor control sequences, with
subtly different semantics and entertaining interactions with the
usual ones. No thanks to xterm for doing so in the first place :-(
This checkin should sort it all out.

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

21 years agoJustin Bradford's patch for increased proxy robustness.
simon [Tue, 22 Oct 2002 09:40:38 +0000 (09:40 +0000)]
Justin Bradford's patch for increased proxy robustness.

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

21 years agoMake sure SIGINT and SIGQUIT haven't been nobbled in our child
simon [Mon, 21 Oct 2002 23:01:34 +0000 (23:01 +0000)]
Make sure SIGINT and SIGQUIT haven't been nobbled in our child
process by weird POSIX-required shell behaviour.

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

21 years agoDon't bother closing fds 0-2 before dup2ing over them; there's no
simon [Mon, 21 Oct 2002 23:00:18 +0000 (23:00 +0000)]
Don't bother closing fds 0-2 before dup2ing over them; there's no
need, and it means we always have a valid open stderr.

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

21 years agoVT100 line drawing characters should only happen between 0x5F and
simon [Mon, 21 Oct 2002 22:59:14 +0000 (22:59 +0000)]
VT100 line drawing characters should only happen between 0x5F and
0x7E, not everywhere else. Silly me thought nobody would bother to
depend on this :-)

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

21 years agoImplement Richard's really clever idea about bell overload mode:
simon [Sun, 20 Oct 2002 13:23:30 +0000 (13:23 +0000)]
Implement Richard's really clever idea about bell overload mode:
it's automatically deactivated by any keypress, so that command-line
beeps from (e.g.) filename completion don't suddenly stop occurring,
but it still provides a rapid response to an accidental spewing of a
binary to your terminal.

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

21 years agoScrollOnKey wasn't working because I failed to set seen_key_event in
simon [Sun, 20 Oct 2002 12:44:29 +0000 (12:44 +0000)]
ScrollOnKey wasn't working because I failed to set seen_key_event in
pterm.c.

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

21 years agoReject unrecognised command-line options; thanks rjk.
simon [Fri, 18 Oct 2002 15:26:54 +0000 (15:26 +0000)]
Reject unrecognised command-line options; thanks rjk.

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

21 years agoFix typo in man page. Thanks Richard.
simon [Fri, 18 Oct 2002 10:38:22 +0000 (10:38 +0000)]
Fix typo in man page. Thanks Richard.

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

21 years agoOops - that fix wasn't _quite_ right, since it killed all
simon [Thu, 17 Oct 2002 16:58:24 +0000 (16:58 +0000)]
Oops - that fix wasn't _quite_ right, since it killed all
non-function keys completely :-/

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

21 years agoMake the shadow bold offset configurable, after discovering that
simon [Thu, 17 Oct 2002 16:51:01 +0000 (16:51 +0000)]
Make the shadow bold offset configurable, after discovering that
7x13 goes the other way to all other X fonts I've ever seen. (Arrgh.)

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

21 years agoThis should fix the bug causing Alt-Shift to generate Escape.
simon [Thu, 17 Oct 2002 16:45:17 +0000 (16:45 +0000)]
This should fix the bug causing Alt-Shift to generate Escape.

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

21 years agoAdd the -xrm command-line option, to allow specification of an
simon [Wed, 16 Oct 2002 22:54:58 +0000 (22:54 +0000)]
Add the -xrm command-line option, to allow specification of an
arbitrary X resource which doesn't have a dedicated command-line
option.

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

21 years agoAdd a man page.
simon [Wed, 16 Oct 2002 22:43:35 +0000 (22:43 +0000)]
Add a man page.

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

21 years agoTemporarily change the default for cut-and-paste of line drawing
simon [Wed, 16 Oct 2002 16:32:17 +0000 (16:32 +0000)]
Temporarily change the default for cut-and-paste of line drawing
characters, under Unix only, because the stub Unicode layer makes
the usual default break moderately painfully.

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

21 years agoA few more command-line options.
simon [Wed, 16 Oct 2002 16:00:38 +0000 (16:00 +0000)]
A few more command-line options.

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

21 years agoOops, forgot to add BoldFont to the settings module.
simon [Wed, 16 Oct 2002 14:32:21 +0000 (14:32 +0000)]
Oops, forgot to add BoldFont to the settings module.

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

21 years agoImplement reading of X resources, and -name to change the name under
simon [Wed, 16 Oct 2002 14:32:06 +0000 (14:32 +0000)]
Implement reading of X resources, and -name to change the name under
which to look them up.

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

21 years agoAdd a file to the source archive mentioning the version number of
simon [Wed, 16 Oct 2002 12:30:51 +0000 (12:30 +0000)]
Add a file to the source archive mentioning the version number of
the latest release. This is so that .tar.gz snapshots for the Unix
port can be versioned as `0.53-20021016' or similar, meaning that
(e.g.) Debian version numbering can be monotonic between releases
and snapshots.

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

21 years agoFix utmp and pty handling so that GTK never complains about running
simon [Wed, 16 Oct 2002 12:17:51 +0000 (12:17 +0000)]
Fix utmp and pty handling so that GTK never complains about running
set[ug]id. All privs-requiring pty operations are done at the very
start of the run, then privs are dropped before initialising GTK.
Utmp is handled by forking a still-privileged subprocess at this
point, and later asking it (through a pipe) to stamp utmp. The
subprocess cleans up utmp on exit, which has the additional
advantage that if the main pterm process suffers some sort of
unexpected termination (up to and including SIGKILL) the subprocess
can still mop up utmp.

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

21 years agoFix for `hostname-whitespace'; thanks to Justin Bradford.
simon [Wed, 16 Oct 2002 11:35:13 +0000 (11:35 +0000)]
Fix for `hostname-whitespace'; thanks to Justin Bradford.

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

21 years agoBug `shift-backspace': whichever of ^H and ^? is configured for
simon [Wed, 16 Oct 2002 09:40:36 +0000 (09:40 +0000)]
Bug `shift-backspace': whichever of ^H and ^? is configured for
Backspace, Shift-Backspace should do the _other_ one. Thanks to
Justin Bradford.

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

21 years agoOops - check in leftovers from yesterday's development. That's what
simon [Wed, 16 Oct 2002 09:28:17 +0000 (09:28 +0000)]
Oops - check in leftovers from yesterday's development. That's what
I get for running most of my cvs commands in the unix subdir :-/

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

21 years agoSupport bold-as-font, by means of a separate bold font (if one was
simon [Tue, 15 Oct 2002 18:42:48 +0000 (18:42 +0000)]
Support bold-as-font, by means of a separate bold font (if one was
supplied) or shadow bolding (if not). As usual, can't yet be turned
on without a recompile.

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

21 years agoConfigure the pty so that it agrees with our idea of whether
simon [Tue, 15 Oct 2002 18:36:18 +0000 (18:36 +0000)]
Configure the pty so that it agrees with our idea of whether
Backspace sends ^H or ^?.

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

21 years agoSupport underline and vertical-line cursors as well as block.
simon [Tue, 15 Oct 2002 18:18:25 +0000 (18:18 +0000)]
Support underline and vertical-line cursors as well as block.

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

21 years agoIf we can't load the specified font, give an error message rather
simon [Tue, 15 Oct 2002 17:41:22 +0000 (17:41 +0000)]
If we can't load the specified font, give an error message rather
than segfaulting.

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

21 years agoPrinter support: cfg.printer is assumed to be a Unix command through
simon [Tue, 15 Oct 2002 17:38:04 +0000 (17:38 +0000)]
Printer support: cfg.printer is assumed to be a Unix command through
which to pipe printed data. Of course by default printing is
disabled; typically cfg.printer would be set to `lpr', perhaps with
some arguments.

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