From 4cae45ed02f6a16e3368bf67fc55a7ab65e7bbae Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sat, 10 Aug 2019 00:33:21 +0200 Subject: [PATCH] login-common: Fix sending locally-generated authentication error reason to client. 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index 4992c73d11..72555e1afd 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -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; -- 2.47.3