# HG changeset patch # User Timo Sirainen # Date 1179347938 -10800 # Node ID 139416ee311e41aded4e65f4437abb137ae6a470 # Parent 3e711b998274c99e88f8689fbdd583af97042a5c If wanted scheme is "" (userdb static lookup), switch it to the actual scheme we got. This should make caching work right for those lookups. diff -r 3e711b998274 -r 139416ee311e src/auth/passdb.c --- a/src/auth/passdb.c Wed May 16 21:50:16 2007 +0300 +++ b/src/auth/passdb.c Wed May 16 23:38:58 2007 +0300 @@ -61,13 +61,6 @@ const char *plaintext; int ret; - if (*wanted_scheme == '\0') { - /* anything goes */ - *credentials_r = (const unsigned char *)input; - *size_r = strlen(input); - return TRUE; - } - ret = password_decode(input, input_scheme, credentials_r, size_r); if (ret <= 0) { if (ret < 0) { @@ -81,6 +74,14 @@ return FALSE; } + if (*wanted_scheme == '\0') { + /* anything goes. change the credentials_scheme to what we + actually got, so blocking passdbs work. */ + auth_request->credentials_scheme = + p_strdup(auth_request->pool, input_scheme); + return TRUE; + } + if (!password_scheme_is_alias(input_scheme, wanted_scheme)) { if (!password_scheme_is_alias(input_scheme, "PLAIN")) { auth_request_log_info(auth_request, "password",