dovecot-2.1: doveadm server: Previous non-authentication fix bro...

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 23 00:46:29 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/46e90b44d378
changeset: 13546:46e90b44d378
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 23 00:46:19 2011 +0300
description:
doveadm server: Previous non-authentication fix broken authentication.

diffstat:

 src/doveadm/server-connection.c |  14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r e932f81eba48 -r 46e90b44d378 src/doveadm/server-connection.c
--- a/src/doveadm/server-connection.c	Fri Sep 23 00:04:11 2011 +0300
+++ b/src/doveadm/server-connection.c	Fri Sep 23 00:46:19 2011 +0300
@@ -189,7 +189,6 @@
 	str_append_c(cmd, '\n');
 
 	o_stream_send(conn->output, cmd->data, cmd->used);
-	server_connection_authenticated(conn);
 	return 0;
 }
 
@@ -214,6 +213,7 @@
 				server_connection_destroy(&conn);
 				return;
 			}
+			return;
 		} else {
 			i_error("doveadm server sent invalid handshake: %s",
 				line);
@@ -228,6 +228,18 @@
 		return;
 	}
 
+	if (!conn->authenticated) {
+		if ((line = i_stream_next_line(conn->input)) == NULL)
+			return;
+		if (strcmp(line, "+") == 0)
+			server_connection_authenticated(conn);
+		else {
+			i_error("doveadm authentication failed (%s)", line+1);
+			server_connection_destroy(&conn);
+			return;
+		}
+	}
+
 	data = i_stream_get_data(conn->input, &size);
 	if (size == 0)
 		return;


More information about the dovecot-cvs mailing list