]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix calling mail_user_get_mail_home() during user initialization
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 17 Nov 2022 17:04:54 +0000 (19:04 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 30 Nov 2022 12:33:03 +0000 (14:33 +0200)
When it's not already known that settings have been expanded, access
mail_home via unexpanded settings. This guarantees that the setting
hasn't been expanded yet. There's no guarantee whether user->set has
been expanded or not during mail_user_init().

src/lib-storage/mail-user.c

index 709b8e34e38187a9ad2c025de0980575b9d5c1f4..90bb438193a7c06355625746f5ad98ef90537eb8 100644 (file)
@@ -462,6 +462,7 @@ static bool mail_user_get_mail_home(struct mail_user *user)
                user->_home = home[0] != '\0' ? home : NULL;
                return TRUE;
        }
+       home = user->unexpanded_set->mail_home;
        /* we're still initializing user. need to do the expansion ourself. */
        i_assert(home[0] == SETTING_STRVAR_UNEXPANDED[0]);
        home++;