Mercurial > dovecot > core-2.2
changeset 3645:81180ca12997 HEAD
We were caching failed blocking requests wrong.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 07 Oct 2005 13:43:12 +0300 |
parents | 6a94b8412638 |
children | f50496e14ac8 |
files | src/auth/auth-request.c |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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');