simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Apr 18 08:39:54 BST 2021
TL;DR:
3996919f Fix a few cmake configure-time checks.
9469fa38 Remove weird test and definition of HAVE_PUTUTLINE.
0881c9d2 Delete obsolete and unused resource.h.
3396c97d New library-style 'utils' subdirectories.
cc3e4992 Break up x11fwd.c.
5bb24a7e Remove stub functions that are no longer needed.
395c228b Adopt a new universal implementation of smemclr().
1c61fdf8 Build various unit-test main() programs in utils.
b00e5fb1 Remove the switching system in puttyps.h.
3d55a2be Add coverage flags
c314f582 Conditionalise a couple of CMake checks.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2021-04-18 08:39:54
commit 3996919f5eb1baa5dad989cb0bdbbabbdbf99bcc
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3996919f5eb1baa5dad989cb0bdbbabbdbf99bcc;hp=6c783f9ad0d2e34db0cbf3147ee872402c90dcd2
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 19:17:28 2021 +0100
Fix a few cmake configure-time checks.
A couple of actual checks were missing (elf_aux_info, sysctlbyname).
Several more were accidentally left out of cmake.h.in, meaning they
wouldn't be propagated from cmake's variable space into the actual
compilation. And a handful of checks in the C source were still using
the autotools-style 'if defined' in place of the cmake-style "it's
always 0 or 1" plain #if.
cmake/cmake.h.in | 7 +++++++
cmake/platforms/unix.cmake | 2 ++
unix/uxmisc.c | 2 +-
unix/uxutils.h | 4 ++--
4 files changed, 12 insertions(+), 3 deletions(-)
commit 9469fa38f15ba4022a73e998ee80e9eaf718e52d
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9469fa38f15ba4022a73e998ee80e9eaf718e52d;hp=3996919f5eb1baa5dad989cb0bdbbabbdbf99bcc
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 19:03:53 2021 +0100
Remove weird test and definition of HAVE_PUTUTLINE.
I don't know what that was doing there - not only was defining it on
purpose a strange idea, but nothing ever tested it afterwards!
unix/uxpty.c | 14 --------------
1 file changed, 14 deletions(-)
commit 0881c9d2b8de7d563e222042cdb65c422a12caa6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0881c9d2b8de7d563e222042cdb65c422a12caa6;hp=9469fa38f15ba4022a73e998ee80e9eaf718e52d
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 18 07:32:25 2021 +0100
Delete obsolete and unused resource.h.
I have no idea what it was doing there! It's been there, unmodified
apart from whitespace tidying, since the very start of the VCS
history; it's Windows-specific but never got moved into the windows
subdirectory; and nothing even includes it. Throw it away!
resource.h | 15 ---------------
1 file changed, 15 deletions(-)
commit 3396c97da9d658570a4b80bd3221cefdc0b96dbf
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3396c97da9d658570a4b80bd3221cefdc0b96dbf;hp=0881c9d2b8de7d563e222042cdb65c422a12caa6
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 15:22:20 2021 +0100
New library-style 'utils' subdirectories.
Now that the new CMake build system is encouraging us to lay out the
code like a set of libraries, it seems like a good idea to make them
look more _like_ libraries, by putting things into separate modules as
far as possible.
This fixes several previous annoyances in which you had to link
against some object in order to get a function you needed, but that
object also contained other functions you didn't need which included
link-time symbol references you didn't want to have to deal with. The
usual offender was subsidiary supporting programs including misc.c for
some innocuous function and then finding they had to deal with the
requirements of buildinfo().
This big reorganisation introduces three new subdirectories called
'utils', one at the top level and one in each platform subdir. In each
case, the directory contains basically the same files that were
previously placed in the 'utils' build-time library, except that the
ones that were extremely miscellaneous (misc.c, utils.c, uxmisc.c,
winmisc.c, winmiscs.c, winutils.c) have been split up into much
smaller pieces.
CMakeLists.txt | 50 +-
misc.c | 419 ---------
unix/CMakeLists.txt | 25 +-
unix/{uxutils.c => utils/arm_arch_queries.c} | 17 +-
unix/{uxutils.h => utils/arm_arch_queries.h} | 8 +-
unix/utils/block_signal.c | 21 +
unix/utils/cloexec.c | 49 +
unix/utils/dputs.c | 24 +
unix/utils/filename.c | 72 ++
unix/utils/fontspec.c | 35 +
unix/utils/get_username.c | 52 ++
unix/utils/getticks.c | 33 +
unix/{xkeysym.c => utils/keysym_to_unicode.c} | 2 +-
unix/utils/make_dir_and_check_ours.c | 60 ++
unix/utils/make_dir_path.c | 39 +
unix/utils/nonblock.c | 55 ++
unix/utils/open_for_write_would_lose_data.c | 44 +
unix/utils/pgp_fingerprints.c | 23 +
unix/{uxpoll.c => utils/pollwrap.c} | 21 +
unix/utils/signal.c | 30 +
unix/{x11misc.c => utils/x11_ignore_error.c} | 21 +-
unix/uxmisc.c | 371 --------
unix/uxsignal.c | 47 -
utils.c | 1122 -----------------------
utils/base64_decode_atom.c | 54 ++
utils/base64_encode_atom.c | 30 +
utils/bufchain.c | 173 ++++
utils/buildinfo.c | 158 ++++
utils/burnstr.c | 15 +
utils/chomp.c | 26 +
conf.c => utils/conf.c | 0
utils/conf_dest.c | 15 +
utils/conf_launchable.c | 14 +
utils/ctrlparse.c | 49 +
utils/debug.c | 56 ++
utils/dupcat.c | 48 +
utils/dupprintf.c | 100 ++
utils/dupstr.c | 19 +
utils/encode_utf8.c | 29 +
utils/fgetline.c | 25 +
utils/host_strchr.c | 18 +
utils/host_strchr_internal.c | 80 ++
utils/host_strcspn.c | 19 +
utils/host_strduptrim.c | 51 ++
utils/host_strrchr.c | 18 +
time.c => utils/ltime.c | 0
marshal.c => utils/marshal.c | 0
memory.c => utils/memory.c | 0
utils/memxor.c | 34 +
miscucs.c => utils/miscucs.c | 0
utils/null_lp.c | 8 +
utils/nullseat.c | 42 +
utils/nullstrcmp.c | 21 +
utils/out_of_memory.c | 11 +
utils/parse_blocksize.c | 40 +
utils/prompts.c | 59 ++
utils/ptrlen.c | 95 ++
utils/read_file_into.c | 19 +
utils/seat_connection_fatal.c | 20 +
sessprep.c => utils/sessprep.c | 0
utils/sk_free_peer_info.c | 14 +
utils/smemclr.c | 42 +
utils/smemeq.c | 25 +
utils/ssh2_pick_fingerprint.c | 27 +
sshutils.c => utils/sshutils.c | 0
utils/strbuf.c | 118 +++
utils/string_length_for_printf.c | 21 +
stripctrl.c => utils/stripctrl.c | 0
tree234.c => utils/tree234.c | 0
utils/utils.h | 12 +
utils/validate_manual_hostkey.c | 116 +++
version.c => utils/version.c | 0
wcwidth.c => utils/wcwidth.c | 0
wildcard.c => utils/wildcard.c | 0
utils/write_c_string_literal.c | 31 +
windows/CMakeLists.txt | 34 +-
windows/utils/arm_arch_queries.c | 39 +
windows/{wincapi.c => utils/capi.c} | 2 +-
windows/{windefs.c => utils/defaults.c} | 2 +-
windows/utils/dll_hijacking_protection.c | 43 +
windows/utils/dputs.c | 37 +
windows/utils/escape_registry_key.c | 48 +
windows/utils/filename.c | 54 ++
windows/utils/fontspec.c | 43 +
windows/utils/get_username.c | 77 ++
windows/utils/getdlgitemtext_alloc.c | 20 +
windows/utils/is_console_handle.c | 13 +
windows/utils/load_system32_dll.c | 26 +
windows/{wintime.c => utils/ltime.c} | 3 +-
windows/utils/makedlgitemborderless.c | 19 +
windows/utils/message_box.c | 49 +
windows/{winmiscs.c => utils/minefield.c} | 76 +-
windows/utils/open_for_write_would_lose_data.c | 38 +
windows/utils/pgp_fingerprints_msgbox.c | 25 +
windows/utils/platform_get_x_display.c | 12 +
windows/utils/registry_get_string.c | 43 +
windows/utils/request_file.c | 71 ++
windows/{winsecur.c => utils/security.c} | 2 +-
windows/{winutils.c => utils/split_into_argv.c} | 197 +---
windows/utils/strtoumax.c | 12 +
windows/utils/version.c | 40 +
windows/utils/win_strerror.c | 72 ++
windows/winmisc.c | 467 ----------
windows/winstuff.h | 6 +
104 files changed, 3251 insertions(+), 2711 deletions(-)
commit cc3e4992d5e5bfb580cefcbc9a3ed85f1cd95eee
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=cc3e4992d5e5bfb580cefcbc9a3ed85f1cd95eee;hp=3396c97da9d658570a4b80bd3221cefdc0b96dbf
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 17:01:08 2021 +0100
Break up x11fwd.c.
This is a module that I'd noticed in the past was too monolithic.
There's a big pile of stub functions in uxpgnt.c that only have to be
there because the implementation of true X11 _forwarding_ (i.e.
actually managing a channel within an SSH connection), which Pageant
doesn't need, was in the same module as more general X11-related
utility functions which Pageant does need.
So I've broken up this awkward monolith. Now x11fwd.c contains only
the code that really does all go together for dealing with SSH X
forwarding: the management of an X forwarding channel (including the
vtables to make it behave as Channel at the SSH end and a Plug at the
end that connects to the local X server), and the management of
authorisation for those channels, including maintaining a tree234 of
possible auth values and verifying the one we received.
Most of the functions removed from this file have moved into the utils
subdir, and also into the utils library (i.e. further down the link
order), because they were basically just string and data processing.
One exception is x11_setup_display, which parses a display string and
returns a struct telling you everything about how to connect to it.
That talks to the networking code (it does name lookups and makes a
SockAddr), so it has to live in the network library rather than utils,
and therefore it's not in the utils subdirectory either.
The other exception is x11_get_screen_number, which it turned out
nothing called at all! Apparently the job it used to do is now done as
part of x11_setup_display. So I've just removed it completely.
CMakeLists.txt | 8 +-
misc.h | 16 ++
putty.h | 2 +-
ssh.h | 1 +
unix/CMakeLists.txt | 4 +-
utils/x11_dehexify.c | 28 ++
utils/x11_identify_auth_proto.c | 16 ++
utils/x11_make_greeting.c | 67 +++++
utils/x11_parse_ip.c | 20 ++
utils/x11authfile.c | 244 +++++++++++++++++
utils/x11authnames.c | 9 +
windows/CMakeLists.txt | 4 +-
x11disp.c | 189 ++++++++++++++
x11fwd.c | 562 ----------------------------------------
14 files changed, 602 insertions(+), 568 deletions(-)
commit 5bb24a7eddfe129a3eb02257b0e63d9bbb2e4879
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5bb24a7eddfe129a3eb02257b0e63d9bbb2e4879;hp=cc3e4992d5e5bfb580cefcbc9a3ed85f1cd95eee
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 17:11:19 2021 +0100
Remove stub functions that are no longer needed.
This is the start of the payoff for all that reorganisation (and
perhaps also from having moved to a library-based build structure in
the first place): a collection of pointless stub functions in outlying
programs, which were only there to prevent link failures, now no
longer need to be there even for that purpose.
fuzzterm.c | 3 ---
testcrypt.c | 7 -------
testsc.c | 7 -------
unix/uxpgnt.c | 31 -------------------------------
unix/uxsocks.c | 2 --
windows/winpgnt.c | 5 -----
6 files changed, 55 deletions(-)
commit 395c228bee78515155d7e73fbbcd35fffb0d7fa7
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=395c228bee78515155d7e73fbbcd35fffb0d7fa7;hp=5bb24a7eddfe129a3eb02257b0e63d9bbb2e4879
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 17:59:43 2021 +0100
Adopt a new universal implementation of smemclr().
This new implementation uses the same optimisation-barrier technique
that I used in various places in testsc: have a no-op function, and a
volatile function pointer pointing at it, and then call through the
function pointer, so that nothing actually happens (apart from the
physical call and return) but the compiler has to assume that
_anything_ might have happened.
Doing this just after a memset enforces that the compiler can't have
thrown away the memset, because the called function might (for
example) check that all the memory really is zero and abort if not.
I've been turning this over in my mind ever since coming up with the
technique for testsc. I think it's far more robust than the previous
smemclr technique: so much so that I'm switching to using it
_everywhere_, and no longer using platform alternatives like Windows's
SecureZeroMemory().
CMakeLists.txt | 1 +
cmake/platforms/windows.cmake | 3 ---
defs.h | 28 ---------------------------
unix/CMakeLists.txt | 1 -
utils/buildinfo.c | 3 ---
utils/smemclr.c | 44 ++++++++++++++++++++++++++-----------------
windows/CMakeLists.txt | 3 ---
7 files changed, 28 insertions(+), 55 deletions(-)
commit 1c61fdf800367ba8be30f335c340a4188820615c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1c61fdf800367ba8be30f335c340a4188820615c;hp=395c228bee78515155d7e73fbbcd35fffb0d7fa7
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 17 16:39:31 2021 +0100
Build various unit-test main() programs in utils.
I found these while going through the code, and decided if we're going
to have them then we should compile them. They didn't all compile
first time, proving my point :-)
I've enhanced the tree234 test so that it has a verbose option, which
by default is off.
CMakeLists.txt | 15 ++++++
utils/host_strchr_internal.c | 2 +-
utils/tree234.c | 105 +++++++++++++++++++++++++---------------
utils/wildcard.c | 4 +-
windows/CMakeLists.txt | 5 ++
windows/utils/split_into_argv.c | 12 +++--
6 files changed, 98 insertions(+), 45 deletions(-)
commit b00e5fb12929da5015e7331fe9b88f245301ebf2
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b00e5fb12929da5015e7331fe9b88f245301ebf2;hp=1c61fdf800367ba8be30f335c340a4188820615c
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 18 07:58:27 2021 +0100
Remove the switching system in puttyps.h.
It was there because of a limitation of mkfiles.pl, which had a single
list of include directories that it used on all platforms. CMake does
not. So now there's an easier and more sensible way to have a
different header file included on Windows and Unix: call it the same
name in the two subdirectories, and rely on CMake having put the right
one of those subdirs on the include path.
putty.h | 2 +-
puttyps.h | 18 ------------------
unix/{unix.h => platform.h} | 10 +++++++---
windows/{winstuff.h => platform.h} | 8 ++++----
4 files changed, 12 insertions(+), 26 deletions(-)
commit 3d55a2befb10e85bbd9bf6d1b67467400efa2a35
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3d55a2befb10e85bbd9bf6d1b67467400efa2a35;hp=b00e5fb12929da5015e7331fe9b88f245301ebf2
Author: Pavel I. Kryukov <pavel.kryukov at phystech.edu>
Date: Sat Apr 17 22:44:50 2021 +0300
Add coverage flags
cmake/setup.cmake | 5 +++++
1 file changed, 5 insertions(+)
commit c314f582541cfacec0790eebd3bdf6e130ffc29f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c314f582541cfacec0790eebd3bdf6e130ffc29f;hp=3d55a2befb10e85bbd9bf6d1b67467400efa2a35
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Apr 18 08:22:43 2021 +0100
Conditionalise a couple of CMake checks.
On Windows, configure-style checks are a bit slow, so it's worth
avoiding unnecessary ones if possible. I was testing for three
different header file names that are alternatives to each other, so it
makes sense to stop as soon as we find a usable one.
cmake/platforms/windows.cmake | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list