dovecot-2.2: lib-storage: Implemented get_metadata() for fail-ma...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 8 18:24:52 EET 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/f9a11e81209f
changeset: 17090:f9a11e81209f
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 08 11:24:36 2014 -0500
description:
lib-storage: Implemented get_metadata() for fail-mailbox.
This fixes a crash when a nonexistent mailbox was allocated and accessed
(via LAYOUT=index).

diffstat:

 src/lib-storage/fail-mailbox.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r a0e04a5aadab -r f9a11e81209f src/lib-storage/fail-mailbox.c
--- a/src/lib-storage/fail-mailbox.c	Tue Jan 07 14:33:29 2014 -0500
+++ b/src/lib-storage/fail-mailbox.c	Wed Jan 08 11:24:36 2014 -0500
@@ -88,6 +88,16 @@
 	return -1;
 }
 
+static int
+fail_mailbox_get_metadata(struct mailbox *box,
+			  enum mailbox_metadata_items items ATTR_UNUSED,
+			  struct mailbox_metadata *metadata_r ATTR_UNUSED)
+{
+	mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
+			       T_MAIL_ERR_MAILBOX_NOT_FOUND(box->vname));
+	return -1;
+}
+
 static int fail_mailbox_set_subscribed(struct mailbox *box,
 				       bool set ATTR_UNUSED)
 {
@@ -257,7 +267,7 @@
 		fail_mailbox_delete,
 		fail_mailbox_rename,
 		fail_mailbox_get_status,
-		NULL,
+		fail_mailbox_get_metadata,
 		fail_mailbox_set_subscribed,
 		NULL,
 		NULL,


More information about the dovecot-cvs mailing list