From: Timo Sirainen Date: Wed, 23 Mar 2011 21:13:00 +0000 (+0200) Subject: lib-storage: When mail_location is looked up from environment, set its unexpanded... X-Git-Tag: 2.0.12~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58c8d266f745ed8764c8b89f91b55510f6efea18;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/lib-storage/mail-namespace.c b/src/lib-storage/mail-namespace.c index 059cea875c..a587562292 100644 --- a/src/lib-storage/mail-namespace.c +++ b/src/lib-storage/mail-namespace.c @@ -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 @@ int mail_namespaces_init(struct mail_user *user, const char **error_r) 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;