From: Timo Sirainen Date: Wed, 16 Nov 2022 23:23:57 +0000 (+0200) Subject: lib-storage: Call settings_check() for all settings roots (3/3) X-Git-Tag: 2.4.0~3334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=948b859588c6f837ccb3e2043887f966ee398950;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Call settings_check() for all settings roots (3/3) This commit finishes the breaking changes. --- diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 88a10c97b0..fa32da4492 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -56,7 +56,6 @@ mail_user_alloc_int(struct event *parent_event, pool_t pool) { struct mail_user *user; - const char *error; i_assert(username != NULL); i_assert(*username != '\0'); @@ -80,11 +79,6 @@ mail_user_alloc_int(struct event *parent_event, event_add_category(user->event, &event_category_storage); event_add_str(user->event, "user", username); - /* 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.deinit_pre = mail_user_deinit_pre_base; p_array_init(&user->module_contexts, user->pool, 5); @@ -181,6 +175,13 @@ int mail_user_init(struct mail_user *user, const char **error_r) break; void *set = settings_parser_get_root_set(user->set_parser, set_roots[i]); + /* check settings so that the duplicated structure will again + contain the parsed fields */ + if (!settings_check(set_roots[i], user->pool, set, &error)) { + user->error = p_strdup_printf(user->pool, + "Settings check unexpectedly failed: %s", error); + break; + } if (mail_user_var_expand(user, set_roots[i], set, &error) <= 0) { user->error = p_strdup_printf(user->pool, "Failed to expand settings: %s", error);