dovecot-2.2: lib-storage: Fixed deleting mailbox when mail_attri...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Oct 21 08:22:36 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/a436e4a7503b
changeset: 15230:a436e4a7503b
user: Timo Sirainen <tss at iki.fi>
date: Sun Oct 21 08:22:20 2012 +0300
description:
lib-storage: Fixed deleting mailbox when mail_attribute_dict wasn't set.
diffstat:
src/lib-storage/index/index-attribute.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (40 lines):
diff -r 260b1ec12f41 -r a436e4a7503b src/lib-storage/index/index-attribute.c
--- a/src/lib-storage/index/index-attribute.c Sun Oct 21 07:29:04 2012 +0300
+++ b/src/lib-storage/index/index-attribute.c Sun Oct 21 08:22:20 2012 +0300
@@ -12,6 +12,7 @@
struct dict_iterate_context *diter;
char *prefix;
unsigned int prefix_len;
+ bool dict_disabled;
};
static int index_storage_get_dict(struct mailbox *box, struct dict **dict_r,
@@ -126,7 +127,10 @@
iter = i_new(struct index_storage_attribute_iter, 1);
iter->iter.box = box;
- if (index_storage_get_dict(box, &dict, &mailbox_prefix) == 0) {
+ if (index_storage_get_dict(box, &dict, &mailbox_prefix) < 0) {
+ if (mailbox_get_last_mail_error(box) == MAIL_ERROR_NOTPOSSIBLE)
+ iter->dict_disabled = TRUE;
+ } else {
iter->prefix = i_strdup(key_get_prefixed(type, mailbox_prefix,
prefix));
iter->prefix_len = strlen(iter->prefix);
@@ -158,10 +162,12 @@
(struct index_storage_attribute_iter *)_iter;
int ret;
- ret = iter->diter == NULL ? -1 :
- dict_iterate_deinit(&iter->diter);
- if (ret < 0)
- mail_storage_set_internal_error(_iter->box->storage);
+ if (iter->diter == NULL) {
+ ret = iter->dict_disabled ? 0 : -1;
+ } else {
+ if ((ret = dict_iterate_deinit(&iter->diter)) < 0)
+ mail_storage_set_internal_error(_iter->box->storage);
+ }
i_free(iter->prefix);
i_free(iter);
return ret;
More information about the dovecot-cvs
mailing list