]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Don't call client_input() directly in client_auth_failed()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 3 Sep 2019 12:43:49 +0000 (15:43 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 3 Sep 2019 12:43:49 +0000 (15:43 +0300)
Fixes a new assert-crash caused by
9aaf0554aeae4f8056eeef56cfd99bf386f4c009:

Panic: file sasl-server.c: line 357 (authenticate_callback): assertion failed: (!client->authenticating)

This was caused by a code path:
 - sasl_server_check_login()
 - sasl_server_auth_failed()
 - sasl_server_auth_cancel()
 - call_client_callback()
 - sasl_callback()
 - client_auth_failed()
 - client_input()
 - another AUTHENTICATE/LOGIN was read

The solution is then to not call client_input() directly. It would have
also worked to just remove the assert though, but this fix is cleaner.

src/login-common/client-common-auth.c

index a51c4a2e87f13bba2fc981fdcb41c2b566b81027..0ba0c1c9584a514d275ac2a1d1080ae7a911fc69 100644 (file)
@@ -75,7 +75,7 @@ static void client_auth_failed(struct client *client)
 
        if (!client_does_custom_io(client)) {
                client->io = io_add(client->fd, IO_READ, client_input, client);
-               client_input(client);
+               io_set_pending(client->io);
        }
 }