Mercurial > dovecot > core-2.2
changeset 13008:a7f1980d250c
acl: Don't waste time doing ACL checks for IMAP LSUB command.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 10 May 2011 17:46:50 +0300 |
parents | 40a5f8f07bd2 |
children | b74dfa49692b |
files | src/plugins/acl/acl-mailbox-list.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/acl/acl-mailbox-list.c Tue May 10 01:24:34 2011 +0300 +++ b/src/plugins/acl/acl-mailbox-list.c Tue May 10 17:46:50 2011 +0300 @@ -321,6 +321,14 @@ return 1; } + if ((ctx->ctx.flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0 && + (ctx->ctx.flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) != 0) { + /* don't waste time doing an ACL check. we're going to list + all subscriptions anyway. */ + info->flags &= MAILBOX_SUBSCRIBED | MAILBOX_CHILD_SUBSCRIBED; + return 1; + } + acl_name = acl_mailbox_list_iter_get_name(&ctx->ctx, info->name); ret = acl_mailbox_list_have_right(ctx->ctx.list, acl_name, FALSE, ACL_STORAGE_RIGHT_LOOKUP,