dovecot-2.0: lib-storage: Call settings_check() after duplicatin...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 25 17:03:48 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/0dc6f14c271d
changeset: 11633:0dc6f14c271d
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 25 15:03:44 2010 +0100
description:
lib-storage: Call settings_check() after duplicating settings struct. Fixes lock_method setting.
lock_method was always ignored and the default fcntl was used.

diffstat:

 src/lib-storage/mail-user.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 8d76b2cef0b5 -r 0dc6f14c271d src/lib-storage/mail-user.c
--- a/src/lib-storage/mail-user.c	Fri Jun 25 15:02:57 2010 +0100
+++ b/src/lib-storage/mail-user.c	Fri Jun 25 15:03:44 2010 +0100
@@ -36,6 +36,7 @@
 				  const struct mail_user_settings *set)
 {
 	struct mail_user *user;
+	const char *error;
 	pool_t pool;
 
 	i_assert(username != NULL);
@@ -49,6 +50,12 @@
 	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);


More information about the dovecot-cvs mailing list