From: Markus Valentin Date: Mon, 16 Mar 2020 18:56:42 +0000 (+0100) Subject: auth: userdb: Ensure changed username in auth worker gets updated in cache X-Git-Tag: 2.3.11.2~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a606bcaf67099f9cf6fcb5bd03383e5464caa0b;p=thirdparty%2Fdovecot%2Fcore.git auth: userdb: Ensure changed username in auth worker gets updated in cache If a username gets changed and auth cache is in use, auth-workers for blocking userdb did not update the username in cache. This is now fixed by setting user_changed_by_lookup in case the username changed. --- diff --git a/src/auth/userdb-blocking.c b/src/auth/userdb-blocking.c index fd337434b1..af8477fab8 100644 --- a/src/auth/userdb-blocking.c +++ b/src/auth/userdb-blocking.c @@ -34,8 +34,10 @@ static bool user_callback(const char *reply, void *context) args = ""; else username = t_strdup_until(username, args++); - if (username[0] != '\0' && strcmp(request->user, username) != 0) + if (username[0] != '\0' && strcmp(request->user, username) != 0) { request->user = p_strdup(request->pool, username); + request->user_changed_by_lookup = TRUE; + } } else { result = USERDB_RESULT_INTERNAL_FAILURE; i_error("BUG: auth-worker sent invalid user reply");