From 12fb8b47bc896f371a182ea741ae6b914d31f68c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 9 Jan 2018 15:33:26 -0500 Subject: [PATCH] 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. --- src/lib-storage/mail-storage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.47.3