From: Timo Sirainen Date: Mon, 18 Jan 2016 10:31:26 +0000 (+0200) Subject: quota: Fixed namespace filtering for dict and count backends. X-Git-Tag: 2.2.22.rc1~339 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c80cf58a347d1b6777e12b3bdd38cc52f6a45f73;p=thirdparty%2Fdovecot%2Fcore.git quota: Fixed namespace filtering for dict and count backends. --- diff --git a/src/plugins/quota/quota-count.c b/src/plugins/quota/quota-count.c index aaf5d28a39..15ef14e95c 100644 --- a/src/plugins/quota/quota-count.c +++ b/src/plugins/quota/quota-count.c @@ -100,10 +100,12 @@ quota_mailbox_iter_next(struct quota_mailbox_iter *iter) if (iter->iter == NULL) { namespaces = array_get(&iter->root->quota->namespaces, &count); - if (iter->ns_idx >= count) - return NULL; + do { + if (iter->ns_idx >= count) + return NULL; - iter->ns = namespaces[iter->ns_idx++]; + iter->ns = namespaces[iter->ns_idx++]; + } while (!quota_root_is_namespace_visible(iter->root, iter->ns)); iter->iter = mailbox_list_iter_init(iter->ns->list, "*", MAILBOX_LIST_ITER_SKIP_ALIASES | MAILBOX_LIST_ITER_RETURN_NO_FLAGS |