From: Timo Sirainen Date: Thu, 22 Sep 2011 21:46:19 +0000 (+0300) Subject: doveadm server: Previous non-authentication fix broken authentication. X-Git-Tag: 2.1.beta1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30eb745a4fb4a16dde979cd8db7ab18f5f0c0e2e;p=thirdparty%2Fdovecot%2Fcore.git doveadm server: Previous non-authentication fix broken authentication. --- diff --git a/src/doveadm/server-connection.c b/src/doveadm/server-connection.c index 9060bf460f..bb75247ae8 100644 --- a/src/doveadm/server-connection.c +++ b/src/doveadm/server-connection.c @@ -189,7 +189,6 @@ server_connection_authenticate(struct server_connection *conn) str_append_c(cmd, '\n'); o_stream_send(conn->output, cmd->data, cmd->used); - server_connection_authenticated(conn); return 0; } @@ -214,6 +213,7 @@ static void server_connection_input(struct server_connection *conn) server_connection_destroy(&conn); return; } + return; } else { i_error("doveadm server sent invalid handshake: %s", line); @@ -228,6 +228,18 @@ static void server_connection_input(struct server_connection *conn) 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;