Mercurial > dovecot > core-2.2
changeset 14181:ff117a044e20
acl: Don't crash in mailbox listing when using autocreated mailboxes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 16 Feb 2012 20:04:01 +0200 |
parents | aa2e89c9876b |
children | edf5a4788242 |
files | src/plugins/acl/acl-mailbox-list.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/acl/acl-mailbox-list.c Thu Feb 16 19:16:54 2012 +0200 +++ b/src/plugins/acl/acl-mailbox-list.c Thu Feb 16 20:04:01 2012 +0200 @@ -21,7 +21,6 @@ struct mailbox_tree_context *lookup_boxes; struct mailbox_info info; - struct imap_match_glob *glob; char sep; unsigned int simple_star_glob:1; }; @@ -175,8 +174,8 @@ inboxcase = (list->ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0; ctx->sep = mail_namespace_get_sep(list->ns); - ctx->glob = imap_match_init_multiple(pool, patterns, - inboxcase, ctx->sep); + ctx->ctx.glob = imap_match_init_multiple(pool, patterns, + inboxcase, ctx->sep); /* see if all patterns have only a single '*' and it's at the end. we can use it to do some optimizations. */ ctx->simple_star_glob = TRUE; @@ -249,7 +248,7 @@ this by simply checking if name/child mailbox matches. */ child = t_strdup_printf("%s%cx", ctx->info.name, ctx->sep); return ctx->simple_star_glob && - imap_match(ctx->glob, child) == IMAP_MATCH_YES; + imap_match(ctx->ctx.glob, child) == IMAP_MATCH_YES; } static bool @@ -299,7 +298,7 @@ MAILBOX_LIST_ITER_RETURN_NO_FLAGS); while ((info = mailbox_list_iter_next(iter)) != NULL) { if (only_nonpatterns && - imap_match(ctx->glob, info->name) == IMAP_MATCH_YES) { + imap_match(ctx->ctx.glob, info->name) == IMAP_MATCH_YES) { /* at least one child matches also the original list patterns. we don't need to show this mailbox. */ ret = FALSE;