dovecot-2.0: lib-storage: When mail_location is looked up from e...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 23 23:13:09 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/a5f9264674fb
changeset: 12698:a5f9264674fb
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 23 23:13:00 2011 +0200
description:
lib-storage: When mail_location is looked up from environment, set its unexpanded string properly.
This fixes a crash when creating index directories and mail location was
autodetected.

diffstat:

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

diffs (26 lines):

diff -r d7a02077d91f -r a5f9264674fb src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c	Wed Mar 23 22:16:24 2011 +0200
+++ b/src/lib-storage/mail-namespace.c	Wed Mar 23 23:13:00 2011 +0200
@@ -4,6 +4,7 @@
 #include "array.h"
 #include "str.h"
 #include "file-lock.h"
+#include "settings-parser.h"
 #include "mailbox-list-private.h"
 #include "mail-storage-private.h"
 #include "mail-storage-settings.h"
@@ -358,9 +359,11 @@
 			location_source = "environment MAILDIR";
 		}
 	}
-
-	if (unexpanded_inbox_set->location == NULL)
-		unexpanded_inbox_set->location = inbox_set->location;
+	if (*unexpanded_inbox_set->location == '\0') {
+		unexpanded_inbox_set->location =
+			p_strconcat(user->pool, SETTING_STRVAR_EXPANDED,
+				    inbox_set->location, NULL);
+	}
 
 	ns->set = inbox_set;
 	ns->unexpanded_set = unexpanded_inbox_set;


More information about the dovecot-cvs mailing list