Skip to content

Commit

Permalink
lib-storage: mailbox_rename() - Use source storage for errors
Browse files Browse the repository at this point in the history
It was documented to use source storage for errors, but some of the errors
were set to destination storage.
  • Loading branch information
sirainen committed Feb 8, 2018
1 parent 12c51b0 commit a0169b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib-storage/mail-storage.c
Expand Up @@ -1747,7 +1747,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;
Expand All @@ -1756,7 +1756,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;
Expand All @@ -1775,7 +1775,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) {
Expand Down

0 comments on commit a0169b2

Please sign in to comment.