From: Timo Sirainen Date: Thu, 3 Apr 2014 15:21:39 +0000 (+0300) Subject: dsync: Don't assert-crash if we have the same mailbox name in conflicting namespaces. X-Git-Tag: 2.2.13.rc1~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22c646fc87e87f33008f55220d60961f98c9eb3e;p=thirdparty%2Fdovecot%2Fcore.git dsync: Don't assert-crash if we have the same mailbox name in conflicting namespaces. --- diff --git a/src/doveadm/dsync/dsync-brain-mailbox-tree.c b/src/doveadm/dsync/dsync-brain-mailbox-tree.c index 08489105bd..a415ac24d8 100644 --- a/src/doveadm/dsync/dsync-brain-mailbox-tree.c +++ b/src/doveadm/dsync/dsync-brain-mailbox-tree.c @@ -387,7 +387,14 @@ dsync_brain_mailbox_tree_add_delete(struct dsync_mailbox_tree *tree, memcpy(other_node->mailbox_guid, node->mailbox_guid, sizeof(other_node->mailbox_guid)); } - i_assert(other_node->ns == NULL || other_node->ns == node->ns); + if (other_node->ns != node->ns && other_node->ns != NULL) { + /* namespace mismatch for this node. this shouldn't happen + normally, but especially during some misconfigurations it's + possible that one side has created mailboxes that conflict + with another namespace's prefix. since we're here because + one of the mailboxes was deleted, we'll just ignore this. */ + return; + } other_node->ns = node->ns; if (other_del->type != DSYNC_MAILBOX_DELETE_TYPE_UNSUBSCRIBE) other_node->existence = DSYNC_MAILBOX_NODE_DELETED;