]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Fix sending locally-generated authentication error reason to client.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 9 Aug 2019 22:33:21 +0000 (00:33 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 10 Aug 2019 17:49:55 +0000 (19:49 +0200)
This is about authentication errors that emerge at the login service rather than
the auth service. The error reason was always substituted with an unhelpful
"Authentication failed", while e.g. an error like "Unsupported authentication
mechanism" was supposed to be sent instead.

src/login-common/client-common-auth.c

index 4992c73d116b7e8946ebfc99ff4a8ff1cef422a9..72555e1afdf354708ea00bb46235c93179df2c97 100644 (file)
@@ -694,6 +694,8 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
                timeout_remove(&client->to_auth_waiting);
                if (args != NULL) {
                        client_auth_parse_args(client, FALSE, args, &reply);
+                       if (reply.reason == NULL)
+                               reply.reason = data;
                        client->last_auth_fail = reply.fail_code;
                        reply.nologin = TRUE;
                        reply.all_fields = args;