From: Timo Sirainen Date: Wed, 9 Jun 2010 15:37:57 +0000 (+0100) Subject: login: Master login internal failures weren't handled correctly. X-Git-Tag: 2.0.beta6~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a23d586f07ec376e28e8f6f3f3392a4ac8b83bb;p=thirdparty%2Fdovecot%2Fcore.git login: Master login internal failures weren't handled correctly. --HG-- branch : HEAD --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index 0ee06a8536..3e85fb70ba 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -382,7 +382,6 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, i_assert(!client->destroyed || sasl_reply == SASL_SERVER_REPLY_AUTH_ABORTED || - sasl_reply == SASL_SERVER_REPLY_MASTER_ABORTED || sasl_reply == SASL_SERVER_REPLY_MASTER_FAILED); switch (sasl_reply) { @@ -423,19 +422,17 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, client_auth_failed(client); break; case SASL_SERVER_REPLY_MASTER_FAILED: - if (data == NULL) - client_destroy_internal_failure(client); - else { - client_send_line(client, - CLIENT_CMD_REPLY_AUTH_FAIL_TEMP, data); + if (data != NULL) { /* authentication itself succeeded, we just hit some internal failure. */ - client_destroy_success(client, data); + client_send_line(client, + CLIENT_CMD_REPLY_AUTH_FAIL_TEMP, data); } - break; - case SASL_SERVER_REPLY_MASTER_ABORTED: - /* mail process already sent the error message to client */ - client_destroy_success(client, data); + + if (data == NULL) + client_destroy_internal_failure(client); + else + client_destroy_success(client, data); break; case SASL_SERVER_REPLY_CONTINUE: client->v.auth_send_challenge(client, data); diff --git a/src/login-common/sasl-server.c b/src/login-common/sasl-server.c index 456a97dfc6..073e62eeec 100644 --- a/src/login-common/sasl-server.c +++ b/src/login-common/sasl-server.c @@ -100,7 +100,7 @@ master_auth_callback(const struct master_auth_reply *reply, void *context) sasl_reply = SASL_SERVER_REPLY_SUCCESS; break; case MASTER_AUTH_STATUS_INTERNAL_ERROR: - sasl_reply = SASL_SERVER_REPLY_MASTER_ABORTED; + sasl_reply = SASL_SERVER_REPLY_MASTER_FAILED; break; } client->mail_pid = reply->mail_pid; diff --git a/src/login-common/sasl-server.h b/src/login-common/sasl-server.h index b2fb2509be..7c8940ba18 100644 --- a/src/login-common/sasl-server.h +++ b/src/login-common/sasl-server.h @@ -8,7 +8,6 @@ enum sasl_server_reply { SASL_SERVER_REPLY_AUTH_FAILED, SASL_SERVER_REPLY_AUTH_ABORTED, SASL_SERVER_REPLY_MASTER_FAILED, - SASL_SERVER_REPLY_MASTER_ABORTED, SASL_SERVER_REPLY_CONTINUE };