dovecot-2.1: login: Log a different disconnect message if client...

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 19 23:05:13 EET 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/679837ca1c95
changeset: 13733:679837ca1c95
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 19 23:04:54 2011 +0200
description:
login: Log a different disconnect message if client didn't finish SASL auth.

diffstat:

 src/login-common/client-common-auth.c |  2 ++
 src/login-common/client-common.c      |  4 ++++
 src/login-common/client-common.h      |  1 +
 src/login-common/sasl-server.c        |  1 +
 4 files changed, 8 insertions(+), 0 deletions(-)

diffs (55 lines):

diff -r 9d022d3fba42 -r 679837ca1c95 src/login-common/client-common-auth.c
--- a/src/login-common/client-common-auth.c	Sat Nov 19 22:29:31 2011 +0200
+++ b/src/login-common/client-common-auth.c	Sat Nov 19 23:04:54 2011 +0200
@@ -371,6 +371,7 @@
 	if (client->v.auth_parse_response(client) <= 0)
 		return;
 
+	client->auth_waiting = FALSE;
 	client_set_auth_waiting(client);
 	auth_client_request_continue(client->auth_request,
 				     str_c(client->auth_response));
@@ -468,6 +469,7 @@
 		str_truncate(client->auth_response, 0);
 
 		i_assert(client->io == NULL);
+		client->auth_waiting = TRUE;
 		client->io = io_add(client->fd, IO_READ,
 				    client_auth_input, client);
 		client_auth_input(client);
diff -r 9d022d3fba42 -r 679837ca1c95 src/login-common/client-common.c
--- a/src/login-common/client-common.c	Sat Nov 19 22:29:31 2011 +0200
+++ b/src/login-common/client-common.c	Sat Nov 19 23:04:54 2011 +0200
@@ -529,6 +529,10 @@
 		return "(cert required, client didn't start TLS)";
 	if (client->auth_tried_unsupported_mech)
 		return "(tried to use unsupported auth mechanism)";
+	if (client->auth_waiting && client->auth_attempts == 1) {
+		return t_strdup_printf("(client didn't finish SASL auth, "
+				       "waited %u secs)", auth_secs);
+	}
 	if (client->auth_request != NULL && client->auth_attempts == 1) {
 		return t_strdup_printf("(disconnected while authenticating, "
 				       "waited %u secs)", auth_secs);
diff -r 9d022d3fba42 -r 679837ca1c95 src/login-common/client-common.h
--- a/src/login-common/client-common.h	Sat Nov 19 22:29:31 2011 +0200
+++ b/src/login-common/client-common.h	Sat Nov 19 23:04:54 2011 +0200
@@ -126,6 +126,7 @@
 	unsigned int auth_try_aborted:1;
 	unsigned int auth_initializing:1;
 	unsigned int auth_process_comm_fail:1;
+	unsigned int auth_waiting:1;
 	/* ... */
 };
 
diff -r 9d022d3fba42 -r 679837ca1c95 src/login-common/sasl-server.c
--- a/src/login-common/sasl-server.c	Sat Nov 19 22:29:31 2011 +0200
+++ b/src/login-common/sasl-server.c	Sat Nov 19 23:04:54 2011 +0200
@@ -212,6 +212,7 @@
 		i_assert(status < 0);
 		return;
 	}
+	client->auth_waiting = FALSE;
 
 	i_assert(client->auth_request == request);
 	switch (status) {


More information about the dovecot-cvs mailing list