]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 3 Apr 2017 19:10:29 +0000 (22:10 +0300)
This way they always say the same prefix, which is easier to
spot.

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

index 2423618ebb53a2ca61661236c70eb6b8cc316369..be6b95260dbc9e85a5cc413e52b47c31545ab74c 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;