]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fail if changing mailbox GUID update doesn't work.
authorTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 09:47:32 +0000 (11:47 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 09:47:32 +0000 (11:47 +0200)
src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c

index f3b645f5cdbc77547592d20e1f918c1166bcd2a8..5e630b9ad32deceb42e8748688ff339482e1127d 100644 (file)
@@ -58,6 +58,20 @@ sync_create_box(struct mailbox *box, const guid_128_t mailbox_guid,
                                mailbox_get_last_error(box, NULL));
                        return -1;
                }
+               /* verify that the update worked */
+               if (mailbox_get_metadata(box, MAILBOX_METADATA_GUID,
+                                        &metadata) < 0) {
+                       i_error("Can't get mailbox GUID %s: %s",
+                               mailbox_get_vname(box),
+                               mailbox_get_last_error(box, NULL));
+                       return -1;
+               }
+               if (memcmp(mailbox_guid, metadata.guid,
+                          sizeof(metadata.guid)) != 0) {
+                       i_error("Backend didn't update mailbox %s GUID",
+                               mailbox_get_vname(box));
+                       return -1;
+               }
        }
        return 0;
 }