ssh2 conn: don't accept user input until mainchan is ready.

s->want_user_input is set and unset in response to fluctuations of the
main channel's available SSH window size. But that means it can become
TRUE before a command has been successfully started, which we don't
want, because pscp.c uses backend_sendok() to determine when it's safe
to check the flag that tells it whether to speak the SFTP or SCP1
protocol. So we want to ensure we never return true from that backend
method until we know which command we're running.
This commit is contained in:
Simon Tatham 2018-10-02 18:37:32 +01:00
Родитель 78e280a1cd
Коммит 72a8c8c471
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2480,7 +2480,7 @@ static int ssh2_connection_want_user_input(PacketProtocolLayer *ppl)
{
struct ssh2_connection_state *s =
FROMFIELD(ppl, struct ssh2_connection_state, ppl);
return s->want_user_input;
return s->mainchan_ready && s->want_user_input;
}
static void ssh2_connection_got_user_input(PacketProtocolLayer *ppl)