From: Timo Sirainen Date: Sat, 8 Mar 2025 08:35:38 +0000 (+0200) Subject: lib-storage: Remove unused mail_user._mail_set X-Git-Tag: 2.4.1~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e2995f253bde4b9af942551f579ec1a63290225;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Remove unused mail_user._mail_set This was implicitly doing mail_user_get_home() when expanding user settings, which was expected by the shared storage code. Changed this call now to be explicit. --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index e2bf318561..53cf4a76a2 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -344,7 +344,10 @@ shared_mail_user_init(struct mail_storage *_storage, struct mail_namespace *ns = *_ns; struct shared_storage *storage = SHARED_STORAGE(_storage); enum mail_storage_flags new_storage_flags = 0; - const char *error; + const char *home, *error; + + /* Make sure owner->nonexistent is set */ + (void)mail_user_get_home(owner, &home); struct shared_mail_user_var_expand_ctx *var_expand_ctx = p_new(user->pool, struct shared_mail_user_var_expand_ctx, 1); diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 5776de6335..d2d9385246 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -107,14 +107,8 @@ mail_user_alloc(struct mail_storage_service_user *service_user) int mail_user_init(struct mail_user *user, const char **error_r) { - const char *error; - i_assert(!user->initialized); - if (settings_get(user->event, &mail_storage_setting_parser_info, 0, - &user->_mail_set, &error) < 0) - user->error = p_strdup(user->pool, error); - if (user->error == NULL) { user->initialized = TRUE; hook_mail_user_created(user); @@ -181,7 +175,6 @@ void mail_user_unref(struct mail_user **_user) user->v.deinit_pre(user); user->v.deinit(user); } T_END; - settings_free(user->_mail_set); event_unref(&user->event); i_assert(user->refcount == 1); pool_unref(&user->pool); diff --git a/src/lib-storage/mail-user.h b/src/lib-storage/mail-user.h index 06fe118f48..0709ce3abb 100644 --- a/src/lib-storage/mail-user.h +++ b/src/lib-storage/mail-user.h @@ -63,7 +63,6 @@ struct mail_user { const char *error; const struct mail_user_settings *set; - struct mail_storage_settings *_mail_set; struct mail_namespace *namespaces; struct mail_storage *storages; struct dict_op_settings *dict_op_set;