Mercurial > dovecot > core-2.2
changeset 10148:9df00624855b HEAD
mail storage service: Fixed iterating through all users.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 22 Oct 2009 21:00:22 -0400 |
parents | ef1ca7e1a9f9 |
children | 6fcc5a684b83 |
files | src/lib-storage/mail-storage-service.c |
diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-storage-service.c Thu Oct 22 20:53:27 2009 -0400 +++ b/src/lib-storage/mail-storage-service.c Thu Oct 22 21:00:22 2009 -0400 @@ -803,11 +803,34 @@ pool_unref(&user->pool); } +static void +mail_storage_service_all_init_first(struct mail_storage_service_ctx *ctx) +{ + const struct setting_parser_info *user_info; + const struct mail_user_settings *user_set; + const char *error; + void **sets; + pool_t temp_pool; + + temp_pool = pool_alloconly_create("service all settings", 4096); + if (mail_storage_service_read_settings(ctx, NULL, temp_pool, + &user_info, &error) < 0) + i_fatal("%s", error); + sets = settings_parser_get_list(ctx->service->set_parser); + user_set = sets[1]; + + mail_storage_service_first_init(ctx, user_info, user_set); + pool_unref(&temp_pool); +} + unsigned int mail_storage_service_all_init(struct mail_storage_service_ctx *ctx) { if (ctx->auth_list != NULL) (void)auth_master_user_list_deinit(&ctx->auth_list); + if (ctx->conn == NULL) + mail_storage_service_all_init_first(ctx); + ctx->auth_list = auth_master_user_list_init(ctx->conn); return auth_master_user_list_count(ctx->auth_list); }