]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Change auth settings structs to be const
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Jan 2023 22:57:47 +0000 (00:57 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:11:40 +0000 (14:11 +0200)
src/auth/auth-settings.c
src/auth/auth-settings.h
src/auth/test-mech.c

index 973aae10382a0de6b1fae888d89b37d27febb95c..56a10374b87d30ac9aef57bec20ec670ef5b394f 100644 (file)
@@ -550,9 +550,9 @@ auth_userdb_settings_check(void *_set, pool_t pool ATTR_UNUSED,
 }
 /* </settings checks> */
 
-struct auth_settings *global_auth_settings;
+const struct auth_settings *global_auth_settings;
 
-struct auth_settings *
+const struct auth_settings *
 auth_settings_read(const char *service, pool_t pool,
                   struct master_service_settings_output *output_r)
 {
index 08d696e2b92b0044002faa1c92ed35f8931d2033..26bbcf37ad82ba16c1439ca39038d57d5f87c1bc 100644 (file)
@@ -98,9 +98,9 @@ struct auth_settings {
 };
 
 extern const struct setting_parser_info auth_setting_parser_info;
-extern struct auth_settings *global_auth_settings;
+extern const struct auth_settings *global_auth_settings;
 
-struct auth_settings *
+const struct auth_settings *
 auth_settings_read(const char *service, pool_t pool,
                   struct master_service_settings_output *output_r)
        ATTR_NULL(1);
index d574e78ae858bbbf721a717aa3aa39ee8db93d56..0bb3696c69a847f538f6127c734d76eeb21025c2 100644 (file)
@@ -94,8 +94,8 @@ static void test_mechs_init(void)
 
        /* Copy default settings */
        set = *(const struct auth_settings *)auth_setting_parser_info.defaults;
+       set.base_dir = ".";
        global_auth_settings = &set;
-       global_auth_settings->base_dir = ".";
        memset((&set)->username_chars_map, 1, sizeof((&set)->username_chars_map));
        set.username_format = "";
 
@@ -133,7 +133,7 @@ static void test_mech_prepare_request(struct auth_request **request_r,
                                      unsigned int running_test,
                                      const struct test_case *test_case)
 {
-       global_auth_settings->ssl_username_from_cert = test_case->set_cert_username;
+       set.ssl_username_from_cert = test_case->set_cert_username;
        struct auth *auth = auth_default_service();
 
        struct auth_request *request = auth_request_new(mech,  NULL);