changeset 22820:85a8901c8ad6

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.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 09 Jan 2018 15:33:26 -0500
parents 698dedb5a026
children 5134d021b776
files src/lib-storage/mail-storage.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.c	Tue Feb 06 18:01:04 2018 +0200
+++ b/src/lib-storage/mail-storage.c	Tue Jan 09 15:33:26 2018 -0500
@@ -1669,7 +1669,7 @@
 			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 @@
 
 	/* 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 @@
 		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) {