]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Don't assert-crash if we have the same mailbox name in conflicting namespaces.
authorTimo Sirainen <tss@iki.fi>
Thu, 3 Apr 2014 15:21:39 +0000 (18:21 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 3 Apr 2014 15:21:39 +0000 (18:21 +0300)
src/doveadm/dsync/dsync-brain-mailbox-tree.c

index 08489105bdcb98abce90df71c86c69e2c0b1627c..a415ac24d8fcc2f5f954dc4220ae57c4249202a2 100644 (file)
@@ -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;