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

3335 Commits

Author SHA1 Message Date
Jacob Nevins
4bddcc2b5d Workarounds for compiling with -D_FORTIFY_SOURCE=2 (as Ubuntu does), which
doesn't like you to ignore the return value from read()/write()/etc (and
apparently can't be shut up with a cast to void).

[originally from svn r8614]
2009-08-07 00:19:04 +00:00
Jacob Nevins
9c1f81dd94 More use of sockaddr_union (above and beyond that necessary to remove current
warnings).

[originally from svn r8613]
2009-08-06 22:55:15 +00:00
Jacob Nevins
16eeab4066 Avoid "dereferencing pointer 'sa' does break strict-aliasing rules" warnings
from recent versions of GCC.

[originally from svn r8612]
2009-08-06 22:12:05 +00:00
Jacob Nevins
0abd192e83 Alex Besogonov suggests that our Unix autoconf GSSAPI library search order is
sub-optimal -- apparently it prefers shishi above Heimdal, and apparently
that's bad.

[originally from svn r8610]
2009-07-28 23:45:48 +00:00
Jacob Nevins
506a81d5ba Mention Makefile.ux.
Be less certain about the possibility of building with vanilla VC6.
Provide more details of actively tested toolchains.

[originally from svn r8609]
2009-07-28 23:30:38 +00:00
Jacob Nevins
3767871300 Include putty.h (and hence uxconfig.h) before testing for NO_GSSAPI, so that
"./configure --without-gssapi" actually works. Spotted by Rob Shinn.

[originally from svn r8608]
2009-07-28 23:20:50 +00:00
Simon Tatham
fece1b69f5 Typo: replace a \i with a \I.
[originally from svn r8607]
2009-07-12 12:02:58 +00:00
Simon Tatham
b024b57644 Clearing and refilling the code-pages list box can cause a
re-entrant call to its handler in config.c, which destroys the
previous value in cfg->line_codepage. Therefore, preserve the right
value in an automatic variable until all the re-entrant calls have
finished.

[originally from svn r8592]
2009-06-10 17:42:15 +00:00
Simon Tatham
f8a260d59f Add a 'unix' Makefile type, for building the non-GUI parts of the
PuTTY suite on non-GTK-enabled build platforms.

[originally from svn r8577]
2009-05-11 18:48:43 +00:00
Simon Tatham
4c0b7ba7e4 Pango-based font handling: combine display of adjacent characters
into a single gdk_draw_layout() where conveniently feasible, after
some work with xtrace revealed this as a major source of pterm's
slow display updates when using client-side fonts.

Ideally we ought to be able to do better. I know exactly what
sequence of X protocol operations I want to see on the wire, but I
don't know how to persuade Pango to generate them.

[originally from svn r8558]
2009-05-11 08:46:17 +00:00
Jacob Nevins
8b88d653de Ansgar Wiechers points out that known_hosts (at least OpenSSH's) has grown a
means of specifying port numbers, so we should support that.

[originally from svn r8519]
2009-04-26 23:44:28 +00:00
Jacob Nevins
54c3773c91 Discard hashed hostnames from input.
[originally from svn r8518]
2009-04-26 23:03:02 +00:00
Jacob Nevins
542fc983bb Reported by Tim Kosse: on Unix, read_random_seed() wasn't correctly checking
the return from open() and behaved wrongly in the absence of a seed file.

[originally from svn r8517]
2009-04-26 22:32:41 +00:00
Jacob Nevins
19e47863de Several people have spotted an uninitialised structure member leading to a
potential crash on "reget" in Unix PSFTP.

[originally from svn r8516]
2009-04-26 22:19:30 +00:00
Simon Tatham
d58d1692b8 Richard Clark points out a missing check for ssh->mainchan being NULL.
[originally from svn r8502]
2009-04-24 18:45:22 +00:00
Simon Tatham
c7ac5745ab When giving authorisation errors from the proxy code in x11fwd.c,
name the proxy using the global 'appname' variable, instead of
statically calling it PuTTY.

(Knock-on effect is that PSCP and PSFTP have to declare that
variable, though of course they shouldn't ever actually _use_ the X
forwarding code. Probably I ought to replace it with a stub
nox11fwd.c for those applications.)

[originally from svn r8501]
2009-04-23 17:39:36 +00:00
Simon Tatham
74baacffa3 When starting a SOCKS connection in dynamic forwarding, freeze the
local socket _before_ calling the SSH setup functions. This makes no
difference to ssh.c itself, but it makes portfwd.c easier to reuse
for other purposes (e.g. as a component of a standalone SOCKS
server), because now ssh_send_port_open() can itself call
pfd_confirm() without the freeze and unfreeze happening in the wrong
order.

[originally from svn r8500]
2009-04-23 17:33:42 +00:00
Simon Tatham
87aafaa89a Support in the cross-platform code for translating to and from
UTF-16 when exchanging wchar_t strings with the front end. Enabled
by a #define in the platform's header file (one should not
promiscuously translate UTF-16 surrogate pairs on 32-bit wchar_t
platforms since that could give rise to redundant encoding attacks),
which is present on Windows.

[originally from svn r8495]
2009-03-24 22:24:31 +00:00
Jacob Nevins
713df723ae Fix cosmetic keyboard-interactive issue: at the end of a normal k-i session,
some servers (Debian in particular seems prone to this) send a k-i packet with
no prompts and nothing to display. We were printing an extra "Using
keyboard-interactive authentication" message in this case. (Introduced by me
in r8172, I think.)

[originally from svn r8492]
[r8172 == 211fdb9f46]
2009-03-03 19:57:58 +00:00
Simon Tatham
d0661ca94e Handle more gracefully the possibility of a keyboard-interactive
prompts packet containing no actual prompts (perhaps due to odd
server organisation, or perhaps so it can print a banner message and
do nothing else). Previously, the get_userpass_input functions
always returned failure when in '-batch' mode, even in this case
where no actual input would be required.

[originally from svn r8490]
2009-03-03 18:35:53 +00:00
Simon Tatham
80623557c6 Stop using physical tabs in Python. (I was goaded into doing this by
my editor, which has defaulted to showing them as explicit ^I for a
while now, but it seems like a generally prudent idea in any case.)

[originally from svn r8472]
2009-02-28 23:04:58 +00:00
Simon Tatham
99782a4066 Debian bug #517535: we were unconditionally interpreting the
'string' field in a GdkEventKey structure as ISO-8859-1, which was
correct for GTK 1.2 but in 2.0 that field is encoded according to
the current C library locale. Hence, we now process that field by
converting it to UTF-8 via trips through both libc and libcharset,
and then let lpage_send() convert from UTF-8 back to whatever it's
supposed to actually go down the line in.

[originally from svn r8470]
2009-02-28 16:52:42 +00:00
Jacob Nevins
031bfe129d Fix inaccurate error message.
[originally from svn r8466]
2009-02-24 22:56:44 +00:00
Jacob Nevins
d699530e4c Since r8305, Unix PuTTY has always "upgraded" an X11 display like "localhost:0"
to a Unix-domain socket. This typically works fine when PuTTY is run on the
same machine as the X server, but it's broken multi-hop X forwarding through
OpenSSH; when OpenSSH creates a proxy X server "localhost:10", it only listens
on TCP, not on a Unix-domain socket.

Instead, when deciding on the details of the display, we actively probe to see
if there's a Unix-domain socket we can use instead, and only use it if it's
there, falling back to the specified IP "localhost" if not.

Independently, when looking for local auth details in Xauthority for a
"localhost" TCP display, we prefer a matching Unix-domain entry, but will fall
back to an IP "localhost" entry (which would be unusual, but we don't trust a
Windows X server not to do it) -- this is a generalisation of the special case
added in r2538 (but removed in r8305, as the automatic upgrade masked the need
for it).
(This is now done in platform-independent code, so a side-effect is that
get_hostname() is now part of the networking abstraction on all platforms.)

[originally from svn r8462]
[r2538 == fda9983243]
[r8305 == ca6fc3a4da]
2009-02-24 01:01:23 +00:00
Jacob Nevins
40be9eeedd Stop attempting to make session logs private on Unix. This was introduced in
r7084 at the same time as sensible permissions when writing private key files;
however, it causes an assertion failure whenever an attempt is made to append
to an existing log file on Unix, and it's not clear what "is_private" *should*
do for append, so revert to log file security being the user's responsibility.
(Fixes Ubuntu LP#212711.)

[originally from svn r8461]
[r7084 == 4fa9564c90]
2009-02-23 22:40:09 +00:00
Simon Tatham
35e004ffee The Windows config option to point at an X authority file is only
read at connection setup time, so don't offer it in the Change
Settings dialog box.

(In particular, this fixes an assertion failure when selecting
Change Settings on a non-SSH connection, since wincfg.c would have
added that control to Connection/SSH/X11 when the parent panel
Connection/SSH didn't exist. Making the control conditional on the
selected protocol would have been sufficient to fix that failure,
but I now realise that the setting should never have been presented
in mid-session in any case.)

[originally from svn r8443]
2009-02-03 21:22:52 +00:00
Simon Tatham
9b2515f97e Don't call ReleaseCapture() on any mouse-button-up event. Instead,
only call it when the _last_ mouse button comes back up. Otherwise,
xterm mouse tracking will lose a button-up event if you press down
two buttons, move the mouse outside the window, then release them
one at a time.

[originally from svn r8425]
2009-01-21 18:47:03 +00:00
Simon Tatham
464aa76aaf Check the two popen() calls in noise_get_heavy for NULL.
[originally from svn r8411]
2009-01-13 18:18:35 +00:00
Simon Tatham
201c2c295b Patch from Gert-Jan Vons: create an event handle to go in the
OVERLAPPED structure in output threads, as we already do for input
threads. This apparently sorts out a hanging issue with serial ports
when trying to do simultaneous read and write, because (GJV says,
and it sounds plausible to me) in the absence of that event object
Windows signals the file handle itself to notify GetOverlappedResult
that it can return - and since the file handle might be being
signalled by a read operation instead, that leads to ambiguity.
Using an explicit event object in both directions means Windows
always knows which way the data is going.

Also a trivial fix in handle_output_new(), which was referencing the
wrong element of a union due to a copy and paste error. (Since the
result was address-taken and cast to void *, this wasn't a
functional error, but it was conceptually wrong.)

[originally from svn r8410]
2009-01-12 20:41:28 +00:00
Ben Harris
36f502fa93 Arguments to ctype functions are required to be either EOF or representable
as unsigned char.  This means that passing in a bare char is incorrect on
systems where char is signed.  Sprinkle some appropriate casts to prevent
this.

[originally from svn r8406]
2009-01-11 14:26:27 +00:00
Ben Harris
91496d37c7 Propagate my ctype fixes (r8404) from libcharset.
[originally from svn r8405]
[r8404 == 7fce7161db885ed7f0fa0c06f27d58d789a23b62 in charset repository]
2009-01-11 14:20:34 +00:00
Simon Tatham
75913faf82 Weaken the assertion in general_textout(). It was failing in the
case of double-width text (ESC # 3, ESC # 4, ESC # 6), because the
string passed to it was not truncated to the same width as the
clipping rectangle. (In fact, it _can't_ reliably be, in the case
where the window width is odd.) So instead we just assert that we
managed to _at least_ fill the clipping rectangle, not that we
exactly filled it.

The problem is easily reproduced by sending ESC # 8 (fill the screen
with Es) followed by ESC # 3. It doesn't typically happen, though,
if you _manually_ fill the screen with Es, because in that case
PuTTY's terminal buffer ends up being filled with CSET_ACP | 'E' or
similar, which means that general_textout() never gets called
because one of the other branches of do_text_internal() does the
work instead. ESC # 8 will fill the terminal buffer with genuine
_Unicode_ 'E' characters, which exercises the failing code path.

[originally from svn r8403]
2009-01-09 18:55:45 +00:00
Simon Tatham
6d9f007684 Another patch from Colin, providing a "make distclean" target in the
autoconf makefile.

[originally from svn r8401]
2009-01-08 18:21:33 +00:00
Simon Tatham
1bb22cfa1f Colin also suggests that we can replace the backticks in the GTK
makefile with make's own $(shell ...) function, which means that
gtk-config and krb5-config and so on only get run once per make
invocation instead of once per gcc invocation.

[originally from svn r8400]
2009-01-08 18:19:52 +00:00
Simon Tatham
98c4b69b08 Colin Watson reports a strange problem whereby krb5-config
incorporates the environment variable CFLAGS into its output. Avoid
exporting our version of it from the Makefile (which actually causes
build failures, since quoting phase issues mean that the backticks
in our version end up unexpanded).

[originally from svn r8399]
2009-01-08 18:18:14 +00:00
Jacob Nevins
fbbec4c23a Rejig windlg.c:verify_ssh_host_key() to silence a warning.
[originally from svn r8394]
2009-01-06 00:25:07 +00:00
Jacob Nevins
2550cd617c Remove a couple of unused variables.
[originally from svn r8393]
2009-01-06 00:16:35 +00:00
Jacob Nevins
e4027368fd It's a new year (and there have even been checkins).
[originally from svn r8392]
[this svn revision also touched putty-website]
2009-01-05 23:49:19 +00:00
Jacob Nevins
e0deac8960 sk_address_is_local() failed to cope when presented with a Unix-domain socket.
This could cause Unix PuTTY to segfault when X forwarding over an SSH session
through a proxy.
(sk_getaddr() wouldn't cope either -- in that case, add an assertion to make it
more obvious; I don't think it should ever happen.)

[originally from svn r8391]
2009-01-05 23:36:14 +00:00
Jacob Nevins
7843fb79d1 Be prepared for x11_setup_display() to return NULL (for instance, if DISPLAY
has invalid contents). Simply refuse to try X forwarding in this circumstance.

[originally from svn r8390]
2009-01-05 22:53:14 +00:00
Jacob Nevins
3e6111243c r5080 didn't go far enough -- since 0.58, anyone on Unix who didn't previously
have default settings for "bell overload" mode will have inherited a twitchy
set of defaults where bells are disabled after 2ms and enabled after 5ms,
rather than 2s and 5s as intended. This error has probably propagated into some
people's saved sessions by now, but there's not much to be done.

[originally from svn r8389]
[r5080 == 7647f57dc4]
2009-01-05 19:39:27 +00:00
Jacob Nevins
bd5cec280a Add some hard-coded textual literal-IP representations of localhost to
sk_hostname_is_local(), to catch the case where we're doing something like X11
forwarding over SSH through a proxy, and we've thus disabled local lookup of
hostnames.
(I think this is what's behind the report in
<e9a86996-5dc2-4428-9b0c-c65693ca6351@m32g2000hsf.googlegroups.com>
in comp.security.ssh, although I'd like to know more of the circumstances.)

[originally from svn r8385]
2009-01-05 02:45:38 +00:00
Jacob Nevins
51bceb0c9a ...and fix an unlikely memory leak.
[originally from svn r8384]
2009-01-05 01:15:06 +00:00
Jacob Nevins
030046a2a8 Cope with a (non-standard) ENAMETOOLONG return from gethostname(); glibc will
do this if the supplied buffer isn't big enough, which shouldn't lead to
complete abandonment of X11 auth. (Would only have bitten with hostnames
>255 chars anyway.)

[originally from svn r8383]
2009-01-05 01:01:58 +00:00
Jacob Nevins
07a876ce1e r8305 made platform_x11_best_transport[] obsolete, but there still seem to be a
few instances around; expunge them.

[originally from svn r8382]
[r8305 == ca6fc3a4da]
2009-01-04 23:36:24 +00:00
Jacob Nevins
db6ad48673 r8305 seems to have made Unix PuTTY rather over-keen on Unix-domain sockets;
unless a protocol is explicitly specified with "tcp/foovax:0", it assume a
Unix-domain socket, thus not allowing a remote display on a machine other than
the client.

[originally from svn r8381]
[r8305 == ca6fc3a4da]
2009-01-04 23:28:25 +00:00
Jacob Nevins
81287fb7ad Bah, I've bumped into this often enough. Change one unsatisfactory cast for
another to shut up "warning: cast from pointer to integer of different size"
(and hence a -Werror compile failure) when compiling for Unix with DEBUG
defined on atreus (x86_64). Minimally checked that it doesn't introduce upset
elsewhere (i386).

[originally from svn r8380]
2009-01-04 22:24:08 +00:00
Jacob Nevins
6b5f874552 Log reason for failure to create a connection to a local X display.
[originally from svn r8379]
2009-01-04 21:43:20 +00:00
Jacob Nevins
5611259468 r8338 broke pasting with Shift-Ins and from the context menu on Windows.
Divert these to use the request_paste() interface.

[originally from svn r8377]
[r8338 == 54835a9838]
2008-12-29 20:04:42 +00:00
Jacob Nevins
cf3b45392d "Derek" reports that the DECSLPP report of window-size-in-pixels (CSI 14 t)
has width and height swapped. Since both a random xterm I have and
<http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt> agree with him, I've
changed ours. (This stuff appears to originate in dtterm, but I can't check the
behaviour of that right now.)

While I'm here, the are-we-iconified report (CSI 11 t) looks to have the
wrong sense compared to the same sources, so swap that too.

(All this has been this way since it was originally implemented in r1414,
which doesn't cite a source. all-escapes is silent too.)

[originally from svn r8376]
[r1414 == bb1f5cec31]
2008-12-20 19:43:20 +00:00