1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 18:07:59 +00:00
Commit Graph

370 Commits

Author SHA1 Message Date
Jacob Nevins
97fb4184d8 Fix an annoying inconsistency that's been bugging me for years: "plink host"
and "plink user@host" differed in that the former attempted to load session
`host' while the latter didn't. Now both forms attempt to load a session.
Someone will probably complain, but hey.

[originally from svn r4485]
2004-08-19 15:05:31 +00:00
Jacob Nevins
87ecc7e052 Remove claim in usage text that Plink defaults to SSH, since it's not true
in a number of situations.

[originally from svn r4484]
2004-08-19 13:15:02 +00:00
Jacob Nevins
df66432b5d Patch from Kurt Roeckx: apparently on Debian amd64, the ut_time member of
struct utmp is not equivalent to time_t (it's 32-bit). From Debian bug#265910.

[originally from svn r4459]
2004-08-16 09:38:12 +00:00
Simon Tatham
0047bbe70f Implement `Restart Session', in both Unix and Windows PuTTY. Largely
because Owen questioned whether it was really easy enough to be
labelled `fun' in the bug database :-)

[originally from svn r4453]
2004-08-14 13:04:18 +00:00
Simon Tatham
3b647115a5 Fix double-free in X selection code.
[originally from svn r4367]
2004-07-27 15:20:37 +00:00
Jacob Nevins
c2914f2191 Fix for `psftp-pscp-ignore-load': Default Settings is now loaded
before "-load" is processed so that it doesn't clobber it.

I've also changed the semantics of "-load" slightly for PSCP, PSFTP,
and Plink: if it's specified at all, it overrides (disables) the
implicit loading of session details based on a supplied hostname
elsewhere (on the grounds that the user is more likely to want the
"-load" session than the implicit session). (PuTTY itself doesn't do
implicit loading at all, so I haven't changed it.)

This means that all the PuTTY tools' behaviour is now consistent iff
"-load" is specified (otherwise, some tools have implicit-session, and
others don't).

However, I've not documented this behaviour, as there's a good chance
it will be swept away if and when we get round to sorting out how we
deal with settings from multiple sources. It's intended as a "do
something sensible" change.

[originally from svn r4352]
2004-07-25 14:00:26 +00:00
Jacob Nevins
20f433efac Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off.
No very good reason, but I've occasionally wanted to frob it to see if it
makes any difference to problems I'm having, and it was easy.

Tested that it does actually cause keepalives on Windows (with tcpdump);
should also work on Unix. Not implemented on Mac (does nothing), but then
neither is TCP_NODELAY.

Quite a big checkin, much of which is adding `keepalive' alongside `nodelay'
in network function calls.

[originally from svn r4309]
2004-06-20 17:07:38 +00:00
Simon Tatham
a2acc6ae0d RJK's patch to enable PuTTY's X forwarding to connect to local X
servers using Unix sockets (on Unix only, obviously!).

[originally from svn r4263]
2004-05-31 14:01:52 +00:00
Simon Tatham
be5133f376 Arnaud Desitter points out a silly mistake in retrieve_cutbuffer()
(don't test for `int *nbytes' being <= 0, test for the integer it
points to being <= 0!).

[originally from svn r4254]
2004-05-24 11:30:15 +00:00
Simon Tatham
2ff7b4385f Fix indentation after Richard B's patch in rev 1.137 [r3409].
[originally from svn r4241]
[r3409 == 7798a59987]
2004-05-22 14:21:27 +00:00
Jacob Nevins
2b4e286954 Tweak documentation of -V option.
[originally from svn r4132]
2004-04-24 12:25:09 +00:00
Owen Dunn
6863377b72 Add -V for version information to plink, pscp, and psftp.
[originally from svn r4092]
2004-04-17 20:25:09 +00:00
Simon Tatham
ff6e3bc94d Now that Halibut is capable of generating man pages better than I
can do it by hand, I've converted the man page set from Unix PuTTY
into Halibut format, and enhanced the Makefile so it will build
them. At some future point this will also allow me to include the
man pages as an appendix in the main manual (once I _have_ a main
manual for Unix PuTTY).

[originally from svn r3966]
2004-03-24 19:36:04 +00:00
Jacob Nevins
e9ae739b9a Add (probably frustratingly) bare-bones man pages for pscp and psftp.
[originally from svn r3890]
2004-02-22 15:05:29 +00:00
Jacob Nevins
866cd6126c Fix typo in -C
[originally from svn r3887]
2004-02-22 14:40:40 +00:00
Jacob Nevins
a5ea485d0f Tart up, fix outright lies, mention web docs
[originally from svn r3886]
2004-02-22 14:37:54 +00:00
Jacob Nevins
c6d8ab8bd3 Remove claim that there's no Unix puttygen
[originally from svn r3860]
2004-02-13 00:21:35 +00:00
Jacob Nevins
5e2a33caec Patch from Theo Markettos: apparently "BSD-derived IP stacks fall over when
trying to bind to the localhost interface with a sockaddr_in which has non-zero
sin_zero fields." Zero sockaddr_in (and sockaddr_in6) before any use.

[originally from svn r3793]
2004-02-03 14:47:43 +00:00
Jacob Nevins
8472b1c8d7 Patch from Colin Watson: document pterm.WarnOnClose
[originally from svn r3792]
2004-02-03 14:36:01 +00:00
Simon Tatham
3f199bfe5c Add a man page for the new command-line PuTTYgen.
[originally from svn r3766]
2004-01-23 13:21:25 +00:00
Simon Tatham
2d1287b9ca Added a command-line key generation tool. Currently builds and runs
on Linux, but the (very few) platform-specific bits are already
abstracted out of the main code, so it should port to other
platforms with a minimum of fuss.

[originally from svn r3762]
2004-01-22 19:15:32 +00:00
Simon Tatham
4dec95f80f Theo Markettos's unsigned-vs-signed-char pedantry patch.
[originally from svn r3753]
2004-01-21 19:45:44 +00:00
Jacob Nevins
352ec6a486 `portfwd-loopback-choice' was not consistently documented.
- update usage info in tools
   - ack, plink is over 24 lines now
 - update man pages for Unix version
 - Doc changes:
   - move long description from (GUI) "config" to "using"
     - sorry if complete specification isn't what this section is meant for,
       but if you only read "using" it was hard to find.
   - ensure enough references to this made in other sections (GUI,
     command-line)
   - update instance of plink usage info

[originally from svn r3740]
2004-01-20 12:46:36 +00:00
Simon Tatham
2dd7514b07 Idiot me _twice_! The new store_host_key() was failing in the
absence of an existing host key file. Duhh.

[originally from svn r3737]
2004-01-19 09:37:17 +00:00
Simon Tatham
0f259c23ea Various uninitialised-variable accesses picked up by valgrind.
[originally from svn r3723]
2004-01-17 14:25:36 +00:00
Simon Tatham
276c8335af Idiot me! store_host_key() was blindly _appending_ new host keys to
the end of the host key file. This is perfectly all right if a host
key never changes, but it's completely useless if you need to
replace an existing entry. This version should do better.

[originally from svn r3719]
2004-01-17 13:00:18 +00:00
Simon Tatham
2817a7e150 It's a new year.
[originally from svn r3679]
[this svn revision also touched putty-website]
2004-01-01 16:47:55 +00:00
Simon Tatham
d76a39d547 Close the host keys file after use. Well spotted Theo Markettos.
[originally from svn r3526]
2003-10-31 21:45:15 +00:00
Jacob Nevins
f2676b6ccc Remove dead comment about writing settings, and query one about reading them.
[originally from svn r3507]
2003-10-14 21:01:12 +00:00
Jacob Nevins
8e2fd15bd5 Remove all the "assert(len>0)" which forbade zero-length writes across the
from_backend() interface, after having made all implementations safe against
being called with len==0 and possibly-NULL/undefined "data".

(This includes making misc.c:bufchain_add() more robust in this area.)

Assertion was originally added 2002-03-01; e.g., see plink.c:1.53 [r1571].

I believe this now shouldn't break anything.

This should hopefully make `ppk-empty-comment' finally GO AWAY. (Tested
with Unix PuTTY.)

[originally from svn r3500]
[r1571 == fdbd697801]
2003-10-12 13:16:39 +00:00
Jacob Nevins
dbe68abfff Add pscp to .cvsignore
[originally from svn r3443]
2003-09-03 18:37:35 +00:00
Simon Tatham
f6835045f8 Include stdlib.h for exit() - thanks Colin.
[originally from svn r3436]
2003-09-02 09:52:13 +00:00
Simon Tatham
b104be3b00 Remove CRs. Oops :-/
[originally from svn r3435]
2003-09-02 09:00:35 +00:00
Jacob Nevins
4eff79612a Minimal fixes to minimal plink man page.
[originally from svn r3428]
2003-08-29 19:41:57 +00:00
Jacob Nevins
2504a53d72 Add "-s" option to Unix plink too.
Compiled, but not tested as Unix plink seems to be segfaulting today.

[originally from svn r3427]
2003-08-29 19:21:49 +00:00
Simon Tatham
d1e9569b05 ... and there's a Unix port of PSCP. Ooh.
[originally from svn r3422]
2003-08-25 14:30:59 +00:00
Simon Tatham
bfb9b28393 Windows PSCP now links against winsftp.c, and scp.c is now a
platform-independent source file. Haven't yet added the extra
abstraction routines to uxsftp.c to create a Unix PSCP port, but it
shouldn't take long.
Also in this checkin, a change of semantics in platform_default_s():
now strings returned from it are expected to be dynamically allocated.

[originally from svn r3420]
2003-08-25 13:53:41 +00:00
Simon Tatham
66fa6f320e And just to prove that psftp.c really is now platform-independent
... here's a Unix port of PSFTP. Woo. (Oddly PSCP looks to be
somewhat harder; there's more Windows code interleaved than there
was in PSFTP.)

[originally from svn r3419]
2003-08-24 13:22:17 +00:00
Simon Tatham
46f26ee483 Richard B's patch to enable users to explicitly request shadow bold
by disabling bold-font-name guessing (if their bold fonts are ugly).
I've turned the UI inside out, but the meat is pretty much the same.

[originally from svn r3410]
2003-08-21 18:39:17 +00:00
Simon Tatham
7798a59987 Richard B's patch to support X cut buffers as well as ordinary
selections, meaning that (a) a pterm can leave copied text in the
cut buffer after it terminates so that applications can pick it up
even though it isn't still around to deliver the selection in
person, and (b) pterm can pick up things left in this way by other
apps.
Downside is that all of this only happens in ISO8859-1, because X is
weird like that.

[originally from svn r3409]
2003-08-21 18:07:27 +00:00
Simon Tatham
11c9c018ec Richard Boulton's patch for improved correctness in selection
handling (generally, selection request timestamps should be set to
the timestamp on the event that caused them).

[originally from svn r3408]
2003-08-21 18:03:06 +00:00
Jacob Nevins
92db92af5a Control of 'addr' is now handed over to {platform_,}new_connection() and
sk_new() on invocation; these functions become responsible for (eventually)
freeing it. The caller must not do anything with 'addr' after it's been passed
in. (Ick.)

Why:
A SOCKS5 crash appears to have been caused by overzealous freeing of
a SockAddr (ssh.c:1.257 [r2492]), which for proxied connections is
squirreled away long-term (and this can't easily be avoided).

It would have been nice to make a copy of the SockAddr, in case the caller has
a use for it, but one of the implementations (uxnet.c) hides a "struct
addrinfo" in there, and we have no defined way to duplicate those. (None of the
current callers _do_ have a further use for the SockAddr.)

As far as I can tell, everything _except_ proxying only needs addr for the
duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it
should at least be easier to find the offending free()...

[originally from svn r3383]
[r2492 == bdd6633970]
2003-08-07 16:04:33 +00:00
Owen Dunn
10d4930b09 Implement hostkey-prompt-type everywhere except Macintosh.
[originally from svn r3307]
2003-06-26 14:19:33 +00:00
Simon Tatham
d49e6e1476 Real COMPOUND_TEXT support! I was expecting to have to read the spec
and implement the required subset of ISO-2022 in libcharset, but it
turns out that Xlib provides conversion functions between UTF-8 and
compound text, which are just about ideal for us. So now we can
paste multilingual stuff both to and from emacs21. Rock on.

[originally from svn r3193]
2003-05-13 19:57:17 +00:00
Simon Tatham
ef2ccb56cf Allow pterm to receive selections in compound text format. Doesn't
actually _understand_ compound text yet - anything with
non-ASCII-or-8859-1 characters will fail miserably - but it will at
least successfully receive plain text if the pasting application
doesn't see fit to give it out in any other format.

[originally from svn r3192]
2003-05-13 18:43:30 +00:00
Simon Tatham
99bef3d3cf Debian bug #193013 points out that the (default-)one-pixel border is
not redrawn when the window background colour is reconfigured mid-
session. In addition, the Official Window Background is not reset,
meaning that opaque resizes etc will flicker in the old background
colour. This checkin should fix both.

[originally from svn r3190]
2003-05-13 18:14:14 +00:00
Simon Tatham
f2834e065d Brief man pages for PuTTY and PuTTYtel.
[originally from svn r3188]
2003-05-11 14:32:43 +00:00
Simon Tatham
0b166ad0f8 Missing full stop.
[originally from svn r3187]
2003-05-11 14:19:57 +00:00
Simon Tatham
f36cd3a7f8 Some time ago I arranged for -geometry to be able to specify window
position as well as size. Now reflected in manpage.

[originally from svn r3186]
2003-05-11 14:19:17 +00:00
Simon Tatham
80c3a23abc I think I've just fixed Debian bug #166396. The +ut option was
causing pty_utmp_helper_pipe to be closed, but its fd was kept
around even when stale, and closed again when the main child process
terminated - by which time the fd number had been reused for a
rather more vital fd, which GTK didn't appreciate having closed
under its feet. Hence, spin on POLLNVAL. Should now be sorted.

[originally from svn r3185]
2003-05-11 12:28:53 +00:00
Simon Tatham
2715630ac1 Remove the now incorrect `Unicode is not supported' from the bugs in
the pterm man page :-)

[originally from svn r3176]
2003-05-10 10:15:36 +00:00
Simon Tatham
4b5ce3f46f pterm will now attempt to guess suitable names for any missing fonts
from the ones given; so it'll ask for a font twice as wide as your
base one if you don't specify a wide font, it'll ask for a bolded
version of your base font if you don't specify a bold font, and
similarly for a wide/bold font. Should solve Debian bug #187389; at
least it works for me.

[originally from svn r3175]
2003-05-10 10:15:00 +00:00
Simon Tatham
a2b8d10cd3 pterm's manpage now documents the NoRemoteQTitle resource. Should
fix the other half of Debian bug #191751.

[originally from svn r3174]
2003-05-10 09:06:00 +00:00
Simon Tatham
724fee3dca Stupid braino in get_window_title (thanks Colin): window and icon
titles were being reported the wrong way round. Should fix half of
Debian bug #191751.

[originally from svn r3173]
2003-05-10 09:05:41 +00:00
Simon Tatham
9a242f06ba Fixes for Debian bug #192701 (64-bit gccs warn about casts between
ptrs and ints of different size and -Werror makes this serious).
The GTK bits are done by Colin's patch to use GINT_TO_POINTER
(thanks); the uxnet bits are done by cleaning up the rest of the
code. In particular, network.h now typedefs `OSSocket' to be a type
capable of holding whatever the OS's socket data type is that
underlies our socket abstraction. Individual platforms can make this
typedef themselves if they define OSSOCKET_DEFINED to prevent
network.h redoing it; so the Unix OSSocket is now int. Default is
still void *, so other platforms should be unaffected.

[originally from svn r3171]
2003-05-10 08:35:54 +00:00
Simon Tatham
6b362191f1 Bah. Stop the Proxy panel appearing empty in Change Settings. One
day I'll make a reasonably big checkin and _not_ have six tiny mop-
up issues after it...

[originally from svn r3169]
2003-05-07 13:14:48 +00:00
Simon Tatham
8460ecd27d Yesterday's proxy enhancements also slightly nadgered the config
box, in that it started to expand under the weight of proxy options.
Now fixed, by folding the SOCKS version selector into the general
proxy type selector so there's one single 5- or 6-way radio button
set split over two lines. settings.c has of course grown a backwards
compatibility wart to deal with legacy config data.

[originally from svn r3168]
2003-05-07 12:07:23 +00:00
Simon Tatham
24d6da8041 Reinstate `-T title', in pterm only.
[originally from svn r3165]
2003-05-06 19:55:00 +00:00
Simon Tatham
03fa61025b Support, on Unix only (so far), for OpenSSH-style generic proxying
(running a local command in a pair of pipes and proxying through
that, for example `ssh proxyhost nc -q0 %host %port').

[originally from svn r3164]
2003-05-06 19:52:31 +00:00
Owen Dunn
5e36ac8d67 Update to use -title rather than -T
[originally from svn r3163]
2003-05-06 08:43:11 +00:00
Simon Tatham
6bb121ecb9 Colin's const-fixing Patch Of Death. Seems to build fine on Windows
as well as Unix, so it can go in.

[originally from svn r3162]
2003-05-04 14:18:18 +00:00
Simon Tatham
f6a208fbdd First half of `pageant-async' work. agent_query() is now passed a
callback function; it may return 0 to indicate that it doesn't have
an answer _yet_, in which case it will call the callback later on
when it does, or it may return 1 to indicate that it's got an answer
right now. The Windows agent_query() implementation is functionally
unchanged and still synchronous, but the Unix one is async (since
that one was really easy to do via uxsel). ssh.c copes cheerfully
with either return value, so other ports are at liberty to be sync
or async as they choose.

[originally from svn r3153]
2003-04-28 11:41:39 +00:00
Simon Tatham
2e2b6d89bd Add puttytel binary to .cvsignore
[originally from svn r3152]
2003-04-27 11:11:35 +00:00
Simon Tatham
082cf832c5 Support for non-ISO-8859-1 X keysyms. So in particular, pterm in a
Euro-supporting font with a Euro-enabled X key map will now actually
generate a Euro character rather than shrugging and doing nothing.

[originally from svn r3151]
2003-04-27 11:10:48 +00:00
Simon Tatham
1f5780ad9f Remove the TODO comment at the top of uxputty.c; I'm now not aware
of anything that makes the Unix port of PuTTY proper significantly
unfinished. That's quite a milestone :-)

[originally from svn r3148]
2003-04-26 14:37:49 +00:00
Simon Tatham
79426308bf Finer granularity of config box handling. SSH packet logging should
now not show up when it's meaningless (in PuTTYtel, in pterm, and
in the middle of any non-SSH session), and the Connection panel is
inhibited completely in pterm.

[originally from svn r3146]
2003-04-26 14:35:34 +00:00
Simon Tatham
3a3e4d1818 Make the `vtmode' config option work under X. In the process I've
had to move another of its values out into wincfg.c - paradoxically,
this was the `font has X encoding' option! (Because the Unix font
handling code expects to be able to tell for _itself_ whether it has
a font with X-encoded line drawing glyphs.)

[originally from svn r3145]
2003-04-26 14:22:42 +00:00
Simon Tatham
88e0914f91 Aha, _that's_ why the icon title didn't work properly in pterm:
gtk_window_set_title() overwrote both titles at once. Icon title is
now working properly under X, and since X was the reason for the
whole icon/window title separation _anyway_ they default to being
separate.

[originally from svn r3144]
2003-04-26 13:55:47 +00:00
Simon Tatham
426dc87712 Don't block SIGPIPE until _after_ pterm forks, since otherwise the
blockage will propagate to the child process.

[originally from svn r3139]
2003-04-25 15:44:01 +00:00
Simon Tatham
041dcfd83d Unix makefile now uses -O2, which massively cuts down key exchange
time. This gives rise to a whole bunch of spare warnings, one or two
of which might have been actual bugs; now all resolved.

[originally from svn r3134]
2003-04-23 13:48:09 +00:00
Simon Tatham
ec3595f7d4 Removing items from a list box using gtk_container_remove is nasty,
because when the selected item is removed the selection moves on to
another item. Thus, calling dlg_listbox_clear causes repeated
selchanges in the list, which in turn cause repeated valchanges if
the list is attached to a combo box. This has been completely
scuppering the Translation panel.

[originally from svn r3130]
2003-04-18 09:14:54 +00:00
Simon Tatham
22d8cfe36f Missed out a couple of uxsel_tell() which were hanging forwarded X
connections in at least some situations. Oops.

[originally from svn r3128]
2003-04-18 09:00:37 +00:00
Ben Harris
d66a1d685f Replace use of FIONBIO with POSIX-approved O_NONBLOCK (set using fcntl()).
This should save us having to worry about different OSs' defining it in
different headers.

[originally from svn r3126]
2003-04-16 23:58:59 +00:00
Ben Harris
e7c7f5e3f8 Make IPv6 support for Unix work, and make it a lot simpler in the process.
At the moment, we have to assume that getaddrinfo() will only return AF_INET
and AF_INET6 addresses, since we patch in the port number into the sockaddr
later.  Fixing this is probably best done by redesigning the PuTTY network
abstraction a little.

[originally from svn r3125]
2003-04-16 23:33:44 +00:00
Simon Tatham
214b306909 Support for New Session, Duplicate Session and the Saved Sessions
submenu in Unix PuTTY, and Duplicate Session also in pterm. You do
_not_ want to know how this is done. Be warned.

[originally from svn r3110]
2003-04-12 17:37:15 +00:00
Simon Tatham
eaaef4573c Further fiddlings with the size reconfiguration stuff; now
everything seems to work right even when the only thing changed was
the window border.

[originally from svn r3109]
2003-04-12 11:03:44 +00:00
Simon Tatham
a9b6ceb700 Mid-session reconfiguration of scrollback was failing (in Unix)
except when width or height had _also_ been changed. Fixed.

[originally from svn r3108]
2003-04-12 10:44:14 +00:00
Simon Tatham
56a4e967da Implement the ldisc `special' mechanism in Unix, without which local
line editing didn't work at all.

[originally from svn r3107]
2003-04-12 09:27:56 +00:00
Simon Tatham
bc4e41154a Close On Exit and Warn On Close fixes: (a) pty_reconfig needs to
remember changes in COE so it knows whether to print a message, and
(b) once the session has already ended, Warn On Close should shut up.

[originally from svn r3102]
2003-04-12 08:27:03 +00:00
Simon Tatham
c16bde1741 When I implemented the GTK messagebox() function and everything that
needed to use it, I completely forgot about askappend(). D'oh.

[originally from svn r3101]
2003-04-11 18:44:05 +00:00
Simon Tatham
d93f7113d1 Rationalisation of the system of frontend handles. Most modular bits
of PuTTY (terminal, backend, logctx etc) take a `void *' handle
passed to them from the frontend, and used as a context for all
their callbacks. Most of these point at the frontend structure
itself (on platforms where this is meaningful), except that the
handle passed to the backend has always pointed at the terminal
because from_backend() was implemented in terminal.c. This has
finally bitten Unix PuTTY, because both backend and logctx have
been passing their respective and very different frontend handles to
logevent(), so I've fixed it.
from_backend() is now a function supplied by the _frontend_ itself,
in all cases, and the frontend handle passed to backends must be the
same as that passed to everything else. What was from_backend() in
terminal.c is now called term_data(), and the typical implementation
of from_backend() in a GUI frontend will just extract the terminal
handle from the frontend structure and delegate to that.
This appears to work on Unix and Windows, but has most likely broken
the Mac build.

[originally from svn r3100]
2003-04-11 18:36:27 +00:00
Simon Tatham
8e3c37d309 Implement Warn On Close.
[originally from svn r3099]
2003-04-11 18:15:47 +00:00
Simon Tatham
ed46f3aa53 `Copy All' ought to de-highlight any existing selection, in line
with any other operation that shifts the X selection to stuff other
than the highlighted text.

[originally from svn r3098]
2003-04-11 18:10:13 +00:00
Simon Tatham
1be4188a3c `Copy All' context-menu item, for what it's worth.
[originally from svn r3097]
2003-04-11 17:59:36 +00:00
Simon Tatham
1be575d9c4 Saving of Default Settings under Unix was broken, because mungestr()
was translating NULL into "Default Settings" but not doing the same
to "". Now fixed.

[originally from svn r3096]
2003-04-11 17:42:52 +00:00
Simon Tatham
d710c84dec Cutting and pasting from the Unix Event Log.
[originally from svn r3095]
2003-04-11 17:40:52 +00:00
Simon Tatham
2e1503e520 Implemented Change Settings under Unix. We are gradually getting there.
[originally from svn r3092]
2003-04-10 18:00:50 +00:00
Simon Tatham
f03cf02cc8 All the stderr messages in this file now use appname rather than
guessing wrongly.

[originally from svn r3089]
2003-04-10 11:57:11 +00:00
Simon Tatham
406d2d8a32 Minor improvements to subsidiary window placement; with any luck the
Event Log should go off the side of the screen rather less often now.

[originally from svn r3088]
2003-04-10 08:53:43 +00:00
Simon Tatham
b49980b953 Event Log for Unix PuTTY. Doesn't yet allow X selection of its
contents, and doesn't automatically maintain scroll position at the
bottom when new entries are added while the list is open, but it's a
start.

[originally from svn r3087]
2003-04-09 18:46:45 +00:00
Simon Tatham
98a608c2e4 Rename pterm's -T option to -title, to avoid clashing with PuTTY's
-T (don't allocate a pty) option.

[originally from svn r3079]
2003-04-08 14:02:34 +00:00
Simon Tatham
fe666b2432 While writing gtkdlg.c I learned how to specify a window's initial
position in GTK, so I can now implement the other half of -geometry
which I'd previously believed to be impossible in GTK. It's still
not perfect, because GTK apparently provides no way for us to get
hold of the X reparent event in order to support negative geometries
in a manner which takes account of the WM borders; but for positive
position it's at least an improvement on the previous version!

[originally from svn r3078]
2003-04-08 13:49:12 +00:00
Simon Tatham
b0ee81ab32 Now that we have `appname', make much wider use of it. In
particular, the config box uses it in place of the word `PuTTY',
which means mid-session reconfig in pterm will look less strange
once I implement it. Also, while I'm at it, I've personalised all
the dialog boxes and menu items and suchlike so that PuTTYtel
actually claims to be PuTTYtel rather than PuTTY.

[originally from svn r3074]
2003-04-06 14:11:33 +00:00
Simon Tatham
cf08c5a64a Fixed the printing and charset combo boxes in Unix PuTTY. (The
former by simply removing it; the latter by adding an enumeration
function to libcharset.) This has had slight `const' repercussions
on cp_name() and cp_enumerate() which might break the Mac build.

[originally from svn r3064]
2003-04-05 16:36:11 +00:00
Simon Tatham
09c9f31289 Unix can't sensibly enumerate printers (since they're defined as
being lpr commands), so the Unix config box now replaces the printer
combo box with an ordinary edit box.

[originally from svn r3063]
2003-04-05 16:12:52 +00:00
Simon Tatham
30497ff683 Ctrl+rightclick now pops up a context menu in Unix PuTTY and pterm.
This menu is not yet fully populated, but it has an About box (yet
another licence location :-/ ) and supports the new configurable
specials menu (thus making Unix PuTTY do one tiny thing which
OpenSSH-in-a-pterm can't :-).

[originally from svn r3062]
2003-04-05 16:05:00 +00:00
Simon Tatham
8a3ff2bf3e Dynamic port forwarding by means of a local SOCKS server. Fully
supports SOCKS 4, SOCKS 4A and SOCKS 5 (well, actually IPv6 in SOCKS
5 isn't supported, but it'll be no difficulty once I actually get
round to it). Thanks to Chas Honton for his `stone soup' patch: I
didn't end up actually using any of his code, but it galvanised me
into doing it properly myself :-)

[originally from svn r3055]
2003-04-05 11:45:21 +00:00
Simon Tatham
3bd0415579 Turned the old `Telnet Command' System-submenu into a more general
`Special Command' menu, in which any backend can place its own list
of magical things the user might want to ask the backend to do. In
particular I've implemented the recently proposed "break" extension
in SSH2 using this mechanism.
NB this checkin slightly breaks the Mac build, since it needs to
provide at least a stub form of update_specials_menu().

[originally from svn r3054]
2003-04-04 20:21:05 +00:00
Simon Tatham
a05d4fdbd0 Further .cvsignore updates.
[originally from svn r3044]
2003-04-02 09:14:38 +00:00
Simon Tatham
6504c5c894 Improvements to .cvsignore, to attempt to reduce the huge number of
? lines I see when running `cvs update', which in turn might help
deal with my tendency to forget to `cvs add' new files before a big
checkin :-)

[originally from svn r3042]
2003-04-02 08:44:05 +00:00
Simon Tatham
7706da5e17 Various error-handling fixes, mostly in Unix PuTTY but one (failure
to save a session) crosses over into the platform-independent side.

[originally from svn r3041]
2003-04-01 18:10:25 +00:00
Simon Tatham
ec6d5edb62 Trivial segfault fix from Richard B.
[originally from svn r3036]
2003-03-31 12:57:36 +00:00
Simon Tatham
2487fdd9b4 Ahem; update the TODO to reflect the cmdline changes :-)
[originally from svn r3035]
2003-03-31 12:11:21 +00:00
Simon Tatham
62844b4590 Support for PuTTY-style command-line arguments in Unix PuTTY. I
think it's now actually usable as a day-to-day SSH client, even if
things like the Event Log are still missing. So I call that a decent
lunch hour's work :-)

[originally from svn r3034]
2003-03-31 12:10:53 +00:00
Simon Tatham
3a41ec782e And everyone's favourite cosmetic change: Unix PuTTY now doesn't
claim to be pterm in the window title :-)

[originally from svn r3032]
2003-03-31 11:42:45 +00:00
Simon Tatham
0ec4f0620d Can now save and load settings under Unix.
[originally from svn r3031]
2003-03-31 11:36:14 +00:00
Simon Tatham
a7e6d60915 Fix a _very_ subtle segfault in my two GTK container classes: the
`forall' function has to be prepared for the list of widgets to
change along the way if (for example) the callback function destroys
its input widget.

[originally from svn r3029]
2003-03-31 11:22:06 +00:00
Simon Tatham
823f52c540 Checkin of last night's work on GTK message boxes. Unix PuTTY now
has proper GUI prompts for host keys etc, so it should now be usable
without a controlling tty.

[originally from svn r3028]
2003-03-31 11:21:07 +00:00
Simon Tatham
a3428ae953 Having created and used uxsel, it actually turns out to be
practically trivial to put all the pieces together and create a
working prototype of Unix PuTTY! It's missing a lot of things -
notably GUI request boxes for host keys and logfiles and so forth,
the Event Log, mid-session reconfiguration, session loading and
saving, sensible population of the character sets drop-down list and
probably other fiddly little things too - but it will put up a
config box and then create a GUI window containing an SSH connection
to the host you specified, so it's _basically_ there. Woo!

[originally from svn r3020]
2003-03-29 19:52:50 +00:00
Simon Tatham
5107780c54 pterm now uses the new uxsel module, so it's one step closer to
being able to be a PuTTY as well as a pterm. In the process I've
also moved icky things like actually reading from the pty fd and
printing the `terminated on signal' messages into pty.c where they
obviously should have been in the first place. Also there's been one
interesting repercussion in the terminal code: terminal.c's
from_backend now calls term_out() directly rather than expecting the
front end to call it afterwards. This has had the entertaining side
effect of fixing a Windows-specific bug whereby activity in a port
forwarding through a PuTTY with a blinking cursor caused the cursor
to blink to ON (!!!!). So, a surprisingly far-reaching checkin as it
turns out...

[originally from svn r3017]
2003-03-29 18:30:14 +00:00
Simon Tatham
b109918032 Added uxsel.c, into which I've moved those parts of the uxnet.c
functionality that deal with selectable fds in general. The idea is
that pty.c will stop passing its fd straight to pterm.c and hand it
to this module instead, and pterm.c will start requesting a general
list of fds from this module rather than expecting a single one from
pty.c, with the ultimate aim of pterm.c being able to form the basis
of a Unix PuTTY as well as pterm proper.

[originally from svn r3015]
2003-03-29 16:47:06 +00:00
Simon Tatham
d36a4c3685 Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're
allocating the size of. Should prevent any future errors involving
mallocing the size of the wrong structure type, and will also make
life easier if we ever need to turn the PuTTY core code from real C
into C++-friendly C. I haven't touched the Mac frontend in this
checkin because I couldn't compile or test it.

[originally from svn r3014]
2003-03-29 16:14:26 +00:00
Ben Harris
c8c17d2cef Rename dlg_listbox_addwithindex() to dlg_listbox_addwithid(), since the old
name was, not to put too fine a point on it, wrong.

[originally from svn r2997]
2003-03-25 23:45:56 +00:00
Simon Tatham
c42085dc89 Various cosmetic fixes to the GTK config box: vertical alignment of
edit box labels, Left/Right on the treeview to collapse and expand
branches, a window title, and the best treatment of wrapping text
widgets I could think of within the product-order-oriented GTK
layout model. I think this thing is now pretty much as good as it's
going to get before GTK v2 (which should fix one or two remaining
minor nasties which I really couldn't be bothered to work around in
GTK 1.2), so the next step is to actually start _using_ it.

[originally from svn r2979]
2003-03-22 17:00:06 +00:00
Simon Tatham
3100306c90 Better appearance and positioning for dlg_error_msg box, and also
I've just found out that it's easy to ask for the config box to be
centred on the screen by default, which is kinda cool.

[originally from svn r2962]
2003-03-18 19:47:28 +00:00
Simon Tatham
4d41247cde Big sprawling dialog-box commit covering all sorts of things.
Buttons now have an `iscancel' flag to go with `isdefault';
dlg_last_focused() now explicitly passes the control it _doesn't_
care about (`I want the last control that had focus and isn't this
one'); and in the GTK implementation, various fixes have happened,
notably including arrow keys working sensibly in list boxes and the
treeview and short font aliases being expanded correctly to
initialise the font selectors.

[originally from svn r2958]
2003-03-18 19:06:51 +00:00
Simon Tatham
f9f695b72a Further work on the GTK config box; mostly implemented keyboard
shortcuts now (only treeviews and list boxes to go, which currently
do very weird things and I need to overhaul them completely).

[originally from svn r2944]
2003-03-16 12:37:48 +00:00
Simon Tatham
b4e7ec8b12 Fixed accelerator clash in the Unix-specific config, since gtkdlg.c
is now competent to detect them :-)

[originally from svn r2943]
2003-03-16 12:36:33 +00:00
Simon Tatham
d681abb508 When a piece of text overflows its column in a tabbed list box, I
think on balance I rather like the natural behaviour of the way I've
done it, except that non-zero separation between the columns would
be even nicer. Accordingly, here is some.

[originally from svn r2940]
2003-03-15 15:56:51 +00:00
Simon Tatham
6a67fdc0cc Event handling in the GTK dialog engine is now basically present and
correct. All the callbacks are getting called, all the dialog
actions are working (the port forwarding, colour and charclass
configurers are all completely functional), file, font and colour
selectors happen, and it's all looking pretty cool.

[originally from svn r2938]
2003-03-15 15:50:42 +00:00
Simon Tatham
fca92a5b43 Continuing work on the GTK config box. Created uxcfg.c for the
Unix-specific config items; moved a stray Windows-specific config
item (scrollbar-in-fullscreen) out into wincfg.c to stop it
appearing on Unix; continued updates to gtkdlg.c. I now believe the
GTK config box looks basically correct (modulo minor cosmetic issues
and keyboard accelerators). Next step, add the event handling so
it's actually functional.

[originally from svn r2933]
2003-03-14 18:35:01 +00:00
Simon Tatham
df85003ea5 First stab at a GTK layout engine. It's missing all sorts of stuff
(list boxes are particularly conspicuously absent), it has no event
handling at all, and it isn't in any way integrated into pterm - you
have to build it specially using the test stubs in gtkdlg.c. But
what there is so far seems to work plausibly well, so it's a start.
Rather than browbeat the existing GTK container/layout widgets into
doing what I wanted, I decided to implement two subclasses of
GtkContainer myself, which implement precisely the layout model
assumed by the config box specification; this has the rather cool
consequence that the box can be resized and will maintain the same
layout at all times that it would have had if initially created at
that size.

[originally from svn r2931]
2003-03-13 19:52:28 +00:00
Simon Tatham
73203bce79 Never pass a `char' to a ctype function. I had relied on gcc -Wall
letting me know about instances of this, but it turns out that my
ctype.h explicitly casts input values to `int' to evade the
`subscript has type char' warning, so it had been carefully not
letting me know! Found them all by compiling with a doctored
ctype.h, and hopefully fixed them all too.

[originally from svn r2927]
2003-03-11 09:30:31 +00:00
Simon Tatham
6f693ffeb0 Reorganisation of misc.c: Minefield has moved out to winmisc.c, and
so has the Windows dputs() - which has also acquired a Unix
counterpart in uxmisc.c. -DDEBUG should now work on Unix.

[originally from svn r2914]
2003-03-06 13:24:02 +00:00
Simon Tatham
83da92826e Richard B's patch to add WINDOWID support to pterm.
[originally from svn r2912]
2003-03-06 12:57:37 +00:00
Simon Tatham
bd16b29a7a Oops, Ben is quite right about the rather appalling design of
filename_from_str. Here's a better fix, with some const
repercussions too.

[originally from svn r2768]
2003-02-01 17:24:27 +00:00
Simon Tatham
f26b7aa0d3 Created new data types Filename' and FontSpec', intended to be
opaque to all platform-independent modules and only handled within
per-platform code. `Filename' is there because the Mac has a magic
way to store filenames (though currently this checkin doesn't
support it!); `FontSpec' is there so that all the auxiliary stuff
such as font height and charset and so on which is needed under
Windows but not Unix can be kept where it belongs, and so that I can
have a hope in hell of dealing with a font chooser in the forthcoming
cross-platform config box code, and best of all it gets the horrid
font height wart out of settings.c and into the Windows code where
it should be.
The Mac part of this checkin is a bunch of random guesses which will
probably not quite compile, but which look roughly right to me.
Sorry if I screwed it up, Ben :-)

[originally from svn r2765]
2003-02-01 12:54:40 +00:00
Simon Tatham
52882fa006 And another bit missing from the settings changes: pterm's platform
default for CloseOnExit was encoded wrongly. Hopefully this should
be everything now; I'm really starting to get sick of picking up the
pieces after my two checkins yesterday. Perhaps I should have waited
until I had a brain before doing them in the first place.

[originally from svn r2746]
2003-01-28 12:06:37 +00:00
Simon Tatham
c370336a92 xterm apparently supports ESC[90m through ESC[97m to set bright
foreground colours, and ESC[100m through ESC[107m to set bright
background colours. Hence, so do we. Bright-foreground is
distinguishable from bold, and bright-background distinguishable
from blink, when it leaves terminal.c; the front end may then choose
to display them in the same way if it's configured to do so. This
change makes the xterm backend for Turbo Vision (!!!) work properly.
Untested on Mac.

[originally from svn r2734]
2003-01-27 23:03:31 +00:00
Simon Tatham
6aa4211f6e Remove all `enum'-typed variables from the Config structure.
Everything in there which is integral is now an actual int, which
means my forthcoming revamp of the config box will be able to work
with `int *' pointers without fear of doom.

[originally from svn r2733]
2003-01-27 18:02:24 +00:00
Simon Tatham
063469571a Fix Unix breakage from term_mouse() revamp too.
[originally from svn r2723]
2003-01-25 16:23:48 +00:00
Ben Harris
af4be2e83e Change the term_mouse interface a little so that it gets passed
both the raw and the cooked mouse button, with the mapping being done in
advance by the front-end.  This is useful because it allows the front-end to
use information other than the raw button (e.g. the modifier state) to decide
which cooked button to generate.
.
Front ends other than the Mac one are untested, but they just call
translate_button() themselves and pass the result to term_mouse().

[originally from svn r2721]
2003-01-25 16:16:45 +00:00
Ben Harris
81ada5f24f Add a stub "free" routine for pterm. Thanks to rjk.
[originally from svn r2666]
2003-01-20 20:10:07 +00:00
Simon Tatham
f6cc852c5d Miscellaneous fixes to finish up `remove-statics'. rlogin.c had a
holdout static I hadn't noticed; unicode.c had one too; and a large
number of statics that were perfectly OK due to being constants have
been made `const', with assorted `const' repercussions all over the
place. I now declare `remove-statics' to be fixed.

[originally from svn r2594]
2003-01-14 18:43:45 +00:00
Simon Tatham
b2374a64fd Deglobalise the Unicode module. Despite all my grand plans, I've
just done this the very simple way - bundle all the globals into a
data structure and pass pointers around. One particularly ugly wart
is that wc_to_mb now takes a pointer to this structure as an
argument (optional, may be NULL, and unused in any Unicode layer
that's even marginally less of a mess than the Windows one). I do
need to do this properly at some point, but for now this should just
about be adequate. As usual, the Mac port has not been updated.

[originally from svn r2592]
2003-01-14 18:28:23 +00:00
Owen Dunn
5c7bc54022 Ctrl-PgUp and Ctrl-PgDn now scroll by one line on Unix and Windows
[originally from svn r2582]
2003-01-14 11:24:26 +00:00
Simon Tatham
4ec4de4f8b Ahem. Doing loads of stuff to inst->cfg would probably be best done
_after_ allocating inst. Oops.

[originally from svn r2571]
2003-01-12 15:45:29 +00:00
Simon Tatham
d119b784f8 Ahem. Global replace of cfg' with inst->cfg' is all very well, but
let's try to make sure it doesn't happen inside any strings! The
-cfg option for cursor foreground colour nearly had a nasty accident
there.

[originally from svn r2569]
2003-01-12 15:36:05 +00:00
Simon Tatham
6af1a9e4e9 Having laid all the groundwork, we can now remove the global `cfg'
completely from putty.h. It's now static in each of the command-line
front ends, shared only between window.c and windlg.c in PuTTY
proper (I've tested this by doing #define cfg cfgsillyname in those
two files only, and it still links so nobody else is using that
symbol!), and part of the `inst' structure in pterm. I think that
only leaves the Unicode module as the last stubborn holdout in the
anti-global-variables campaign.

[originally from svn r2568]
2003-01-12 15:32:31 +00:00
Simon Tatham
952857fca3 proxy.c now no longer refers to `cfg'. Instead, each of the three
proxy-indirection network functions (name_lookup, new_connection,
new_listener) takes a `const Config *' as an argument, and extracts
enough information from it before returning to handle that
particular network operation in accordance with the proxy settings
it specifies. This involved {win,ux}net.c due to a `const'
repercussion.

[originally from svn r2567]
2003-01-12 15:26:10 +00:00
Simon Tatham
2d469ba497 The logging module now contains a local copy of cfg too.
[originally from svn r2566]
2003-01-12 15:10:27 +00:00
Simon Tatham
ac2367bc72 The Unicode module no longer depends on `cfg', since it gets the
relevant bits of it passed in to init_ucs(). (Actually I pass in all
of it in the Windows version, since it's a bit hairy in there.)

[originally from svn r2565]
2003-01-12 14:59:54 +00:00
Simon Tatham
6a2c0436de printer_start_job shouldn't need to refer to cfg.printer, since it's
getting the printer name passed in anyway! Oops.

[originally from svn r2563]
2003-01-12 14:50:34 +00:00
Simon Tatham
520f716dec Just like under Windows, cleanup_exit() shouldn't need to check
before calling random_save_seed().

[originally from svn r2562]
2003-01-12 14:49:44 +00:00
Simon Tatham
f49c8c5a07 The back ends now contain their own copies of the Config structure,
and have a function to pass in a new one. (Well, actually several
back ends don't actually bother to do this because they need nothing
out of Config after the initial setup phase, but they could if they
wanted to.)

[originally from svn r2561]
2003-01-12 14:48:29 +00:00
Simon Tatham
f35cbdce44 Forgot to match the cmdline changes in the Unix port.
[originally from svn r2558]
2003-01-12 14:37:26 +00:00
Simon Tatham
1b5cb7adf6 Each platform's implementation of askappend() is no longer required
to consult cfg.logxfovr, because it gets done once in logging.c.
askappend() is now called only when a question _really_ needs to be
asked of the user. Also in this checkin, cleanup_exit() in console.c
no longer consults cfg.protocol to decide whether to save the random
seed, because random_save_seed() can make that decision for itself
and do it better.

[originally from svn r2552]
2003-01-12 13:44:35 +00:00
Simon Tatham
fda9983243 Hack around an oddity in X display names and xauth.
[originally from svn r2538]
2003-01-11 09:46:50 +00:00
Simon Tatham
87f9446a26 Support XDM-AUTHORIZATION-1 for connecting to local X servers. If
we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...

[originally from svn r2537]
2003-01-11 09:31:54 +00:00
Simon Tatham
86977efa81 Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)

[originally from svn r2536]
2003-01-10 18:33:35 +00:00