From: Timo Sirainen Date: Mon, 17 Apr 2023 22:51:15 +0000 (+0300) Subject: global: Replace NULL event for settings_get*() with master_service.event X-Git-Tag: 2.4.0~2151 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b966a23478e3dd8024696baa732ab2f9d0c14aa;p=thirdparty%2Fdovecot%2Fcore.git global: Replace NULL event for settings_get*() with master_service.event --- diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index 193e12d014..62ef8a558b 100644 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -155,7 +155,7 @@ auth_policy_open_and_close_to_key(struct json_ostream *json_output, void auth_policy_init(void) { const struct master_service_ssl_settings *master_ssl_set = - settings_get_or_fatal(NULL, + settings_get_or_fatal(master_service_get_event(master_service), &master_service_ssl_setting_parser_info); struct ssl_iostream_settings ssl_set; i_zero(&ssl_set); diff --git a/src/dict/dict-expire.c b/src/dict/dict-expire.c index b774800400..eab2437291 100644 --- a/src/dict/dict-expire.c +++ b/src/dict/dict-expire.c @@ -106,7 +106,9 @@ static void main_init(void) { struct module_dir_load_settings mod_set; - dict_settings = settings_get_or_fatal(NULL, &dict_setting_parser_info); + dict_settings = + settings_get_or_fatal(master_service_get_event(master_service), + &dict_setting_parser_info); i_zero(&mod_set); mod_set.abi_version = DOVECOT_ABI_VERSION; diff --git a/src/dict/main.c b/src/dict/main.c index ae0d4f47a1..c49a50b185 100644 --- a/src/dict/main.c +++ b/src/dict/main.c @@ -102,7 +102,9 @@ static void main_init(void) { struct module_dir_load_settings mod_set; - dict_settings = settings_get_or_fatal(NULL, &dict_setting_parser_info); + dict_settings = + settings_get_or_fatal(master_service_get_event(master_service), + &dict_setting_parser_info); i_zero(&mod_set); mod_set.abi_version = DOVECOT_ABI_VERSION; diff --git a/src/doveadm/doveadm-settings.c b/src/doveadm/doveadm-settings.c index b880dd1fcc..5368a83183 100644 --- a/src/doveadm/doveadm-settings.c +++ b/src/doveadm/doveadm-settings.c @@ -238,9 +238,11 @@ void doveadm_read_settings(void) doveadm_verbose_proctitle = master_service_get_service_settings(master_service)->verbose_proctitle; doveadm_settings = - settings_get_or_fatal(NULL, &doveadm_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &doveadm_setting_parser_info); doveadm_ssl_set = - settings_get_or_fatal(NULL, &master_service_ssl_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &master_service_ssl_setting_parser_info); } int doveadm_settings_get_config_fd(void) diff --git a/src/imap-urlauth/imap-urlauth.c b/src/imap-urlauth/imap-urlauth.c index 564c3e7418..48093818d4 100644 --- a/src/imap-urlauth/imap-urlauth.c +++ b/src/imap-urlauth/imap-urlauth.c @@ -250,7 +250,8 @@ int main(int argc, char *argv[]) i_fatal("%s", error); imap_urlauth_settings = - settings_get_or_fatal(NULL, &imap_urlauth_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &imap_urlauth_setting_parser_info); if (imap_urlauth_settings->verbose_proctitle) verbose_proctitle = TRUE; diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 697c08e870..46d4fa6982 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -1450,7 +1450,8 @@ void mail_storage_service_init_settings(struct mail_storage_service_ctx *ctx, if (ctx->conn != NULL) return; - struct event *event = input == NULL ? NULL : input->event_parent; + struct event *event = input != NULL && input->event_parent != NULL ? + input->event_parent : master_service_get_event(ctx->service); if (settings_get(event, &mail_user_setting_parser_info, SETTINGS_GET_FLAG_NO_EXPAND, &user_set, &error) < 0) i_fatal("%s", error); diff --git a/src/login-common/main.c b/src/login-common/main.c index a2172bd2cd..eb45fc9ecc 100644 --- a/src/login-common/main.c +++ b/src/login-common/main.c @@ -505,13 +505,16 @@ int login_binary_run(struct login_binary *binary, struct master_service_settings_output output; if (master_service_settings_read(master_service, &input, &output, &error) < 0 || - settings_get(NULL, &login_setting_parser_info, + settings_get(master_service_get_event(master_service), + &login_setting_parser_info, SETTINGS_GET_FLAG_NO_EXPAND, &global_login_settings, &error) < 0) i_fatal("%s", error); - global_ssl_settings = settings_get_or_fatal(NULL, + global_ssl_settings = settings_get_or_fatal( + master_service_get_event(master_service), &master_service_ssl_setting_parser_info); - global_ssl_server_settings = settings_get_or_fatal(NULL, + global_ssl_server_settings = settings_get_or_fatal( + master_service_get_event(master_service), &master_service_ssl_server_setting_parser_info); if (argv[optind] != NULL) diff --git a/src/master/main.c b/src/master/main.c index 8cc0e0328a..bf5e47ba21 100644 --- a/src/master/main.c +++ b/src/master/main.c @@ -422,7 +422,8 @@ sig_settings_reload(const siginfo_t *si ATTR_UNUSED, i_sd_notify(0, "READY=1"); return; } - if (settings_get(NULL, &master_setting_parser_info, 0, + if (settings_get(master_service_get_event(master_service), + &master_setting_parser_info, 0, &set, &error) < 0) { i_close_fd(&output.config_fd); i_error("%s", error); @@ -514,7 +515,8 @@ static const struct master_settings *master_settings_read(void) i_fatal("%s", error); global_config_fd = output.config_fd; fd_close_on_exec(global_config_fd, TRUE); - return settings_get_or_fatal(NULL, &master_setting_parser_info); + return settings_get_or_fatal(master_service_get_event(master_service), + &master_setting_parser_info); } static void main_log_startup(char **protocols) diff --git a/src/plugins/mail-crypt/mail-crypt-pluginenv.c b/src/plugins/mail-crypt/mail-crypt-pluginenv.c index f6a39062de..98301b34bc 100644 --- a/src/plugins/mail-crypt/mail-crypt-pluginenv.c +++ b/src/plugins/mail-crypt/mail-crypt-pluginenv.c @@ -62,7 +62,8 @@ int mail_crypt_global_keys_load_pluginenv(const char *set_prefix, const char **error_r) { const struct fs_crypt_settings *set = - settings_get_or_fatal(NULL, &fs_crypt_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &fs_crypt_setting_parser_info); const char *set_key = t_strconcat(set_prefix, "_public_key", NULL); const char *key_data = mail_crypt_plugin_getenv(set, set_key); diff --git a/src/plugins/quota/quota-status.c b/src/plugins/quota/quota-status.c index bec4f5f883..4437d3dd08 100644 --- a/src/plugins/quota/quota-status.c +++ b/src/plugins/quota/quota-status.c @@ -305,10 +305,12 @@ static void main_init(void) input.service = "quota-status"; input.username = ""; - if (settings_get(NULL, &mail_storage_setting_parser_info, + if (settings_get(master_service_get_event(master_service), + &mail_storage_setting_parser_info, SETTINGS_GET_FLAG_NO_EXPAND, &mail_set, &error) < 0) i_fatal("%s", error); - quota_status_settings = settings_get_or_fatal(NULL, + quota_status_settings = settings_get_or_fatal( + master_service_get_event(master_service), "a_status_setting_parser_info); value = mail_user_set_plugin_getenv(mail_set, "quota_status_nouser"); diff --git a/src/stats/main.c b/src/stats/main.c index 5c1b8e3e59..98db4e8ef5 100644 --- a/src/stats/main.c +++ b/src/stats/main.c @@ -47,9 +47,11 @@ static void main_preinit(void) static void main_init(void) { stats_settings = - settings_get_or_fatal(NULL, &stats_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &stats_setting_parser_info); master_ssl_set = - settings_get_or_fatal(NULL, &master_service_ssl_setting_parser_info); + settings_get_or_fatal(master_service_get_event(master_service), + &master_service_ssl_setting_parser_info); stats_startup_time = ioloop_time; stats_metrics = stats_metrics_init(stats_settings);