From: Timo Sirainen Date: Mon, 29 Oct 2012 10:40:14 +0000 (+0200) Subject: acl: Avoid assert-crashing when trying to access shared namespace root "mailboxes". X-Git-Tag: 2.2.alpha1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9dbce68b8bf10026e05721fdf3206279d64cb8a;p=thirdparty%2Fdovecot%2Fcore.git acl: Avoid assert-crashing when trying to access shared namespace root "mailboxes". --- diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index 286e1c112f..59957b5791 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -524,6 +524,13 @@ void acl_mailbox_allocated(struct mailbox *box) 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;