dovecot-2.0: acl: Don't waste time doing ACL checks for IMAP LSU...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 10 17:46:58 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/a7f1980d250c
changeset: 12786:a7f1980d250c
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 10 17:46:50 2011 +0300
description:
acl: Don't waste time doing ACL checks for IMAP LSUB command.

diffstat:

 src/plugins/acl/acl-mailbox-list.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 40a5f8f07bd2 -r a7f1980d250c src/plugins/acl/acl-mailbox-list.c
--- 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,


More information about the dovecot-cvs mailing list