1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 04:52:47 -05:00

seat_output: add an output type for SSH banners. (NFC)

The jump host system ought really to be treating SSH authentication
banners as a distinct thing from the standard-error session output, so
that the former can be presented to the user in the same way as the
auth banner for the main session.

This change converts the 'bool is_stderr' parameter of seat_output()
into an enumerated type with three values. For the moment, stderr and
banners are treated the same, but the plan is for that to change.
This commit is contained in:
Simon Tatham
2021-09-16 14:46:49 +01:00
parent a45ae81797
commit ac47e550c6
12 changed files with 70 additions and 43 deletions

11
psftp.c
View File

@ -41,7 +41,7 @@ static bool sent_eof = false;
* Seat vtable.
*/
static size_t psftp_output(Seat *, bool is_stderr, const void *, size_t);
static size_t psftp_output(Seat *, SeatOutputType type, const void *, size_t);
static bool psftp_eof(Seat *);
static const SeatVtable psftp_seat_vt = {
@ -2461,13 +2461,14 @@ void ldisc_check_sendok(Ldisc *ldisc) { }
static bufchain received_data;
static BinarySink *stderr_bs;
static size_t psftp_output(
Seat *seat, bool is_stderr, const void *data, size_t len)
Seat *seat, SeatOutputType type, const void *data, size_t len)
{
/*
* stderr data is just spouted to local stderr (optionally via a
* sanitiser) and otherwise ignored.
* Non-stdout data (both stderr and SSH auth banners) is just
* spouted to local stderr (optionally via a sanitiser) and
* otherwise ignored.
*/
if (is_stderr) {
if (type != SEAT_OUTPUT_STDOUT) {
put_data(stderr_bs, data, len);
return 0;
}