dovecot-2.0: acl: Fixed crashing on FS layout with non-default h...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 11 21:19:48 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/54807112d1d6
changeset: 11789:54807112d1d6
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 11 19:19:45 2010 +0100
description:
acl: Fixed crashing on FS layout with non-default hierarchy separator.

diffstat:

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

diffs (28 lines):

diff -r 486754f4f2ea -r 54807112d1d6 src/plugins/acl/acl-mailbox-list.c
--- a/src/plugins/acl/acl-mailbox-list.c	Sun Jul 11 18:56:39 2010 +0100
+++ b/src/plugins/acl/acl-mailbox-list.c	Sun Jul 11 19:19:45 2010 +0100
@@ -288,7 +288,8 @@
 			str_append_c(pattern, '%');
 		}
 	}
-	str_append_c(pattern, ctx->sep);
+	if (i > 0 && ctx->info.name[i-1] != ctx->sep)
+		str_append_c(pattern, ctx->sep);
 	str_append_c(pattern, '*');
 	prefix = str_c(pattern);
 	prefix_len = str_len(pattern) - 1;
@@ -329,8 +330,12 @@
 					  ACL_STORAGE_RIGHT_LOOKUP,
 					  NULL);
 	if (ret != 0) {
-		if ((info->flags & MAILBOX_CHILDREN) != 0 &&
-		    !iter_mailbox_has_visible_children(ctx, FALSE)) {
+		if ((ctx->ctx.flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) != 0) {
+			/* don't waste time checking if there are visible
+			   children, but also don't return incorrect flags */
+			info->flags &= ~MAILBOX_CHILDREN;
+		} else if ((info->flags & MAILBOX_CHILDREN) != 0 &&
+			   !iter_mailbox_has_visible_children(ctx, FALSE)) {
 			info->flags &= ~MAILBOX_CHILDREN;
 			info->flags |= MAILBOX_NOCHILDREN;
 		}


More information about the dovecot-cvs mailing list