]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: Make authentication failures more consistent
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 31 Mar 2017 07:57:14 +0000 (10:57 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 3 Apr 2017 11:53:18 +0000 (14:53 +0300)
This way they always say the same prefix, which is easier to
spot.

src/lib-imap-client/imapc-connection.c

index a58eecc342d67bb9efbdd639de5d036ce52a2860..2675f61f7e7b44bf96a93e20739b26a7373c0a78 100644 (file)
@@ -160,11 +160,14 @@ imapc_auth_ok(struct imapc_connection *conn)
 }
 
 static void
-imapc_auth_failed(struct imapc_connection *conn, const struct imapc_command_reply *reply,
+imapc_auth_failed(struct imapc_connection *conn, const struct imapc_command_reply *_reply,
                  const char *error)
 {
-       i_error("imapc(%s): Authentication failed: %s", conn->name, error);
-       imapc_login_callback(conn, reply);
+       struct imapc_command_reply reply = *_reply;
+       reply.text_without_resp = reply.text_full =
+               t_strdup_printf("Authentication failed: %s", error);
+       i_error("imapc(%s): %s", conn->name, reply.text_full);
+       imapc_login_callback(conn, &reply);
 
        if (conn->client->state_change_callback == NULL)
                return;