dovecot-2.2: dsync: Fixed renaming duplicate mailbox GUIDs.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 3 20:53:40 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/9b2900369a72
changeset: 17435:9b2900369a72
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 03 23:52:39 2014 +0300
description:
dsync: Fixed renaming duplicate mailbox GUIDs.
We were trying to use only the last part of the hierarchical name instead of
the full name.

diffstat:

 src/doveadm/dsync/dsync-mailbox-tree-fill.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 5c877bca95e5 -r 9b2900369a72 src/doveadm/dsync/dsync-mailbox-tree-fill.c
--- a/src/doveadm/dsync/dsync-mailbox-tree-fill.c	Mon Jun 02 23:58:26 2014 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-tree-fill.c	Tue Jun 03 23:52:39 2014 +0300
@@ -231,6 +231,7 @@
 	struct mailbox *box;
 	struct mailbox_update update;
 	struct dsync_mailbox_node *change_node;
+	const char *change_vname;
 	int ret = 0;
 
 	memset(&update, 0, sizeof(update));
@@ -244,19 +245,19 @@
 	else
 		change_node = node2;
 
+	change_vname = dsync_mailbox_node_get_full_name(tree, change_node);
 	i_error("Duplicate mailbox GUID %s for mailboxes %s and %s - "
 		"giving a new GUID %s to %s",
 		guid_128_to_string(node1->mailbox_guid),
 		dsync_mailbox_node_get_full_name(tree, node1),
 		dsync_mailbox_node_get_full_name(tree, node2),
-		guid_128_to_string(update.mailbox_guid),
-		dsync_mailbox_node_get_full_name(tree, change_node));
+		guid_128_to_string(update.mailbox_guid), change_vname);
 
 	i_assert(node1->ns != NULL && node2->ns != NULL);
-	box = mailbox_alloc(change_node->ns->list, change_node->name, 0);
+	box = mailbox_alloc(change_node->ns->list, change_vname, 0);
 	if (mailbox_update(box, &update) < 0) {
 		i_error("Couldn't update mailbox %s GUID: %s",
-			change_node->name, mailbox_get_last_error(box, NULL));
+			change_vname, mailbox_get_last_error(box, NULL));
 		ret = -1;
 	} else {
 		memcpy(change_node->mailbox_guid, update.mailbox_guid,


More information about the dovecot-cvs mailing list