1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/unix
Simon Tatham 6d272ee007 Allow new_connection to take an optional Seat. (NFC)
This is working towards allowing the subsidiary SSH connection in an
SshProxy to share the main user-facing Seat, so as to be able to pass
through interactive prompts.

This is more difficult than the similar change with LogPolicy, because
Seats are stateful. In particular, the trust-sigil status will need to
be controlled by the SshProxy until it's ready to pass over control to
the main SSH (or whatever) connection.

To make this work, I've introduced a thing called a TempSeat, which is
(yet) another Seat implementation. When a backend hands its Seat to
new_connection(), it does it in a way that allows new_connection() to
borrow it completely, and replace it in the main backend structure
with a TempSeat, which acts as a temporary placeholder. If the main
backend tries to do things like changing trust status or sending
output, the TempSeat will buffer them; later on, when the connection
is established, TempSeat will replay the changes into the real Seat.

So, in each backend, I've made the following changes:
 - pass &foo->seat to new_connection, which may overwrite it with a
   TempSeat.
 - if it has done so (which we can tell via the is_tempseat() query
   function), then we have to free the TempSeat and reinstate our main
   Seat. The signal that we can do so is the PLUGLOG_CONNECT_SUCCESS
   notification, which indicates that SshProxy has finished all its
   connection setup work.
 - we also have to remember to free the TempSeat if our backend is
   disposed of without that having happened (e.g. because the
   connection _doesn't_ succeed).
 - in backends which have no local auth phase to worry about, ensure
   we don't call seat_set_trust_status on the main Seat _before_ it
   gets potentially replaced with a TempSeat. Moved some calls of
   seat_set_trust_status to just after new_connection(), so that now
   the initial trust status setup will go into the TempSeat (if
   appropriate) and be buffered until that seat is relinquished.

In all other uses of new_connection, where we don't have a Seat
available at all, we just pass NULL.

This is NFC, because neither new_connection() nor any of its delegates
will _actually_ do this replacement yet. We're just setting up the
framework to enable it to do so in the next commit.
2021-09-13 17:24:47 +01:00
..
utils Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
agent-client.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
agent-socket.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
askpass.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
cliloop.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
CMakeLists.txt testsc: add side-channel test of probabilistic prime gen. 2021-08-27 18:04:49 +01:00
columns.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
columns.h Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
config-gtk.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
config-unix.c Initial support for in-process proxy SSH connections. 2021-05-22 14:13:52 +01:00
console.c Divide seat_set_trust_status into query and update. 2021-09-12 09:52:46 +01:00
dialog.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
fd-socket.c FdSocket, HandleSocket: store a notional peer address. 2021-09-13 14:38:44 +01:00
gss.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
gtk-common.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
gtkcompat.h gtkcompat.h: fix GTK1 implementation of ref_sink. 2019-11-02 08:26:14 +00:00
gtkmisc.h Convert a lot of 'int' variables to 'bool'. 2018-11-03 13:45:00 +00:00
keygen-noise.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
local-proxy.c FdSocket, HandleSocket: store a notional peer address. 2021-09-13 14:38:44 +01:00
main-gtk-application.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
main-gtk-simple.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
network.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
no-gtk.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
noise.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
osxlaunch.c osxlaunch: stop setting DYLD_LIBRARY_PATH. 2017-12-20 10:04:02 +00:00
pageant.c Allow new_connection to take an optional Seat. (NFC) 2021-09-13 17:24:47 +01:00
peerinfo.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
platform.h FdSocket, HandleSocket: store a notional peer address. 2021-09-13 14:38:44 +01:00
plink.c New Seat method, notify_session_started(). 2021-09-12 11:55:55 +01:00
printing.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
procnet.c Add a /proc/net magic authenticator. 2019-03-31 10:35:10 +01:00
psocks.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
psusan.c FdSocket, HandleSocket: store a notional peer address. 2021-09-13 14:38:44 +01:00
pterm-config-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
pterm-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
pterm.bundle OS X makefile: stop depending on JHBUILD_PREFIX. 2017-11-26 11:45:48 +00:00
pterm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
pterm.plist Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
pty.c Separate backend_send from backend_sendbuffer. 2021-09-12 09:52:46 +01:00
putty-config-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty.bundle OS X makefile: stop depending on JHBUILD_PREFIX. 2017-11-26 11:45:48 +00:00
putty.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty.plist Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
serial.c Separate backend_send from backend_sendbuffer. 2021-09-12 09:52:46 +01:00
sftp.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
sftpserver.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
sharing.c Allow new_connection to take an optional Seat. (NFC) 2021-09-13 17:24:47 +01:00
storage.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
unicode.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
unifont.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
unifont.h Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
uppity.c FdSocket, HandleSocket: store a notional peer address. 2021-09-13 14:38:44 +01:00
uxsel.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
window.c New Seat method, notify_session_started(). 2021-09-12 11:55:55 +01:00
x11.c Unix platform_make_x11_server: fix sense of error check. 2021-09-10 10:38:30 +01:00
x11misc.h Basic support for running under GDK Wayland back end. 2018-05-09 09:21:27 +01:00