From: Aki Tuomi Date: Wed, 29 Mar 2017 13:15:36 +0000 (+0300) Subject: auth: Do not cache username unless it was changed by lookup X-Git-Tag: 2.2.29.rc1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2bdba68268556cc7c3d0fdd05a0454ad6d4639d;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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');