]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login: Master login internal failures weren't handled correctly.
authorTimo Sirainen <tss@iki.fi>
Wed, 9 Jun 2010 15:37:57 +0000 (16:37 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 9 Jun 2010 15:37:57 +0000 (16:37 +0100)
--HG--
branch : HEAD

src/login-common/client-common-auth.c
src/login-common/sasl-server.c
src/login-common/sasl-server.h

index 0ee06a8536d10432b82d835df2c4043a97f990b0..3e85fb70baccae3c897992ea20e9b2f0deca5421 100644 (file)
@@ -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);
index 456a97dfc6aa77123bc4e4536ce5b8d262e419aa..073e62eeec00796d06e4e6b74bb5499c1c08c4a8 100644 (file)
@@ -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;
index b2fb2509be0c4bcbd29dc34585de9559b6335bc9..7c8940ba18912f311c07460a39cc2873838251b3 100644 (file)
@@ -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
 };