]> asedeno.scripts.mit.edu Git - PuTTY.git/log
PuTTY.git
15 years agoChange how we handle the Ssh_gss_buf type. Previously, we defined it
Ben Harris [Mon, 24 Nov 2008 23:44:55 +0000 (23:44 +0000)]
Change how we handle the Ssh_gss_buf type.  Previously, we defined it
ourselves, but on Unix then assumed it was compatible with the system's
gss_buffer_desc, which wasn't the case on LP64 systems.  Now, on Unix
we make Ssh_gss_buf into an alias for gss_buffer_desc, though we keep
something similar to the existing behaviour on Windows.  This requires
renaming a couple of the fields in Ssh_gss_buf, and hence fixing all
the references.

Tested on Linux (MIT Kerberos) and Solaris.  Compiled on NetBSD (Heimdal).
Not tested on Windows because neither mingw32 nor winegcc worked out of the
box for me.  I think the Windows changes are all syntactic, though, so
if this compiles it should work no worse than before.

[originally from svn r8326]

15 years agoTreat lines starting with '#' as comments in PSFTP.
Jacob Nevins [Mon, 24 Nov 2008 18:19:55 +0000 (18:19 +0000)]
Treat lines starting with '#' as comments in PSFTP.

[originally from svn r8325]

15 years agoNew option to allow use of the local OS username for login to the remote side
Jacob Nevins [Mon, 24 Nov 2008 17:51:42 +0000 (17:51 +0000)]
New option to allow use of the local OS username for login to the remote side
if we have no better ideas, with UI shamelessly stolen from Quest PuTTY.

Off by default, which effectively reverts the change to using the local
username by default that came in with GSSAPI support in r8138. Anyone wanting
seamless single sign-on will need to set the new option. (The previous
default behaviour was getting in the way in ad-hoc scenarios.)

Note that the PSCP and Unix-Plink behaviour of using the local username by
default have remained unchanged throughout; they are not affected by the new
option. Not sure if that's the Right Thing.

[originally from svn r8324]
[r8138 == de5dd9d65c0e2ffa9bc9cab038bf0be77efbf820]

15 years agoMake key file import robust against a PPK file that has somehow lost its
Jacob Nevins [Sun, 23 Nov 2008 20:11:12 +0000 (20:11 +0000)]
Make key file import robust against a PPK file that has somehow lost its
final newline. From Debian bug #414784, based on a patch by Justin Pryzby.

[originally from svn r8323]

15 years agoAutoconfiscate GSS-API support, including support for manually disabling it.
Ben Harris [Sat, 22 Nov 2008 22:49:27 +0000 (22:49 +0000)]
Autoconfiscate GSS-API support, including support for manually disabling it.

[originally from svn r8318]

15 years agoChanges to make this compile on Solaris 9: use <gssapi/gssapi.h> rather
Ben Harris [Sat, 22 Nov 2008 22:06:42 +0000 (22:06 +0000)]
Changes to make this compile on Solaris 9: use <gssapi/gssapi.h> rather
than <gssapi/gssapi_krb5.h> and provide the OID for Kerberos 5 ourselves
(since it's a known constant).  I'm not sure this actually works on Solaris
yet, mind.

[originally from svn r8317]

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

[originally from svn r8305]

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

[originally from svn r8304]

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

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

[originally from svn r8295]

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

[originally from svn r8294]

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

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

[originally from svn r8293]

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

[originally from svn r8210]

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

[originally from svn r8209]

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

[originally from svn r8208]

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

[originally from svn r8204]
[r7934 == 087adb167e9e25a09839ca802707c11565468e11]

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

[originally from svn r8202]

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

[originally from svn r8201]

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

[originally from svn r8194]

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

[originally from svn r8193]

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

[originally from svn r8185]

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

[originally from svn r8184]

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

[originally from svn r8183]

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

[originally from svn r8182]

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

[originally from svn r8172]

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

[originally from svn r8159]
[r8138 == de5dd9d65c0e2ffa9bc9cab038bf0be77efbf820]

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

[originally from svn r8158]

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

[originally from svn r8157]

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

[originally from svn r8156]

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

[originally from svn r8150]
[this svn revision also touched putty-wishlist]

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

[originally from svn r8142]

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

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

[originally from svn r8139]
[this svn revision also touched putty-website]

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

[originally from svn r8138]

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

[originally from svn r8121]
[this svn revision also touched putty-website,putty-wishlist]

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

[originally from svn r8120]
[this svn revision also touched putty-wishlist]

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

[originally from svn r8119]

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

[originally from svn r8117]
[r8110 == e01df1da9f41aa7554e99708c117241c59fcef3d]

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

[originally from svn r8110]

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

[originally from svn r8109]

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

[originally from svn r8097]

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

[originally from svn r8075]

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

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

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

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

[originally from svn r8074]

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

[originally from svn r8069]

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

[originally from svn r8063]

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

[originally from svn r8059]

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

[originally from svn r8058]

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

[originally from svn r8045]

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

[originally from svn r8037]

16 years agoMerged from trunk up to r8033.
Simon Tatham [Sun, 1 Jun 2008 11:19:06 +0000 (11:19 +0000)]
Merged from trunk up to r8033.

[originally from svn r8034]
[r8033 == e81a8cf795825bc133678d33c4e2ca4585edf811]

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

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

[originally from svn r8033]

16 years agoRe-jig the combo box handling ifdefs so that we can compile with GTK
Simon Tatham [Sat, 31 May 2008 19:23:45 +0000 (19:23 +0000)]
Re-jig the combo box handling ifdefs so that we can compile with GTK
versions >= 2.0 (when the new list boxes came in) but < 2.4 (when
the new combo boxes came in). Since some combo boxes are handled
using the old list-box code, this means that the two lots of code
can both be compiled in at once in some situations!

[originally from svn r8031]

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

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

[originally from svn r8030]

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

[originally from svn r8029]

16 years agoOn some systems, strncpy is a macro, and putting preprocessor
Simon Tatham [Sat, 31 May 2008 13:29:32 +0000 (13:29 +0000)]
On some systems, strncpy is a macro, and putting preprocessor
directives in the middle of a macro invocation appears to be frowned
on. Irritating, but there we go.

[originally from svn r8026]

16 years agoMerge from trunk up to r8020.
Simon Tatham [Wed, 28 May 2008 19:28:17 +0000 (19:28 +0000)]
Merge from trunk up to r8020.

[originally from svn r8021]
[r8020 == 14d825d42fb4d36f671ea4d05c6d254f7796c7e5]

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

[originally from svn r8020]

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

[originally from svn r8004]

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

[originally from svn r7993]

16 years agoOops; prevent further segfault during setup, which apparently only
Simon Tatham [Mon, 14 Apr 2008 18:00:57 +0000 (18:00 +0000)]
Oops; prevent further segfault during setup, which apparently only
show up when building without debugging...

[originally from svn r7991]

16 years agoPrevent assertion failure in the case where the user manipulates the
Simon Tatham [Mon, 14 Apr 2008 17:57:45 +0000 (17:57 +0000)]
Prevent assertion failure in the case where the user manipulates the
filter checkboxes to filter the currently selected font out of the
family list and then does something in one of the other list boxes
or the size edit box.

[originally from svn r7990]

16 years agoJust noticed that selecting "client:Bitstream Vera Sans Mono 10" in
Simon Tatham [Sun, 13 Apr 2008 07:48:10 +0000 (07:48 +0000)]
Just noticed that selecting "client:Bitstream Vera Sans Mono 10" in
the font config box and then invoking the unifontsel causes the box
to come up empty rather than populated with that font. Turns out
that I completely forgot to have pangofont_canonify_fontname()
return the flags word, ahem.

[originally from svn r7988]

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

[originally from svn r7984]

16 years agoIn the new unified font handling, my strategy so far for combining
Simon Tatham [Sat, 5 Apr 2008 13:37:20 +0000 (13:37 +0000)]
In the new unified font handling, my strategy so far for combining
client- and server-side fonts into a single namespace was mainly to
hope there would naturally be no collisions, and to provide
disambiguating "client:" and "server:" prefixes for manual use in
emergencies.

Jacob points out, however, that his system not only has a namespace
clash but worse still the clash is at the name "fixed", which is our
default font! So, modify my namespace policy to use the
disambiguating prefixes everywhere by default, and use _unprefixed_
names only if the user types one in by hand.

In particular, I've changed the keys used to store font names in
Unix saved session files. Font names read from the new keys will be
passed straight to the new unifont framework; font names read from
the old keys will have "server:" prepended. So any existing
configuration file for GTK1 PuTTY should now work reliably in GTK2
PuTTY and select the same font, even if that font is one on which
your system (rather, your client+server combination) has a font
namespace clash.

[originally from svn r7973]

16 years agoEnsure the new `depth' and `treepath' structure fields in struct
Simon Tatham [Sat, 5 Apr 2008 12:53:32 +0000 (12:53 +0000)]
Ensure the new `depth' and `treepath' structure fields in struct
selparam are always properly initialised.

[originally from svn r7972]

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

[originally from svn r7970]

16 years agogtk_combo_box_get_active_text didn't appear until GTK 2.6; bodge
Simon Tatham [Fri, 4 Apr 2008 12:23:29 +0000 (12:23 +0000)]
gtk_combo_box_get_active_text didn't appear until GTK 2.6; bodge
around it for earlier versions of GTK 2.

[originally from svn r7969]

16 years agoFix the jarring change of window size on expanding the SSH branch of
Simon Tatham [Fri, 4 Apr 2008 11:37:06 +0000 (11:37 +0000)]
Fix the jarring change of window size on expanding the SSH branch of
the configuration tree.

[originally from svn r7968]

16 years agoI apparently missed out a piece of code when doing the new GTK2 list
Simon Tatham [Fri, 4 Apr 2008 11:02:26 +0000 (11:02 +0000)]
I apparently missed out a piece of code when doing the new GTK2 list
box: shortcut activations for list boxes are missing.

That's the last thing on the to-do list. We're now ready to merge
back to the trunk, given only some final testing!

[originally from svn r7967]

16 years agoReinstate all the GTK1-specific code under ifdefs, and verify that
Simon Tatham [Fri, 4 Apr 2008 10:56:26 +0000 (10:56 +0000)]
Reinstate all the GTK1-specific code under ifdefs, and verify that
we can now build and run successfully using both GTK1 and GTK2 by
giving appropriate options to make. (Specifically, to override the
default of GTK2 in favour of GTK1, "make GTK_CONFIG=gtk-config".)

[originally from svn r7966]

16 years agoRename a structure field to avoid clashing with one of the old GTK1
Simon Tatham [Fri, 4 Apr 2008 10:16:24 +0000 (10:16 +0000)]
Rename a structure field to avoid clashing with one of the old GTK1
ones. (I'm going to merge the GTK1 list code back in under ifdefs,
and I want none of the disputed structure fields to have the same
names, so that I'll reliably be told by the compiler if I keep the
wrong piece of code outside the ifdef.)

[originally from svn r7965]

16 years agoUpdate autoconf for GTK 2. We now check for both GTK2 and GTK1, and
Simon Tatham [Wed, 2 Apr 2008 17:32:17 +0000 (17:32 +0000)]
Update autoconf for GTK 2. We now check for both GTK2 and GTK1, and
in the presence of GTK 2 we also check to see whether we have a
prehistoric Pango (since Pango itself helpfully doesn't provide that
functionality, bah).

[originally from svn r7964]

16 years agoIt's nice to be able to run mkauto.sh from inside the unix subdir as
Simon Tatham [Wed, 2 Apr 2008 17:09:53 +0000 (17:09 +0000)]
It's nice to be able to run mkauto.sh from inside the unix subdir as
well as from outside.

[originally from svn r7963]

16 years agoAnother tedious chore off the to-do list. I've just checked over my
Simon Tatham [Wed, 2 Apr 2008 17:04:21 +0000 (17:04 +0000)]
Another tedious chore off the to-do list. I've just checked over my
custom Columns layout class to see what fiddly details of
GTK2isation were yet to be done. It turns out that all the basic
object management got moved out of GTK into a separate library, so
that all the gtk_object_* calls are deprecated and g_object_* should
be used instead; having done that, though, it all looks perfectly
fine.

[originally from svn r7962]

16 years agoTODO update: I don't think it's worth switching to GTK2's native
Simon Tatham [Wed, 2 Apr 2008 16:26:01 +0000 (16:26 +0000)]
TODO update: I don't think it's worth switching to GTK2's native
shortcut mechanism. The existing code doesn't use any deprecated
calls, and translating shortcut text _into_ Pango markup just sounds
too unpleasant to do if I don't actually have to. Not to mention
that the documentation for the Pango markup language doesn't tell me
how to distinguish a mnemonic underscore prefix from a literal
underscore in label text, but I know my current code can get that
right (the current config box talks about TCP_NODELAY and
SO_KEEPALIVE in widget labels that also have functioning shortcuts).

[originally from svn r7961]

16 years agoEnable the display of server-side font aliases by default in my font
Simon Tatham [Wed, 2 Apr 2008 14:50:47 +0000 (14:50 +0000)]
Enable the display of server-side font aliases by default in my font
selector. I had previously been worried that the default of not
showing aliases interacted badly with the default actual font
_being_ specified as an alias. One of those defaults had to change,
and I've decided which: `fixed' is staying as Unix PuTTY's default
font in defiance of GTK2's vigorous encouragement of Pango.

[originally from svn r7960]

16 years agoUpdate all the list box code in gtkdlg.c to use the new-style GTK2
Simon Tatham [Wed, 2 Apr 2008 14:48:06 +0000 (14:48 +0000)]
Update all the list box code in gtkdlg.c to use the new-style GTK2
GtkTreeView, GtkComboBox and GtkComboBoxEntry instead of the various
old deprecated stuff. Immediate benefit: GTK2 natively supports real
drag lists, hooray!

[originally from svn r7959]

16 years agoExplicit casts to placate OS X gcc's pedantic type-check warnings.
Simon Tatham [Mon, 31 Mar 2008 10:47:48 +0000 (10:47 +0000)]
Explicit casts to placate OS X gcc's pedantic type-check warnings.

[originally from svn r7958]

16 years agoI give up. I can't work out what the purpose of the call to
Simon Tatham [Sat, 29 Mar 2008 20:02:12 +0000 (20:02 +0000)]
I give up. I can't work out what the purpose of the call to
gtk_container_dequeue_resize_handler in request_resize() was;
everything seems to work fine without it. So I'm removing the
nonportable GTK 2 instance of it, and if anything ever goes wrong as
a result then I'll at least find out what the problem was.

[originally from svn r7957]

16 years agoBe more picky than Pango when validating a Pango font description
Simon Tatham [Sat, 29 Mar 2008 15:44:32 +0000 (15:44 +0000)]
Be more picky than Pango when validating a Pango font description
string. Without this, Richard B reports that Pango 1.18 will treat
_anything_ as valid, which means PuTTY can never fall back to X
fonts.

[originally from svn r7956]

16 years agoTODO updates.
Simon Tatham [Sat, 29 Mar 2008 14:57:56 +0000 (14:57 +0000)]
TODO updates.

[originally from svn r7955]

16 years agoAha, _that's_ why there was some unexplained space on the RHS of the
Simon Tatham [Sat, 29 Mar 2008 14:54:55 +0000 (14:54 +0000)]
Aha, _that's_ why there was some unexplained space on the RHS of the
font selector: I had got the row and column counts in
gtk_table_new() back to front, so the space on the right was the
padding around five empty table columns! (And apparently a GtkTable
silently expands if you try to use rows that don't exist, which is
why I hadn't already noticed.)

Fixed that, and added some padding around the entire table. I think
my font selector is now finished, except for any bug fixes that come
up in testing.

[originally from svn r7954]

16 years agoDeal with the possibility of no valid font being selected at all
Simon Tatham [Sat, 29 Mar 2008 14:21:25 +0000 (14:21 +0000)]
Deal with the possibility of no valid font being selected at all
during an entire run of unifontsel (because unifontsel_set_name was
either not called at all, or called with a name that didn't
correspond to any known font). In this situation we grey out the OK
button until a valid font is selected, and we have
unifontsel_get_name return NULL rather than failing an assertion if
it should be called in that state. The current client code in
gtkdlg.c should never encounter a NULL return, since it only calls
it after the OK button is clicked, but I've stuck an assertion in
there too on general principles.

[originally from svn r7953]

16 years agoPrevent NULL-dereferencing segfaults when the font selector is
Simon Tatham [Sat, 29 Mar 2008 13:59:31 +0000 (13:59 +0000)]
Prevent NULL-dereferencing segfaults when the font selector is
invoked with no valid font in the input text.

[originally from svn r7952]

16 years agoRichard B points out another thing for the overall GTK2 to-do list.
Simon Tatham [Sat, 29 Mar 2008 13:55:51 +0000 (13:55 +0000)]
Richard B points out another thing for the overall GTK2 to-do list.

[originally from svn r7951]

16 years agoCosmetic polishing.
Simon Tatham [Sat, 29 Mar 2008 13:55:40 +0000 (13:55 +0000)]
Cosmetic polishing.

[originally from svn r7950]

16 years agoDetect non-monospaced X fonts, and respond by drawing text one
Simon Tatham [Sat, 29 Mar 2008 10:48:16 +0000 (10:48 +0000)]
Detect non-monospaced X fonts, and respond by drawing text one
character at a time centred in its character cell, as we do for
Pango. Gives much better results for those non-monospaced fonts
which are usable as terminal fonts, and shows up the problems with
the others more readily. (In particular, this means the preview pane
in the font selector now warns you there will be trouble if you
select such a font.)

[originally from svn r7949]

16 years agoAdd the rest of ASCII to the font preview window.
Simon Tatham [Sat, 29 Mar 2008 10:25:45 +0000 (10:25 +0000)]
Add the rest of ASCII to the font preview window.

[originally from svn r7948]

16 years agoWhen the user switches between fonts using the font family or style
Simon Tatham [Sat, 29 Mar 2008 10:16:48 +0000 (10:16 +0000)]
When the user switches between fonts using the font family or style
selectors, preserve their most recent size selection as faithfully
as possible. We do this by having a secondary size variable
indicating what they _intend_, so we can come back to their intended
size even after going through a font which doesn't include it.

[originally from svn r7947]

16 years agoImprove the preview pane text.
Simon Tatham [Fri, 28 Mar 2008 20:08:12 +0000 (20:08 +0000)]
Improve the preview pane text.

[originally from svn r7946]

16 years agoMove the font-preview updating code out into a separate function so
Simon Tatham [Thu, 27 Mar 2008 19:53:28 +0000 (19:53 +0000)]
Move the font-preview updating code out into a separate function so
we can call it both when the drawing area changes size and when the
selected font changes. As a result, the preview pane doesn't start
off blank any more.

[originally from svn r7945]

16 years agoMore consistent handling of X11 font aliases: we now don't resolve
Simon Tatham [Thu, 27 Mar 2008 19:41:08 +0000 (19:41 +0000)]
More consistent handling of X11 font aliases: we now don't resolve
them automatically. If the user selects an alias in the font
selector, they get that alias copied literally into the output font
name string; when they return to the font selector, the alias is
still selected. We still _can_ resolve aliases, but we only do it on
demand: double-clicking one in the list box will do the job.

[originally from svn r7944]

16 years agoTune the sorting of the style list box for X fonts.
Simon Tatham [Wed, 26 Mar 2008 21:33:10 +0000 (21:33 +0000)]
Tune the sorting of the style list box for X fonts.

[originally from svn r7942]

16 years agoSort the styles of Pango font families into a sensible order,
Simon Tatham [Wed, 26 Mar 2008 20:20:25 +0000 (20:20 +0000)]
Sort the styles of Pango font families into a sensible order,
instead of alphabetical order. This is more than cosmetic: it's
important because the first one in the list is selected by default.

[originally from svn r7941]

16 years agoAdd ifdefs for older versions of GTK2 and Pango. Unfortunately, the
Simon Tatham [Wed, 26 Mar 2008 18:30:20 +0000 (18:30 +0000)]
Add ifdefs for older versions of GTK2 and Pango. Unfortunately, the
latter require manual input to the Makefile, since the Pango
developers in their unbounded wisdom (that is, unbounded below)
didn't bother to start providing the PANGO_VERSION macros until
release 1.16 - ten releases _after_ everything I'm trying to check!

[originally from svn r7940]

16 years agoPlacate optimiser.
Simon Tatham [Wed, 26 Mar 2008 18:16:52 +0000 (18:16 +0000)]
Placate optimiser.

[originally from svn r7939]

16 years agoUnified font selector dialog box. _Extremely_ unfinished - there's a
Simon Tatham [Tue, 25 Mar 2008 21:49:14 +0000 (21:49 +0000)]
Unified font selector dialog box. _Extremely_ unfinished - there's a
sizable TODO at the top of gtkfont.c - but it's basically functional
enough to select fonts of both types, so I'm checking it in now
before I accidentally break it.

[originally from svn r7938]

16 years agoImplemented a Pango back end. GTK 2 PuTTY can now switch seamlessly
Simon Tatham [Sat, 22 Mar 2008 18:11:17 +0000 (18:11 +0000)]
Implemented a Pango back end. GTK 2 PuTTY can now switch seamlessly
back and forth between X fonts and Pango fonts, provided you're
willing to type in the names of the former by hand.

[originally from svn r7937]

16 years agoMerge from trunk again (because I want the helpful diagnostic code
Simon Tatham [Sat, 22 Mar 2008 12:02:55 +0000 (12:02 +0000)]
Merge from trunk again (because I want the helpful diagnostic code
in r7934 on this branch). Now up to date as of r7934.

[originally from svn r7935]
[r7934 == 087adb167e9e25a09839ca802707c11565468e11]

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

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

[originally from svn r7934]

16 years agoRefactor the font handling code: I've moved all the code that
Simon Tatham [Sat, 22 Mar 2008 11:40:23 +0000 (11:40 +0000)]
Refactor the font handling code: I've moved all the code that
explicitly deals with GdkFont out into a new module, behind a
polymorphic interface (done by ad-hoc explicit vtable management in
C). This should allow me to drop in a Pango font handling module in
parallel with the existing one, meaning that GTK2 PuTTY will be able
to seamlessly switch between X11 server-side fonts and Pango client-
side ones as the user chooses, or even use a mixture of the two
(e.g. an X11 font for narrow characters and a Pango one for wide
characters, or vice versa).

In the process, incidentally, I got to the bottom of the `weird bug'
mentioned in the old do_text_internal(). It's not a bug in
gdk_draw_text_wc() as I had thought: it's simply that GdkWChar is a
32-bit type rather than a 16-bit one, so no wonder you have to
specify twice the length to find all the characters in the string!
However, there _is_ a bug in GTK2's gdk_draw_text_wc(), which causes
it to strip off everything above the low byte of each GdkWChar,
sigh. Solution to both problems is to use an array of the underlying
Xlib type XChar2b instead, and pass it to gdk_draw_text() cast to
gchar *. Grotty, but it works. (And it'll become significantly less
grotty if and when we have to stop using the GDK font handling
wrappers in favour of going direct to Xlib.)

[originally from svn r7933]

16 years agoMerge out from trunk, to keep this branch viable. We are now up to
Simon Tatham [Mon, 10 Mar 2008 18:48:36 +0000 (18:48 +0000)]
Merge out from trunk, to keep this branch viable. We are now up to
date as of r7913.

[originally from svn r7914]
[r7913 == d7eda6d99cb6b7c2e09489dcf13b23c4cfcc61a2]