dovecot-2.2: doveadm backup: Try to avoid crashing on unexpected...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Mar 3 17:48:58 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/fdc7a0a2b18d
changeset: 18288:fdc7a0a2b18d
user: Timo Sirainen <tss at iki.fi>
date: Tue Mar 03 19:48:23 2015 +0200
description:
doveadm backup: Try to avoid crashing on unexpected destination changes.
It's a bit difficult to reproduce this bug.. But at least this change should
change the assert, if nothing else.
diffstat:
src/doveadm/dsync/dsync-mailbox-tree-sync.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (39 lines):
diff -r 06c4c42549a7 -r fdc7a0a2b18d src/doveadm/dsync/dsync-mailbox-tree-sync.c
--- a/src/doveadm/dsync/dsync-mailbox-tree-sync.c Tue Mar 03 19:34:59 2015 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-tree-sync.c Tue Mar 03 19:48:23 2015 +0200
@@ -663,14 +663,16 @@
remote_node1, local_node1, reason_r);
*reason_r = t_strconcat(*reason_r, "(local: remote_node1=NULL)", NULL);
return TRUE;
- } else if (node_has_parent(local_node1, local_node2)) {
+ } else if (node_has_parent(local_node1, local_node2) &&
+ ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_LOCAL) {
/* node2 is a parent of node1, but it should be
vice versa */
sync_rename_node_to_temp(ctx, ctx->local_tree,
local_node1, local_node2->parent, reason_r);
*reason_r = t_strconcat(*reason_r, "(local: node2 parent of node1)", NULL);
return TRUE;
- } else if (node_has_parent(local_node2, local_node1)) {
+ } else if (node_has_parent(local_node2, local_node1) &&
+ ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_LOCAL) {
/* node1 is a parent of node2, but it should be
vice versa */
sync_rename_node_to_temp(ctx, ctx->local_tree,
@@ -702,12 +704,14 @@
local_node2, remote_node2, reason_r);
*reason_r = t_strconcat(*reason_r, "(remote: local_node2=NULL)", NULL);
return TRUE;
- } else if (node_has_parent(remote_node1, remote_node2)) {
+ } else if (node_has_parent(remote_node1, remote_node2) &&
+ ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_REMOTE) {
sync_rename_node_to_temp(ctx, ctx->remote_tree,
remote_node1, remote_node2->parent, reason_r);
*reason_r = t_strconcat(*reason_r, "(remote: node2 parent of node1)", NULL);
return TRUE;
- } else if (node_has_parent(remote_node2, remote_node1)) {
+ } else if (node_has_parent(remote_node2, remote_node1) &&
+ ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_REMOTE) {
sync_rename_node_to_temp(ctx, ctx->remote_tree,
remote_node2, remote_node1->parent, reason_r);
*reason_r = t_strconcat(*reason_r, "(remote: node1 parent of node2)", NULL);
More information about the dovecot-cvs
mailing list