From: Timo Sirainen Date: Fri, 2 Dec 2022 12:51:23 +0000 (+0200) Subject: lib-storage: Remove "const" from settings parser contexts X-Git-Tag: 2.4.0~3317 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6169c23155978ef6ac5d16d262dba6dd581cbc5a;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Remove "const" from settings parser contexts --- diff --git a/src/lib-storage/index/raw/raw-storage.c b/src/lib-storage/index/raw/raw-storage.c index d88a3bde9e..1fd642f25d 100644 --- a/src/lib-storage/index/raw/raw-storage.c +++ b/src/lib-storage/index/raw/raw-storage.c @@ -13,7 +13,7 @@ extern struct mail_storage raw_storage; extern struct mailbox raw_mailbox; struct mail_user * -raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser) +raw_storage_create_from_set(struct setting_parser_context *unexpanded_set_parser) { struct mail_user *user; struct mail_namespace *ns; diff --git a/src/lib-storage/index/raw/raw-storage.h b/src/lib-storage/index/raw/raw-storage.h index cfc7127a8b..5d8d0ee4dd 100644 --- a/src/lib-storage/index/raw/raw-storage.h +++ b/src/lib-storage/index/raw/raw-storage.h @@ -30,7 +30,7 @@ struct raw_mailbox { extern struct mail_vfuncs raw_mail_vfuncs; struct mail_user * -raw_storage_create_from_set(const struct setting_parser_context *unexpanded_set_parser); +raw_storage_create_from_set(struct setting_parser_context *unexpanded_set_parser); int raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input, time_t received_time, const char *envelope_sender, diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 1072fd11ca..270e8eb27c 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -1057,7 +1057,7 @@ 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_context **parser_r, + struct setting_parser_context **parser_r, const char **error_r) { struct master_service_settings_input set_input; @@ -1106,15 +1106,13 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx, if (null_strcmp(set_input.module, ctx->set_cache_module) == 0 && null_strcmp(set_input.service, ctx->set_cache_service) == 0 && ctx->set_cache != NULL) { - struct setting_parser_context *parser; if (master_service_settings_cache_read(ctx->set_cache, &set_input, - &parser, error_r) < 0) { + parser_r, error_r) < 0) { *error_r = t_strdup_printf( "Error reading configuration: %s", *error_r); return -1; } - *parser_r = parser; } else { if (master_service_settings_read(ctx->service, &set_input, &set_output, error_r) < 0) { @@ -1245,7 +1243,7 @@ mail_storage_service_lookup_real(struct mail_storage_service_ctx *ctx, const struct mail_user_settings *user_set; const char *const *userdb_fields, *error; struct auth_user_reply reply; - const struct setting_parser_context *set_parser; + struct setting_parser_context *set_parser; pool_t user_pool, temp_pool; int ret = 1; @@ -1683,7 +1681,7 @@ void mail_storage_service_init_settings(struct mail_storage_service_ctx *ctx, const struct mail_storage_service_input *input) { const struct mail_user_settings *user_set; - const struct setting_parser_context *set_parser; + struct setting_parser_context *set_parser; const char *error; if (ctx->conn != NULL) diff --git a/src/lib-storage/mail-storage-service.h b/src/lib-storage/mail-storage-service.h index 5756e19ec6..05899a2e82 100644 --- a/src/lib-storage/mail-storage-service.h +++ b/src/lib-storage/mail-storage-service.h @@ -86,7 +86,7 @@ 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_context **parser_r, + 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 already initialized. This is mainly necessary when calling _get_auth_conn() diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 9e02346923..ada9ea9ef6 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -51,7 +51,7 @@ static void mail_user_deinit_pre_base(struct mail_user *user ATTR_UNUSED) static struct mail_user * mail_user_alloc_int(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser, + struct setting_parser_context *unexpanded_set_parser, pool_t pool) { struct mail_user *user; @@ -86,7 +86,7 @@ mail_user_alloc_int(struct event *parent_event, struct mail_user * mail_user_alloc_nodup_set(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser) + struct setting_parser_context *unexpanded_set_parser) { pool_t pool; @@ -97,7 +97,7 @@ mail_user_alloc_nodup_set(struct event *parent_event, struct mail_user *mail_user_alloc(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser) + struct setting_parser_context *unexpanded_set_parser) { pool_t pool; diff --git a/src/lib-storage/mail-user.h b/src/lib-storage/mail-user.h index 2f4cff9343..1bddfdb268 100644 --- a/src/lib-storage/mail-user.h +++ b/src/lib-storage/mail-user.h @@ -58,8 +58,8 @@ struct mail_user { This could be set by plugins that need to fail the initialization. */ const char *error; - const struct setting_parser_context *unexpanded_set_parser; - const struct setting_parser_context *set_parser; + struct setting_parser_context *unexpanded_set_parser; + struct setting_parser_context *set_parser; const struct mail_user_settings *unexpanded_set; struct mail_user_settings *set; struct mail_namespace *namespaces; @@ -129,11 +129,11 @@ extern const struct var_expand_func_table *mail_user_var_expand_func_table; struct mail_user *mail_user_alloc(struct event *parent_event, const char *username, - const struct setting_parser_context *unexpanded_set_parser); + struct setting_parser_context *unexpanded_set_parser); struct mail_user * mail_user_alloc_nodup_set(struct event *parent_event, const char *username, - const struct setting_parser_context *set_parser); + struct setting_parser_context *set_parser); /* Returns -1 if settings were invalid. */ int mail_user_init(struct mail_user *user, const char **error_r); diff --git a/src/lmtp/lmtp-client.c b/src/lmtp/lmtp-client.c index 4c4c03700c..ea4710a2c5 100644 --- a/src/lmtp/lmtp-client.c +++ b/src/lmtp/lmtp-client.c @@ -100,7 +100,7 @@ static void client_load_modules(struct client *client) static void client_read_settings(struct client *client, bool ssl) { struct mail_storage_service_input input; - const struct setting_parser_context *set_parser; + struct setting_parser_context *set_parser; struct lmtp_settings *lmtp_set; struct lda_settings *lda_set; const char *error; diff --git a/src/plugins/quota/quota-status.c b/src/plugins/quota/quota-status.c index 796e5c3975..d9cfdf3fb8 100644 --- a/src/plugins/quota/quota-status.c +++ b/src/plugins/quota/quota-status.c @@ -280,7 +280,7 @@ static void main_init(void) NULL }; struct mail_storage_service_input input; - const struct setting_parser_context *set_parser; + struct setting_parser_context *set_parser; const struct mail_user_settings *user_set; const char *value, *error;