From: Timo Sirainen Date: Tue, 8 Oct 2019 13:14:15 +0000 (+0300) Subject: *-login: Fix potential hangs with SSL connections X-Git-Tag: 2.3.9~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bc94bc7d20f54d37e03bb4bb1a3182a85a0f378;p=thirdparty%2Fdovecot%2Fcore.git *-login: Fix potential hangs with SSL connections 1) Multi-step SASL authentication could hang when login process waits for response from a client, but it has already pipelined it together with the AUTH/AUTHENTICATE command. 2) After failed authentication commands could start hanging. --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index cb20f554d9..5d5d770f9d 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -74,7 +74,7 @@ static void client_auth_failed(struct client *client) io_remove(&client->io); if (!client_does_custom_io(client)) { - client->io = io_add(client->fd, IO_READ, client_input, client); + client->io = io_add_istream(client->input, client_input, client); io_set_pending(client->io); } } @@ -763,8 +763,8 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, i_assert(client->io == NULL); client->auth_waiting = TRUE; if (!client_does_custom_io(client)) { - client->io = io_add(client->fd, IO_READ, - client_auth_input, client); + client->io = io_add_istream(client->input, + client_auth_input, client); client_auth_input(client); } return;