dovecot-2.2: acl: Avoid assert-crashing when trying to access sh...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 12:40:27 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/4d0d3cc20bdb
changeset: 15261:4d0d3cc20bdb
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 12:40:14 2012 +0200
description:
acl: Avoid assert-crashing when trying to access shared namespace root "mailboxes".

diffstat:

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

diffs (17 lines):

diff -r 26236c4e5736 -r 4d0d3cc20bdb src/plugins/acl/acl-mailbox.c
--- a/src/plugins/acl/acl-mailbox.c	Fri Oct 26 11:12:36 2012 +0300
+++ b/src/plugins/acl/acl-mailbox.c	Mon Oct 29 12:40:14 2012 +0200
@@ -524,6 +524,13 @@
 		return;
 	}
 
+	if (box->list->ns->type == MAIL_NAMESPACE_TYPE_SHARED &&
+	    (box->list->ns->flags & NAMESPACE_FLAG_AUTOCREATED) == 0) {
+		/* this is the root shared namespace, which itself doesn't
+		   have any existing mailboxes. */
+		return;
+	}
+
 	abox = p_new(box->pool, struct acl_mailbox, 1);
 	abox->module_ctx.super = *v;
 	box->vlast = &abox->module_ctx.super;


More information about the dovecot-cvs mailing list