1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -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

View File

@ -530,7 +530,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
bool mid_line = false;
while (bufchain_size(&s->banner) > 0) {
ptrlen data = bufchain_prefix(&s->banner);
seat_stderr_pl(s->ppl.seat, data);
seat_banner_pl(s->ppl.seat, data);
mid_line =
(((const char *)data.ptr)[data.len-1] != '\n');
bufchain_consume(&s->banner, data.len);
@ -538,7 +538,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
bufchain_clear(&s->banner);
if (mid_line)
seat_stderr_pl(s->ppl.seat, PTRLEN_LITERAL("\r\n"));
seat_banner_pl(s->ppl.seat, PTRLEN_LITERAL("\r\n"));
if (s->banner_scc) {
seat_set_trust_status(s->ppl.seat, true);
@ -1919,6 +1919,6 @@ static void ssh2_userauth_antispoof_msg(
put_byte(sb, '-');
}
put_datapl(sb, PTRLEN_LITERAL("\r\n"));
seat_stderr_pl(s->ppl.seat, ptrlen_from_strbuf(sb));
seat_banner_pl(s->ppl.seat, ptrlen_from_strbuf(sb));
strbuf_free(sb);
}