From: Timo Sirainen Date: Tue, 9 Jan 2018 20:33:26 +0000 (-0500) Subject: lib-storage: mailbox_rename() - Use source storage for errors X-Git-Tag: 2.2.35~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12fb8b47bc896f371a182ea741ae6b914d31f68c;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mailbox_rename() - Use source storage for errors It was documented to use source storage for errors, but some of the errors were set to destination storage. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index b450485bbf..6f441c2110 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -1669,7 +1669,7 @@ int mailbox_rename_check_children(struct mailbox *src, struct mailbox *dest) continue; /* not our child */ /* if total length of new name exceeds the limit, fail */ if (strlen(child->vname + src_prefix_len)+dest_prefix_len > MAILBOX_LIST_NAME_MAX_LENGTH) { - mail_storage_set_error(dest->storage, MAIL_ERROR_PARAMS, + mail_storage_set_error(src->storage, MAIL_ERROR_PARAMS, "Mailbox or child name too long"); ret = -1; break; @@ -1678,7 +1678,7 @@ int mailbox_rename_check_children(struct mailbox *src, struct mailbox *dest) /* something went bad */ if (mailbox_list_iter_deinit(&iter) < 0) { - mail_storage_copy_list_error(dest->storage, src->list); + mail_storage_copy_list_error(src->storage, src->list); ret = -1; } return ret; @@ -1697,7 +1697,7 @@ int mailbox_rename(struct mailbox *src, struct mailbox *dest) return -1; } if (mailbox_verify_create_name(dest) < 0) { - mail_storage_copy_error(dest->storage, src->storage); + mail_storage_copy_error(src->storage, dest->storage); return -1; } if (mailbox_rename_check_children(src, dest) != 0) {