# HG changeset patch # User Timo Sirainen # Date 1128681792 -10800 # Node ID 81180ca12997764d45668f140686a1c5b222c31b # Parent 6a94b841263853cf323655c6e677cad79cb1782c We were caching failed blocking requests wrong. diff -r 6a94b8412638 -r 81180ca12997 src/auth/auth-request.c --- a/src/auth/auth-request.c Fri Oct 07 13:23:01 2005 +0300 +++ b/src/auth/auth-request.c Fri Oct 07 13:43:12 2005 +0300 @@ -184,21 +184,24 @@ return; } + if (request->passdb_password == NULL) { + /* save to cache only if we know the password */ + return; + } + /* save all except the currently given password in cache */ str = t_str_new(256); - if (request->passdb_password != NULL) { - if (*request->passdb_password != '{') { - /* cached passwords must have a known scheme */ - str_append_c(str, '{'); - str_append(str, passdb->default_pass_scheme); - str_append_c(str, '}'); - } - if (strchr(request->passdb_password, '\t') != NULL) - i_panic("%s: Password contains TAB", request->user); - if (strchr(request->passdb_password, '\n') != NULL) - i_panic("%s: Password contains LF", request->user); - str_append(str, request->passdb_password); + if (*request->passdb_password != '{') { + /* cached passwords must have a known scheme */ + str_append_c(str, '{'); + str_append(str, passdb->default_pass_scheme); + str_append_c(str, '}'); } + if (strchr(request->passdb_password, '\t') != NULL) + i_panic("%s: Password contains TAB", request->user); + if (strchr(request->passdb_password, '\n') != NULL) + i_panic("%s: Password contains LF", request->user); + str_append(str, request->passdb_password); if (extra_fields != NULL) { str_append_c(str, '\t');