]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: userdb: Ensure changed username in auth worker gets updated in cache
authorMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 16 Mar 2020 18:56:42 +0000 (19:56 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 20 Mar 2020 07:13:28 +0000 (07:13 +0000)
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.

src/auth/userdb-blocking.c

index fd337434b1676b741180f082c42521fa04c1a2f7..af8477fab8eaa3f3868336629b2f8a5fd70d7751 100644 (file)
@@ -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");