From c2bdba68268556cc7c3d0fdd05a0454ad6d4639d Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 29 Mar 2017 16:15:36 +0300 Subject: [PATCH] auth: Do not cache username unless it was changed by lookup This could've caused usernames to be unexpectedly changed because they were cached by a lookup that did not include username in the cache key. --- src/auth/auth-request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index 6062f49655..66729de68a 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -1243,7 +1243,7 @@ static void auth_request_userdb_save_cache(struct auth_request *request, auth_fields_append(request->userdb_reply, str, AUTH_FIELD_FLAG_CHANGED, AUTH_FIELD_FLAG_CHANGED); - if (strcmp(request->user, request->translated_username) != 0) { + if (request->user_changed_by_lookup) { /* username was changed by passdb or userdb */ if (str_len(str) > 0) str_append_c(str, '\t'); -- 2.47.3