]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: Fix potential hangs with SSL connections
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 8 Oct 2019 13:14:15 +0000 (16:14 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 10 Oct 2019 13:39:23 +0000 (13:39 +0000)
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

index cb20f554d97995d3eda1d49fde5fed5e8bf99d20..5d5d770f9dd5c3b64585cdda980e7480e075b268 100644 (file)
@@ -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;