]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Call settings_check() after duplicating settings struct. Fixes lock_meth...
authorTimo Sirainen <tss@iki.fi>
Fri, 25 Jun 2010 14:03:44 +0000 (15:03 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 25 Jun 2010 14:03:44 +0000 (15:03 +0100)
lock_method was always ignored and the default fcntl was used.

--HG--
branch : HEAD

src/lib-storage/mail-user.c

index 202277295614797488cf1f88bf852199588b58d0..a048abdacc28acfc057839dc893c2953dfd38217 100644 (file)
@@ -36,6 +36,7 @@ struct mail_user *mail_user_alloc(const char *username,
                                  const struct mail_user_settings *set)
 {
        struct mail_user *user;
+       const char *error;
        pool_t pool;
 
        i_assert(username != NULL);
@@ -49,6 +50,12 @@ struct mail_user *mail_user_alloc(const char *username,
        user->set_info = set_info;
        user->unexpanded_set = settings_dup(set_info, set, pool);
        user->set = settings_dup(set_info, set, pool);
+
+       /* check settings so that the duplicated structure will again
+          contain the parsed fields */
+       if (!settings_check(set_info, pool, user->set, &error))
+               i_panic("Settings check unexpectedly failed: %s", error);
+
        user->v.deinit = mail_user_deinit_base;
        user->v.get_temp_prefix = mail_user_get_temp_prefix_base;
        p_array_init(&user->module_contexts, user->pool, 5);