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 authored and villesavolainen committed Feb 9, 2018
1 parent ee37361 commit 12fb8b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib-storage/mail-storage.c
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 12fb8b4

Please sign in to comment.