]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Remove unused mail_user._mail_set
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 8 Mar 2025 08:35:38 +0000 (10:35 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Mar 2025 13:01:57 +0000 (13:01 +0000)
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.

src/lib-storage/index/shared/shared-storage.c
src/lib-storage/mail-user.c
src/lib-storage/mail-user.h

index e2bf3185612a1ee64712d9ef222b998d3b3630fc..53cf4a76a217eaaede15aade5491a7b9ec3b9cf9 100644 (file)
@@ -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);
index 5776de63350fc37b59360304dec5f78f414e1e02..d2d9385246b44469facfd1a4e89bf5f15dea7d1e 100644 (file)
@@ -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);
index 06fe118f4889afb04a1e2e89476cdc1715f208c1..0709ce3abbc50bfe3c4666e730ff5208f44ae85d 100644 (file)
@@ -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;