Mercurial > dovecot > core-2.2
changeset 22739:833b129bf451
lib-storage: Set index error on transaction commit() callback
The commit callback is setting errors to storage. However, it's being
called from mail_index_transaction_commit() whose callers are expecting
the error to be in index. If that index error was attempted to be used,
it could have been wrong or NULL. Fix this by setting the same storage
error also to the index.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 25 Dec 2017 18:18:14 +0200 |
parents | ebcec70f78ca |
children | 2b2c4857a52b |
files | src/lib-storage/index/index-transaction.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-transaction.c Mon Dec 25 18:17:57 2017 +0200 +++ b/src/lib-storage/index/index-transaction.c Mon Dec 25 18:18:14 2017 +0200 @@ -91,6 +91,8 @@ index_mailbox_sync_pvt_deinit(&pvt_sync_ctx); } + if (ret < 0) + mail_index_set_error_nolog(t->box->index, mailbox_get_last_error(t->box, NULL)); index_transaction_free(t); return ret; }