]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add mail_storage_service_input.unexpanded_set_parser
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 12 Jan 2023 15:17:29 +0000 (17:17 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 17 Jan 2023 11:10:41 +0000 (12:10 +0100)
src/lib-storage/mail-storage-service.c
src/lib-storage/mail-storage-service.h

index a5c47b57fe61e41936cbb5539e17f00073b992bf..86584c5fb04902709a59e00e623ac0ed5705f383 100644 (file)
@@ -1222,7 +1222,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx,
        enum mail_storage_service_flags flags;
        struct mail_storage_service_user *user;
        const char *username = input->username;
-       const struct setting_parser_info *user_info;
+       const struct setting_parser_info *user_info = NULL;
        const struct mail_user_settings *user_set;
        const char *const *userdb_fields, *error;
        struct auth_user_reply reply;
@@ -1242,9 +1242,11 @@ 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_pool,
-                                              &user_info, &set_parser,
-                                              error_r) < 0) {
+       if (input->unexpanded_set_parser != NULL)
+               set_parser = input->unexpanded_set_parser;
+       else if (mail_storage_service_read_settings(ctx, input, user_pool,
+                                                   &user_info, &set_parser,
+                                                   error_r) < 0) {
                if (ctx->config_permission_denied) {
                        /* just restart and maybe next time we will open the
                           config socket before dropping privileges */
index 31508e80ed22c9afc1565cb40ff911caa94da40b..29a6f7d1ccf4752844b5ed75146b3565555b7f71 100644 (file)
@@ -60,6 +60,9 @@ struct mail_storage_service_input {
 
        const char *forward_fields;
 
+       /* Use this settings parser instead of looking it up. */
+       struct setting_parser_context *unexpanded_set_parser;
+
        /* Override specified global flags */
        enum mail_storage_service_flags flags_override_add;
        enum mail_storage_service_flags flags_override_remove;