1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Revise the API for seat_stripctrl_new.

Now instead of taking raw arguments to configure the output
StripCtrlChars with, it takes an enumerated value giving the context
of what's being sanitised, and allows the seat to decide what the
output parameters for that context should be.

The only context currently used is SIC_BANNER (SSH login banners).
I've also added a not-yet-used one for keyboard-interactive prompts.
This commit is contained in:
Simon Tatham
2019-03-07 08:19:38 +00:00
parent d049f0ab6c
commit d05d2e259f
7 changed files with 26 additions and 22 deletions

View File

@ -388,10 +388,10 @@ static void console_eventlog(LogPolicy *lp, const char *string)
console_logging_error(lp, string);
}
StripCtrlChars *console_stripctrl_new(Seat *seat, BinarySink *bs_out,
bool permit_cr, wchar_t substitution)
StripCtrlChars *console_stripctrl_new(
Seat *seat, BinarySink *bs_out, SeatInteractionContext sic)
{
return stripctrl_new(bs_out, permit_cr, substitution);
return stripctrl_new(bs_out, false, 0);
}
static void console_data_untrusted(HANDLE hout, const char *data, size_t len)

View File

@ -320,10 +320,10 @@ bool win_seat_get_window_pixel_size(Seat *seat, int *x, int *y)
return true;
}
StripCtrlChars *win_seat_stripctrl_new(Seat *seat, BinarySink *bs_out,
bool permit_cr, wchar_t substitution)
StripCtrlChars *win_seat_stripctrl_new(
Seat *seat, BinarySink *bs_out, SeatInteractionContext sic)
{
return stripctrl_new_term(bs_out, permit_cr, substitution, term);
return stripctrl_new_term(bs_out, false, 0, term);
}
static size_t win_seat_output(