From: Timo Sirainen Date: Wed, 10 Feb 2016 16:27:52 +0000 (+0200) Subject: *-login: Pass client_auth_reply to client.auth_result() whenever possible. X-Git-Tag: 2.2.22.rc1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b107c647b2120d3906ff7d368f8a16900f6833f;p=thirdparty%2Fdovecot%2Fcore.git *-login: Pass client_auth_reply to client.auth_result() whenever possible. This didn't matter normally, but some plugins might care about it. --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index 801938a831..6baca4f954 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -552,6 +552,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, sasl_reply == SASL_SERVER_REPLY_AUTH_ABORTED || sasl_reply == SASL_SERVER_REPLY_MASTER_FAILED); + memset(&reply, 0, sizeof(reply)); switch (sasl_reply) { case SASL_SERVER_REPLY_SUCCESS: if (client->to_auth_waiting != NULL) @@ -563,7 +564,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, break; } client_auth_result(client, CLIENT_AUTH_RESULT_SUCCESS, - NULL, NULL); + &reply, NULL); client_destroy_success(client, "Login"); break; case SASL_SERVER_REPLY_AUTH_FAILED: @@ -580,14 +581,14 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, if (sasl_reply == SASL_SERVER_REPLY_AUTH_ABORTED) { client_auth_result(client, CLIENT_AUTH_RESULT_ABORTED, - NULL, "Authentication aborted by client."); + &reply, "Authentication aborted by client."); } else if (data == NULL) { client_auth_result(client, - CLIENT_AUTH_RESULT_AUTHFAILED, NULL, + CLIENT_AUTH_RESULT_AUTHFAILED, &reply, AUTH_FAILED_MSG); } else { client_auth_result(client, - CLIENT_AUTH_RESULT_AUTHFAILED_REASON, NULL, + CLIENT_AUTH_RESULT_AUTHFAILED_REASON, &reply, data); } @@ -599,7 +600,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply, /* authentication itself succeeded, we just hit some internal failure. */ client_auth_result(client, CLIENT_AUTH_RESULT_TEMPFAIL, - NULL, data); + &reply, data); } /* the fd may still be hanging somewhere in kernel or another