Mercurial > dovecot > core-2.2
changeset 9287:6557ed6fc4e1 HEAD
userdb passwd-file: Fixes to user listing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 15 May 2009 15:08:37 -0400 |
parents | 22369ac2c99c |
children | 77d6b5eb0963 |
files | src/auth/userdb-passwd-file.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/userdb-passwd-file.c Fri May 15 13:06:15 2009 -0400 +++ b/src/auth/userdb-passwd-file.c Fri May 15 15:08:37 2009 -0400 @@ -88,7 +88,7 @@ userdb_iter_callback_t *callback, void *context) { struct passwd_file_userdb_module *module = - (struct passwd_file_userdb_module *)userdb; + (struct passwd_file_userdb_module *)userdb->userdb; struct passwd_file_userdb_iterate_context *ctx; int fd; @@ -96,6 +96,12 @@ ctx->ctx.userdb = userdb->userdb; ctx->ctx.callback = callback; ctx->ctx.context = context; + if (module->pwf->default_file == NULL) { + i_error("passwd-file: User iteration isn't currently supported " + "with %%variable paths"); + ctx->ctx.failed = TRUE; + return &ctx->ctx; + } ctx->path = i_strdup(module->pwf->default_file->path); /* for now we support only a single passwd-file */ @@ -137,7 +143,8 @@ (struct passwd_file_userdb_iterate_context *)_ctx; int ret = _ctx->failed ? -1 : 0; - i_stream_destroy(&ctx->input); + if (ctx->input != NULL) + i_stream_destroy(&ctx->input); i_free(ctx->path); i_free(ctx); return ret;