simon-git: putty (pre-0.77): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Mar 12 21:05:57 GMT 2022
TL;DR:
f500d24a Windows: runtime switch between Unicode and ANSI windows.
a2b376af Windows Pageant: turn 'has_security' into a global function.
3f76a86c Windows Pageant: deal with PeekMessageW failing on legacy Windows.
f23a84cf windows/unicode.c: manually speak UTF-8.
5d58931b Fix trust status when Interactor returns a seat.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: pre-0.77
Committer: Simon Tatham <anakin at pobox.com>
Date: 2022-03-12 21:05:57
commit f500d24a95d1eac73cdde701b4849bf6a936e291
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f500d24a95d1eac73cdde701b4849bf6a936e291;hp=f69b42988b50a2f3e7d48612c82bb19dc393110e
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Mar 12 06:43:59 2022 +0000
Windows: runtime switch between Unicode and ANSI windows.
Turns out that PuTTY hasn't run successfully on legacy Windows since
0.66, in spite of an ongoing intention to keep it working. Among the
reasons for this is that CreateWindowExW simply fails with
ERROR_CALL_NOT_IMPLEMENTED: apparently Win95 and its ilk just didn't
have fully-Unicode windows as an option.
Fixed by resurrecting the previous code from the git history (in
particular, code removed by commit 67e5ceb9a8e6bc2 was useful), and
including it as a runtime alternative.
One subtlety was that I found I had to name the A and W window classes
differently (by appending ".ansi" to the A one): apparently they
occupy the same namespace even though the names are in different
character sets, so if you somehow manage to register both classes,
they'll collide with each other without that tweak.
windows/window.c | 147 +++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 116 insertions(+), 31 deletions(-)
commit a2b376af96072d6741caeb51b5f55fd05fd37157
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a2b376af96072d6741caeb51b5f55fd05fd37157;hp=f500d24a95d1eac73cdde701b4849bf6a936e291
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Mar 12 15:02:12 2022 +0000
Windows Pageant: turn 'has_security' into a global function.
Now it can be called from places other than Pageant's WinMain(). In
particular, the attempt to make a security descriptor in
lock_interprocess_mutex() is gated on it.
In return, however, I've tightened up the semantics. In normal PuTTY
builds that aren't trying to support pre-NT systems, the function
*unconditionally* returns true, on the grounds that we don't expect to
target any system that doesn't support the security APIs, and if
someone manages to contrive one anyway - or, more likely, if we some
day introduce a bug in our loading of the security API functions -
then this safety catch should make Pageant less likely to accidentally
fall back to 'never mind, just run in insecure mode'.
windows/pageant.c | 70 +++++++++++++++++---------------------
windows/platform.h | 1 +
windows/utils/interprocess_mutex.c | 4 +--
windows/utils/security.c | 14 ++++++++
4 files changed, 49 insertions(+), 40 deletions(-)
commit 3f76a86c13a315a8b657642987935d72f86707c6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3f76a86c13a315a8b657642987935d72f86707c6;hp=a2b376af96072d6741caeb51b5f55fd05fd37157
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Mar 12 15:18:38 2022 +0000
Windows Pageant: deal with PeekMessageW failing on legacy Windows.
This makes Pageant run on Win95 again. Previously (after fixing the
startup-time failures due to missing security APIs) it would go into
an uninterruptible CPU-consuming spin in the message loop when every
attempt to retrieve its messages failed because PeekMessageW doesn't
work at all on the 95 series.
windows/pageant.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
commit f23a84cf7c89cc4918976178c19abb654f76a7ef
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f23a84cf7c89cc4918976178c19abb654f76a7ef;hp=3f76a86c13a315a8b657642987935d72f86707c6
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Mar 12 16:16:01 2022 +0000
windows/unicode.c: manually speak UTF-8.
This is another fallback needed on Win95, where the Win32 API
functions to convert between multibyte and wide strings exist, but
they haven't heard of the UTF-8 code page. PuTTY can't really do
without that these days.
(In particular, if a server sends a remote window-title escape
sequence while the terminal is in UTF-8 mode, then _something_ needs
to translate the UTF-8 data into Unicode for Windows to reconvert into
the character set used in window titles.)
This is a weird enough thing to be doing that I've put it under the
new #ifdef LEGACY_WINDOWS, so behaviour in the standard builds should
be unchanged.
windows/unicode.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 81 insertions(+), 4 deletions(-)
commit 5d58931b51ff1223f1b2208956538cfadd702c0b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5d58931b51ff1223f1b2208956538cfadd702c0b;hp=f23a84cf7c89cc4918976178c19abb654f76a7ef
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Mar 12 20:17:30 2022 +0000
Fix trust status when Interactor returns a seat.
While testing the unrelated pile of commits just past, I accidentally
started a Cygwin saved session I hadn't run in ages which used the old
Telnet-based cygtermd as a local proxy command, and found that it
presented the Cygwin prompt with a trust sigil. Oops!
It turns out that this is because interactor_return_seat does two
things that can change the real seat's trust status, and it does them
in the wrong order: it defaults the status back to trusted (as if the
seat was brand new, because that's how they start out), and it calls
tempseat_flush which may have buffered a trust-status reset while the
seat was borrowed. The former should not override the latter!
proxy/interactor.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
More information about the tartarus-commits
mailing list