From 4bc94bc7d20f54d37e03bb4bb1a3182a85a0f378 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 8 Oct 2019 16:14:15 +0300 Subject: [PATCH] *-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. --- src/login-common/client-common-auth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.47.3