dovecot-2.2: maildir: Don't assert-crash on mailbox creation.

dovecot at dovecot.org dovecot at dovecot.org
Tue Oct 23 20:46:49 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/488791e8c8d7
changeset: 15239:488791e8c8d7
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Oct 23 20:46:12 2012 +0300
description:
maildir: Don't assert-crash on mailbox creation.

diffstat:

 src/lib-storage/index/maildir/maildir-storage.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r e9cdf435fde2 -r 488791e8c8d7 src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Tue Oct 23 20:30:41 2012 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Tue Oct 23 20:46:12 2012 +0300
@@ -237,14 +237,17 @@
 /* create or fix maildir, ignore if it already exists */
 static int create_maildir_subdirs(struct mailbox *box, bool verify)
 {
-	const char *path;
+	const char *path, *box_path;
 	unsigned int i;
 	enum mail_error error;
 	int ret = 0;
 
+	if (mailbox_get_path_to(box, MAILBOX_LIST_PATH_TYPE_MAILBOX,
+				&box_path) < 0)
+		return -1;
+
 	for (i = 0; i < N_ELEMENTS(maildir_subdirs); i++) {
-		path = t_strconcat(mailbox_get_path(box), "/",
-				   maildir_subdirs[i], NULL);
+		path = t_strconcat(box_path, "/", maildir_subdirs[i], NULL);
 		if (mkdir_verify(box, path, verify) < 0) {
 			error = mailbox_get_last_mail_error(box);
 			if (error != MAIL_ERROR_EXISTS)


More information about the dovecot-cvs mailing list