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

4746 Commits

Author SHA1 Message Date
Simon Tatham
4ec2791945 Remove Makefile.bor.
After a conversation this week with a user who tried to use it, it's
clear that Borland C can't build the up-to-date PuTTY without having
to make too many compromises of functionality (unsupported API
details, no 'long long' type), even above the issues that could be
worked round with extra porting ifdefs.
2017-09-13 19:26:28 +01:00
Simon Tatham
4634cd47f7 Avoid zero-length ldisc_send() in terminal.c.
A user reports that a remote window title query, if the window title
is empty or if the option to return it is disabled, fails the
assertion in ldisc_send that I introduced as part of commit c269dd013
to catch any lingering uses of ldisc_send with length 0 that should
have turned into ldisc_echoedit_update. Added a check for len > 0
guarding that ldisc_send call, and likewise at one or two others I
noticed on my way here.

(Probably at some point I should decide that the period of smoking out
lingering old-style ldisc_send(0) calls is over, and declare it safe
to remove that assertion again and get rid of all the cumbersome
safety checks at call sites like these ones. But not quite yet.)
2017-09-05 20:14:33 +01:00
Simon Tatham
a459fc58e8 Switch to producing .res files, not .res.o.
I've just upgraded my build process to a version of lld-link
that knows how to read .res, and I think it's a slightly more
commonly found format, so less confusing to encounter.
2017-08-26 15:23:56 +01:00
Simon Tatham
55efbc56a0 Fix filename of the 64-bit MIT Kerberos DLL.
64-bit PuTTY should be loading gssapi64.dll, not gssapi32.dll. (In
contrast to the Windows system API DLLs, such as secur32.dll which is
also mentioned in the same source file; those keep the "32" in their
name whether we're in Win32 or Win64.)
2017-08-04 19:46:21 +01:00
Simon Tatham
0a93b5d9bc Stop ssh2_msg_channel_response using a stale ssh_channel.
When it calls through ocr->handler() to process the response to a
channel request, sometimes that call ends up back in the main SSH-2
authconn coroutine, and sometimes _that_ will call bomb_out(), which
closes the whole SSH connection and frees all the channels - so that
when control returns back up the call stack to
ssh2_msg_channel_response itself which continues working with the
channel it was passed, it's using freed memory and things go badly.

This is the sort of thing I'd _like_ to fix using some kind of
large-scale refactoring along the lines of moving all the actual
free() calls out into top-level callbacks, so that _any_ function
which is holding a pointer to something can rely on that pointer still
being valid after it calls a subroutine. But I haven't worked out all
the details of how that system should work, and doubtless it will turn
out to have problems of its own once I do, so here's a point fix which
simply checks if the whole SSH session has been closed (which is easy
- much easier than checking if that _channel_ structure still exists)
and fixes the immediate bug.

(I think this is the real fix for the problem reported by the user I
mention in commit f0126dd19, because I actually got the details wrong
in the log message for that previous commit: the user's SSH server
wasn't rejecting the _opening_ of the main session channel, it was
rejecting the "shell" channel request, so this code path was the one
being exercised. Still, the other bug was real too, so no harm done!)
2017-07-19 07:28:27 +01:00
Simon Tatham
f0126dd198 Set ssh->mainchan->type earlier.
A user reported a nonsensical assertion failure (claiming that
ssh->version != 2) which suggested that a channel had somehow outlived
its parent Ssh in the situation where the opening of the main session
channel is rejected by the server. Checking with valgrind suggested
that things start to go wrong at the point where we free the half-set-
up ssh->mainchan before having filled in its type field, so that the
switch in ssh_channel_close_local() picks an arbitrary wrong action.

I haven't reproduced the same failure the user reported, but with this
change, Unix plink is now valgrind-clean in that failure situation.
2017-07-17 20:57:07 +01:00
Jacob Nevins
25683f0f3d Add a FAQ about servers that don't like IUTF8. 2017-07-12 10:19:23 +01:00
Ion Gaztañaga
309c3dfd95 Add -share -noshare command line option to plink to share SSL connections. 2017-07-08 09:28:20 +01:00
Simon Tatham
0e2955ffbf Add a --no-ftp mode to the release.pl download checks.
chiark's ftp server sometimes randomly refuses downloads. In the case
where this happens at postcheck time, this isn't really
release-blocking (all the files have been test-downloaded by precheck
already, so the main aim at this stage is to check that the 'latest'
symlink points to the right place, and even one or two successful
downloads are good enough to confirm that in practice). So now I can
add --no-ftp to the postcheck command line if that makes my life
easier.
2017-07-08 09:27:57 +01:00
Simon Tatham
7470e3bdaf Stop release.pl --setver failing if Makefile exists.
This should have been part of commit ea0ab1c82; it's part of the
general revamp that we regenerate the autoconf files ourselves in a
clean directory - so we don't depend on them being present, but we
also don't depend on them being _absent_ either.

But when I made that commit my immediate priority was to get --setver
to work from a completely clean checkout, not from one already
littered with cruft, so I didn't check quite as carefully that my
changes fixed the problem in the latter case too :-)
2017-07-08 09:27:57 +01:00
Simon Tatham
3cd10509a5 Update version number for 0.70 release. 2017-07-04 20:29:54 +01:00
Simon Tatham
a2b040ee09 Expand the About box.
It wasn't big enough to fit the full buildinfo text, when compiling
with clang-cl which has a bulky compiler identification string.
2017-07-04 19:35:18 +01:00
Simon Tatham
5cac6013b7 Rework the release checklist for current practice.
In recent releases we've taken to making the actual release build (or
rather, candidates for it) ahead of time so that we can do some
slightly more thorough last-minute testing of the exact binaries that
we're going to release to everyone. It's time I actually wrote that
procedure down in the checklist, so that I remember what it is.

In particular, we had the idea that we should not properly GPG-sign
the release until the last moment, and use the presence of a set of
full GPG signatures as a means of distinguishing the real release
build from an RC that accidentally got out into the wild somehow. This
checklist update formalises that too, and documents the method I used
of ensuring the binaries weren't tampered with between RC building and
release signing (by making a signature on just the sha512sums). I also
include in this commit an extra command-line option to sign.sh to make
that preliminary signature step more convenient.
2017-07-03 07:45:40 +01:00
Simon Tatham
ea0ab1c821 Simplify running of release.pl --setver.
Previously, it demanded that your checkout was in a state where you
had run autoconf but not configure; so if you previously did have a
Makefile then you had to 'make distclean' to remove it, whereas if you
previously had no generated files at all (e.g. starting from a
completely clean checkout) then you had to run mkfiles.pl and
mkauto.sh to generate 'configure'.

This is obviously confusing, and moreover, the dependence on prior
generated files is fragile and prone to them having been generated
wrong. Adjusted the script so that it uses 'git archive' to get a
clean directory containing only the version-controlled files, and then
runs scripts itself to get that directory into the state it wants.
2017-07-03 07:28:45 +01:00
Simon Tatham
4624115b76 Make -DMINEFIELD show up in Windows buildinfo.
I listed a lot of other build options, but not that one. The release
checklist still recommends doing test builds with it, so it seems
sensible to arrange that you can tell if a build _is_ one of those or
not.
2017-07-03 07:27:05 +01:00
Simon Tatham
4065b0cd78 Merge update of wcwidth.c to Unicode 9. 2017-07-02 09:30:00 +01:00
David Taylor
4241734dde Update wcwidth.c with Unicode 9.0.0 data
In order to maintain compatibility with screen[1], update
wcwidth functions to use Unicode 9.0.0 character database.

Updated intervals extracted from output of [2] from ucd files[3].

The comments at the head of [2] state that the output is unrestricted.
Therefore it is not subject to the GPL as applies to the script itself.

[1] See: https://savannah.gnu.org/bugs/?func=detailitem&item_id=50044
[2] https://raw.githubusercontent.com/GNOME/glib/37d4c2941bd0326b8b6e6bb22c81bd424fcc040b/glib/gen-unicode-tables.pl
[3] http://www.unicode.org/Public/9.0.0/ucd/
2017-07-01 23:25:49 +01:00
Simon Tatham
d61897414c Fixes spotted by Coverity.
A lenof() being applied to a non-array, a couple of missing frees on
an error path, and a case in pfd_receive() where we could have gone
round a loop again after freeing the port forwarding structure it was
working on.
2017-06-20 21:17:43 +01:00
Simon Tatham
4696f4a40b Coverity build fixes.
Like every other toolchain I've tried, my Coverity scanning build has
its share of random objections to parts of my Windows API type-
checking system. I do wonder if that bright idea was worth the hassle
- but it would probably cost all the annoyance all over again to back
out now...
2017-06-20 19:02:48 +01:00
Simon Tatham
98cbe6963b Another format-string fix.
Oops - I found this in an editor autosave file after pushing the
previous commit. I meant it to be part of the previous commit. Oh
well, better late than never.
2017-06-20 19:02:13 +01:00
Simon Tatham
34389feaed Merge further cppcheck fixes from Ilya Shipitsin. 2017-06-20 07:08:25 +01:00
Simon Tatham
20e36ae4a2 Fix a collection of type / format string mismatches.
Ilya Shipitsin sent me a list of errors reported by a tool 'cppcheck',
which I hadn't seen before, together with some fixes for things
already taken off that list. This change picks out all the things from
the remaining list that I could quickly identify as actual errors,
which it turns out are all format-string goofs along the lines of
using a %d with an unsigned int, or a %u with a signed int, or (in the
cases in charset/utf8.c) an actual _size_ mismatch which could in
principle have caused trouble on a big-endian target.
2017-06-20 07:05:39 +01:00
Ilya Shipitsin
02043ec5ac resolve (no real impact) issue found by cppcheck:
[windows/winnet.c:589]: (error) Uninitialized variable: err
2017-06-20 09:36:07 +05:00
Ilya Shipitsin
3f2df8cc9d resolve (no real impact) issue found by cppcheck:
[unix/osxlaunch.c:411]: (error) Memory leak: macos
[unix/osxlaunch.c:411]: (error) Memory leak: contents
[unix/osxlaunch.c:411]: (error) Memory leak: new_argv
2017-06-19 21:42:16 +05:00
Ilya Shipitsin
5efee18356 resolve couple of issues found by cppcheck:
[psftp.c:1135] -> [psftp.c:1134]: (warning) Either the condition '!dir' is redundant or there is possible null pointer dereference: dir.
[psftp.c:1420] -> [psftp.c:1419]: (warning) Either the condition '!dir' is redundant or there is possible null pointer dereference: dir.
2017-06-19 21:39:32 +05:00
Ilya Shipitsin
4387b5f161 resolve an issue found by cppcheck:
[unix/osxlaunch.c:133] -> [unix/osxlaunch.c:134]: (warning) Either the condition '!qhead' is redundant or there is possible null pointer dereference: qhead.
2017-06-19 20:57:28 +05:00
Jacob Nevins
892d4a0188 Seek all Windows print functions in winspool.drv.
Rather than loading some from spoolss.dll, which some MSDN documentation
suggests, but which doesn't work very well in practice.
(Also, remove an unused variable.)
2017-06-15 23:37:16 +01:00
Simon Tatham
a9e1053c8a Log the server's diagnostics if main channel open fails.
This has been a FIXME in the code for ages, because back when the main
channel was always a pty session or a program run in a pipe, there
weren't that many circumstances in which the actual CHANNEL_OPEN could
return failure, so it never seemed like a priority to get round to
pulling the error information out of the CHANNEL_OPEN_FAILURE response
message and including it in PuTTY or Plink's local error message.

However, 'plink -nc' is the real reason why this is actually
important; if you tell the SSH server to make a direct-tcpip network
connection as its main channel, then that can fail for all the usual
network-unreliability reasons, and you actually do want to know which
(did you misspell the hostname, or is the target server refusing
connections, or has network connectivity failed?). This actually bit
me today when I had such a network failure, and had to debug it by
pulling that information manually out of a packet log. Time to
eliminate that FIXME.

So I've pulled the error-extracting code out of the previous handler
for OPEN_FAILURE on non-main channels into a separate function, and
arranged to call that function if the main channel open fails too. In
the process I've made a couple of minor tweaks, e.g. if the server
sends back a reason code we haven't heard of, we say _what_ that
reason code was, and also we at least make a token effort to spot if
we see a packet other than OPEN_{CONFIRMATION,FAILURE} reaching the
main loop in response to the main channel-open.
2017-06-15 18:58:01 +01:00
Simon Tatham
f31a72ba09 Unix: use conf_dest() in 'unable to open connection' error box.
Alamy Liu points out that asking for CONF_host will display the wrong
part of the configuration in the case where serial port setup fails.
The Windows front end's analogous message already got this right, but
I must have forgotten to change this one too when I introduced
conf_dest.
2017-06-10 17:53:49 +01:00
Jacob Nevins
6aac4b9cef StartDocPrinter returns DWORD, not BOOL.
(Introduced in 793ac8727.)
2017-06-07 22:02:28 +01:00
Jacob Nevins
05f499e55f Add 'passthrough printing' as an index term. 2017-06-06 09:34:21 +01:00
Simon Tatham
1da3c71474 Have clang-cl builds announce their _MSC_VER.
In particular, this means the w32 and w32old builds have
distinguishable buildinfo text, which should protect us against at
least one source of confusion when receiving bug reports.
2017-05-30 22:49:25 +01:00
Simon Tatham
fd6898b586 Build the MSI using Wix run on Linux via Mono.
I have a grubby method of getting this to work without Wine, which I
intend to get round to publishing just as soon as I finish deciding
what its best shape is. But I don't want to wait for that before
starting to actually use it, because this eliminates the last trace of
Windows in the PuTTY Windows builds.
2017-05-27 20:07:00 +01:00
Simon Tatham
599ca6d726 Build using clang-cl instead of Visual Studio.
This permits me to do the binary builds via cross-compilation on
Linux, which is nice from a perspective of not having my build
environment subject to the same potential pool of Windows malware that
might be interested in infecting the resulting binaries. Also, it's
quicker to build and the code generation is noticeably better.
2017-05-27 20:06:11 +01:00
Simon Tatham
bbdb527d4d Turn off the Inno Setup installer build.
We've been planning to do that for a while, and this installer-builder
isn't going to work anyway in the build environment I'm about to move
everything to, so this seems like the moment.
2017-05-27 20:05:07 +01:00
Simon Tatham
eda5364eb4 Use / in pathnames in the Wix installer source.
I've also been experimenting recently with running Wix on Linux under
Mono, rather than running it on Windows in the obvious way. Wix under
Mono insists on forward slashes in pathnames, and it turns out that
Wix on Windows doesn't object to them either, so I can safely change
them over unconditionally and then my installer source will work in
both modes.
2017-05-25 08:22:22 +01:00
Simon Tatham
f02587f7ac Makefile.clangcl: provide a way to tell lld-link about crt0.obj.
I've been experimenting with using clang-cl with older versions of the
Visual Studio libraries and headers, and found that the older VS
libraries have a quirk which can cause link failure in a way that
doesn't happen with the newer one. I assume the corresponding old VS
linker must be doing some kind of special-case handling that lld isn't
mimicking.

The quirk arises because lld tries to pull in more than one of the
*crt0.obj startup objects which set things up before calling main or
WinMain (or whatever), and those objects define some of the same
symbols as each other. The fix is to explicitly ask for the right one
of those objects on the link command line, so that it's already been
loaded _before_ the linker starts searching libraries for unresolved
symbols; then the disputed symbols are never unresolved in the first
place during the library search phase.

But this means you have to pick your crt0 object differently depending
on which subsystem you're compiling for. Accordingly, here's an extra
feature in Makefile.clangcl to make that possible by means of the
right definitions on the make command line.
2017-05-25 08:21:19 +01:00
Simon Tatham
8d2755c55f Under clang-cl, include stdint.h regardless of _MSC_VER.
stdint.h is one of the set of standard C headers that has more to do
with the compiler than the library, and hence, clang provides its own
version of it, even when you're using it in clang-cl mode with Visual
Studio headers, and even when those headers are old enough not to have
a stdint.h of their own. So in clang builds, including stdint.h is
always the right way to get uintptr_t defined.
2017-05-25 08:17:42 +01:00
Simon Tatham
2e66a0d260 Fix a build failure under Visual Studio 2010.
Patch due to Brian K. White; we now condition our own declaration of
DLL_DIRECTORY_COOKIE on whether the toolchain's headers had #defined
it already, rather than trying to guess the answer to that from
version-number macros.

(Apparently everything that defines DLL_DIRECTORY_COOKIE does it by
does seem to work in all my tests.)
2017-05-24 21:32:11 +01:00
Jacob Nevins
e5dd1435e2 Remove FAQ about Plink on Win95.
While it's still true, the link to Winsock 2 is dead, our standard
release builds don't run on Win95 any more, and it's certainly not
frequently asked.
2017-05-23 23:45:19 +01:00
Jacob Nevins
22cf2823d1 Remove some ancient cruft from the FAQ.
- I haven't heard of OpenSSH/OpenSSL mismatches being a common problem
   for a long time. Specific advice about OpenSSH 3.1/3.4 seems unlikely
   to be useful these days.
 - "Incorrect MAC received on packet" doesn't seem to be a common
   problem these days, and if anyone encounters it, the words in the
   "Errors" bit of the docs seem adequate without a FAQ entry as well.
2017-05-23 23:13:17 +01:00
Jacob Nevins
12bd5a6c72 Stop Gtk2 builds exploding on scroll wheel events.
More fallout from 64221972c.
2017-05-20 12:44:56 +01:00
Ben Harris
c7b9f846d9 windows: Fix control-flow error in select_result().
When making select_result() return void (a2fb1d9), I removed a "return"
at the end of the FD_CLOSE case, causing a fallthrough into FD_ACCEPT
with hilarious (segfaulting) consequences.  Re-instate the "return".
2017-05-17 23:08:10 +01:00
Ben Harris
0d57b8a4d9 Make plug receive and closing functions return void instead of int.
Nothing was paying attention to their return values any more anyway.
2017-05-14 16:34:48 +01:00
Ben Harris
0d9c7d82e8 Don't treat plug_closing() and plug_receive() as returning backlog.
plug_receive() and plug_closing() return 0 or 1 depending on whether
they think the main connection has closed.  It is not appropriate, as
handle_gotdata and handle_socket_unfreeze did, to treat them as
returning a backlog.  In fact, plugs are unusual in PuTTY in not
reporting a backlog, but just calling into the socket to freeze and
unfreeze it as required.
2017-05-14 16:34:48 +01:00
Ben Harris
a2fb1d96ef windows: Make select_result() return void.
Nothing now uses its return value anyway.
2017-05-14 16:34:48 +01:00
Ben Harris
70e2e140f0 windows: Remove spurious redeclarations of select_result(). 2017-05-14 16:34:48 +01:00
Ben Harris
f65c31667e winplink: remove "connopen" variable.
It's redundant with back->connected(): only the SSH backend has a
receive function that can ever return 0, and whenever ssh_receive
returns 0 it has called ssh_do_close, which will cause future calls
to ssh_connected also to return 0.  Similarly, all backend closing
functions ensure that future calls to their connected function will
return 0.
2017-05-14 16:34:48 +01:00
Ben Harris
d56496c31c unix: make uxsel callback functions return void.
Nothing used their return values anyway.  At least, not after the
previous commit.
2017-05-14 16:34:48 +01:00
Ben Harris
30cdaa7ca8 unix: make select_result() return void.
Nothing was using its return value anyway.
2017-05-14 16:34:48 +01:00