]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Avoid assert-crashing when trying to access shared namespace root "mailboxes".
authorTimo Sirainen <tss@iki.fi>
Mon, 29 Oct 2012 10:40:14 +0000 (12:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 29 Oct 2012 10:40:14 +0000 (12:40 +0200)
src/plugins/acl/acl-mailbox.c

index 286e1c112f0958f3f0ca8d369c9c9e1b2c9d152a..59957b5791f48fc263aadf24bcbc74aaf08dcd29 100644 (file)
@@ -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;