From: Timo Sirainen Date: Wed, 16 Nov 2022 23:17:38 +0000 (+0200) Subject: lib-storage: mail_storage_service_read_settings() - Remove user_info_r parameter X-Git-Tag: 2.4.0~3325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4296d80bafbfc8ae5b0946b49ada21f501ed31c8;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mail_storage_service_read_settings() - Remove user_info_r parameter --- diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 8e57ecf366..0179164138 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -1057,15 +1057,12 @@ mail_storage_service_add_storage_set_roots(struct mail_storage_service_ctx *ctx) int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx, const struct mail_storage_service_input *input, - const struct setting_parser_info **user_info_r, const struct setting_parser_context **parser_r, const char **error_r) { struct master_service_settings_input set_input; - const struct setting_parser_info *const *roots; struct master_service_settings_output set_output; enum mail_storage_service_flags flags; - unsigned int i; ctx->config_permission_denied = FALSE; @@ -1127,16 +1124,7 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx, } *parser_r = ctx->service->set_parser; } - - roots = settings_parser_get_roots(*parser_r); - for (i = 0; roots[i] != NULL; i++) { - if (strcmp(roots[i]->module_name, - mail_user_setting_parser_info.module_name) == 0) { - *user_info_r = roots[i]; - return 0; - } - } - i_unreached(); + return 0; } void mail_storage_service_set_auth_conn(struct mail_storage_service_ctx *ctx, @@ -1252,7 +1240,6 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx, { enum mail_storage_service_flags flags; const char *username = input->username; - const struct setting_parser_info *user_info; const struct mail_user_settings *user_set; const char *const *userdb_fields, *error; struct auth_user_reply reply; @@ -1271,7 +1258,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx, mail_storage_service_seteuid_root(); } - if (mail_storage_service_read_settings(ctx, input, &user_info, + if (mail_storage_service_read_settings(ctx, input, &set_parser, error_r) < 0) { if (ctx->config_permission_denied) { /* just restart and maybe next time we will open the @@ -1693,7 +1680,6 @@ void mail_storage_service_user_unref(struct mail_storage_service_user **_user) void mail_storage_service_init_settings(struct mail_storage_service_ctx *ctx, const struct mail_storage_service_input *input) { - const struct setting_parser_info *user_info; const struct mail_user_settings *user_set; const struct setting_parser_context *set_parser; const char *error; @@ -1701,7 +1687,7 @@ void mail_storage_service_init_settings(struct mail_storage_service_ctx *ctx, if (ctx->conn != NULL) return; - if (mail_storage_service_read_settings(ctx, input, &user_info, + if (mail_storage_service_read_settings(ctx, input, &set_parser, &error) < 0) i_fatal("%s", error); user_set = settings_parser_get_root_set(set_parser, diff --git a/src/lib-storage/mail-storage-service.h b/src/lib-storage/mail-storage-service.h index 18aa238c7b..5756e19ec6 100644 --- a/src/lib-storage/mail-storage-service.h +++ b/src/lib-storage/mail-storage-service.h @@ -86,7 +86,6 @@ void mail_storage_service_set_auth_conn(struct mail_storage_service_ctx *ctx, struct auth_master_connection *conn); int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx, const struct mail_storage_service_input *input, - const struct setting_parser_info **user_info_r, const struct setting_parser_context **parser_r, const char **error_r) ATTR_NULL(2); /* Read settings and initialize context to use them. Do nothing if service is diff --git a/src/lmtp/lmtp-client.c b/src/lmtp/lmtp-client.c index 0f02517a5c..4c4c03700c 100644 --- a/src/lmtp/lmtp-client.c +++ b/src/lmtp/lmtp-client.c @@ -115,7 +115,6 @@ static void client_read_settings(struct client *client, bool ssl) input.username = ""; if (mail_storage_service_read_settings(storage_service, &input, - &client->user_set_info, &set_parser, &error) < 0) i_fatal("%s", error); diff --git a/src/lmtp/lmtp-client.h b/src/lmtp/lmtp-client.h index 26c2493834..3c75eb8768 100644 --- a/src/lmtp/lmtp-client.h +++ b/src/lmtp/lmtp-client.h @@ -73,7 +73,6 @@ struct client { struct lmtp_client_vfuncs v; struct event *event; - const struct setting_parser_info *user_set_info; const struct lda_settings *unexpanded_lda_set; const struct lmtp_settings *lmtp_set; const struct master_service_settings *service_set; diff --git a/src/plugins/quota/quota-status.c b/src/plugins/quota/quota-status.c index 331a5efd80..796e5c3975 100644 --- a/src/plugins/quota/quota-status.c +++ b/src/plugins/quota/quota-status.c @@ -280,7 +280,6 @@ static void main_init(void) NULL }; struct mail_storage_service_input input; - const struct setting_parser_info *user_info; const struct setting_parser_context *set_parser; const struct mail_user_settings *user_set; const char *value, *error; @@ -300,7 +299,7 @@ static void main_init(void) quota_status_pool = pool_alloconly_create("quota status settings", 512); if (mail_storage_service_read_settings(storage_service, &input, - &user_info, &set_parser, + &set_parser, &error) < 0) i_fatal("%s", error); user_set = settings_parser_get_root_set(set_parser,