]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Mailbox list rebuild - avoid opening mailbox on recovery name collision
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 14 Oct 2024 05:49:37 +0000 (08:49 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 17 Oct 2024 12:27:32 +0000 (12:27 +0000)
If recovered-lost-folder-$guid already unexpectedly exists, there's no need
to open it (at this point) to try to recover its name. This didn't really harm
anything, so it mainly fixes the code logic to make sense.

src/lib-storage/list/mail-storage-list-index-rebuild.c

index 792f7977fb6a6c4fcc90d66c2bd3a235976123b6..f2d98ce400730117c48fb756e01218545cb0d724 100644 (file)
@@ -381,7 +381,7 @@ mail_storage_list_index_try_create(struct mail_storage_list_index_rebuild_ctx *c
        }
        mailbox_free(&box);
 
-       if (ret < 0)
+       if (ret <= 0)
                return ret;
 
        /* open a second time to rename the mailbox to its original name,