]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master, global: Remove "settings roots"
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 8 Mar 2023 14:27:03 +0000 (16:27 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
It's no longer necessary to know what settings the process will use.

32 files changed:
src/anvil/main.c
src/auth/auth-settings.c
src/dict/dict-expire.c
src/dict/main.c
src/doveadm/client-connection.c
src/doveadm/doveadm-settings.c
src/imap-hibernate/main.c
src/imap-login/imap-login-client.c
src/imap-login/imap-login-settings.c
src/imap-login/imap-login-settings.h
src/imap-urlauth-login/Makefile.am
src/imap-urlauth-login/imap-urlauth-login-settings.c
src/imap-urlauth-login/imap-urlauth-login-settings.h [deleted file]
src/imap-urlauth-login/imap-urlauth-login.c
src/imap-urlauth/imap-urlauth.c
src/indexer/indexer.c
src/lib-master/master-service-settings.c
src/lib-master/master-service-settings.h
src/lib-storage/mail-storage-service.c
src/log/main.c
src/login-common/login-settings.c
src/login-common/login-settings.h
src/master/main.c
src/plugins/mail-crypt/mail-crypt-pluginenv.c
src/pop3-login/Makefile.am
src/pop3-login/client.c
src/pop3-login/pop3-login-settings.c
src/pop3-login/pop3-login-settings.h [deleted file]
src/stats/main.c
src/submission-login/client.c
src/submission-login/submission-login-settings.c
src/submission-login/submission-login-settings.h

index c1a3a5b97c4e73da585d2521687050945fe912f0..0f9594159ef31bc94be6cb5585fc1592f2920e9d 100644 (file)
@@ -161,8 +161,7 @@ int main(int argc, char *argv[])
                                             &argc, &argv, "");
        if (master_getopt(master_service) > 0)
                return FATAL_DEFAULT;
-       if (master_service_settings_read_simple(master_service,
-                                               NULL, &error) < 0)
+       if (master_service_settings_read_simple(master_service, &error) < 0)
                i_fatal("%s", error);
        master_service_init_log(master_service);
 
index 070941aaca1dbb70111cc70353370bf329e0ab49..ffb883b7bd037e45691aabd09120983d1b562838 100644 (file)
@@ -548,15 +548,10 @@ const struct auth_settings *
 auth_settings_read(const char *service,
                   struct master_service_settings_output *output_r)
 {
-       static const struct setting_parser_info *set_roots[] = {
-               &auth_setting_parser_info,
-               NULL
-       };
        struct master_service_settings_input input;
        const char *error;
 
        i_zero(&input);
-       input.roots = set_roots;
        input.service = service;
        input.disable_check_settings = TRUE;
        if (master_service_settings_read(master_service, &input,
index 77f3cc93fa1ba45f17ad5dcfc174d58ede384bc8..5747601176ca12320b7a91da120aa4a9315d5c07 100644 (file)
@@ -144,10 +144,6 @@ static void main_deinit(void)
 int main(int argc, char *argv[])
 {
        const enum master_service_flags service_flags = 0;
-       const struct setting_parser_info *set_roots[] = {
-               &dict_setting_parser_info,
-               NULL
-       };
        const char *error;
 
        master_service = master_service_init("dict-expire", service_flags,
@@ -156,7 +152,6 @@ int main(int argc, char *argv[])
                return FATAL_DEFAULT;
 
        const struct master_service_settings_input set_input = {
-               .roots = set_roots,
                .disable_check_settings = TRUE,
        };
        struct master_service_settings_output output;
index 66ba25037e3d721b2b8b7e7ffe71080771f7947b..554f03263480b3f38ae96543c88439d6eec17ff3 100644 (file)
@@ -143,10 +143,6 @@ static void main_deinit(void)
 int main(int argc, char *argv[])
 {
        const enum master_service_flags service_flags = 0;
-       const struct setting_parser_info *set_roots[] = {
-               &dict_setting_parser_info,
-               NULL
-       };
        const char *error;
 
        master_service = master_service_init("dict", service_flags,
@@ -155,7 +151,6 @@ int main(int argc, char *argv[])
                return FATAL_DEFAULT;
 
        const struct master_service_settings_input set_input = {
-               .roots = set_roots,
                .disable_check_settings = TRUE,
        };
        struct master_service_settings_output output;
index 2553402c13e2c99f2f997bbff8cbaa44b0960f46..a0d9212694dc86534fdbeedefd547684bf1cc219 100644 (file)
@@ -32,16 +32,11 @@ bool doveadm_client_is_allowed_command(const struct doveadm_settings *set,
 
 static int client_connection_read_settings(struct client_connection *conn)
 {
-       const struct setting_parser_info *set_roots[] = {
-               &doveadm_setting_parser_info,
-               NULL
-       };
        struct master_service_settings_input input;
        struct master_service_settings_output output;
        const char *error;
 
        i_zero(&input);
-       input.roots = set_roots;
        input.service = "doveadm";
        input.local_ip = conn->local_ip;
        input.remote_ip = conn->remote_ip;
index 483f7ca7b3ecd812d6a258cc4d259f7948375c50..84dc418f4040e90275f422af6b24dfa5a0e20016 100644 (file)
@@ -219,17 +219,11 @@ void doveadm_get_ssl_settings(struct ssl_iostream_settings *set_r, pool_t pool)
 
 void doveadm_read_settings(void)
 {
-       static const struct setting_parser_info *set_roots[] = {
-               &master_service_ssl_setting_parser_info,
-               &doveadm_setting_parser_info,
-               NULL
-       };
        struct master_service_settings_input input;
        struct master_service_settings_output output;
        const char *error;
 
        i_zero(&input);
-       input.roots = set_roots;
        input.service = "doveadm";
        input.preserve_user = TRUE;
        input.preserve_home = TRUE;
index 5702d2b5b0f0649d1efe96cca9a760b937702177..90d68e6efd5a47332128da567e6751f71b586d9c 100644 (file)
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
                }
        }
 
-       if (master_service_settings_read_simple(master_service, NULL, &error) < 0)
+       if (master_service_settings_read_simple(master_service, &error) < 0)
                i_fatal("%s", error);
 
        master_service_init_log(master_service);
index 2d9f82dacd04bae11d4a4765ad51236a9999e8cb..83c2ef1b425ef102add45d65eb9df13b519364c9 100644 (file)
@@ -523,7 +523,6 @@ imap_client_notify_disconnect(struct client *client,
 
 static void imap_login_preinit(void)
 {
-       login_set_roots = imap_login_setting_roots;
 }
 
 static const struct imap_login_command imap_login_commands[] = {
index d32eb8c3cdde88bff6ec50f688af4f887dbff3ce..5ebab2010339be94c2b8355b35c545369c548096 100644 (file)
@@ -109,9 +109,3 @@ const struct setting_parser_info imap_login_setting_parser_info = {
        .pool_offset1 = 1 + offsetof(struct imap_login_settings, pool),
        .dependencies = imap_login_setting_dependencies
 };
-
-const struct setting_parser_info *imap_login_setting_roots[] = {
-       &login_setting_parser_info,
-       &imap_login_setting_parser_info,
-       NULL
-};
index 00ca7202ead9c8e3ff0196fa6a927fc588ea888d..e85b0ff4038dd86d9f18e4ea2404396aace742ec 100644 (file)
@@ -9,7 +9,6 @@ struct imap_login_settings {
        bool imap_id_retain;
 };
 
-extern const struct setting_parser_info *imap_login_setting_roots[];
 extern const struct setting_parser_info imap_login_setting_parser_info;
 
 #endif
index 28b17238252e3a84e3c7957f5bd9e191b408f1f3..d0c0d977d5e3c0faf23a7e15d8ec545cb40227aa 100644 (file)
@@ -28,6 +28,3 @@ imap_urlauth_login_DEPENDENCIES = \
 imap_urlauth_login_SOURCES = \
        imap-urlauth-login.c \
        imap-urlauth-login-settings.c
-
-noinst_HEADERS = \
-       imap-urlauth-login-settings.h
index 7167a332c10d02a62259bea70ddb94b69327045f..45d6fd6193c0abcaf380ee8f95e048675639188e 100644 (file)
@@ -5,7 +5,6 @@
 #include "settings-parser.h"
 #include "service-settings.h"
 #include "login-settings.h"
-#include "imap-urlauth-login-settings.h"
 
 #include <stddef.h>
 
@@ -69,9 +68,3 @@ const struct setting_parser_info imap_urlauth_login_setting_parser_info = {
 
        .dependencies = imap_urlauth_login_setting_dependencies
 };
-
-const struct setting_parser_info *imap_urlauth_login_setting_roots[] = {
-       &login_setting_parser_info,
-       &imap_urlauth_login_setting_parser_info,
-       NULL
-};
diff --git a/src/imap-urlauth-login/imap-urlauth-login-settings.h b/src/imap-urlauth-login/imap-urlauth-login-settings.h
deleted file mode 100644 (file)
index 775638a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef IMAP_URLAUTH_LOGIN_SETTINGS_H
-#define IMAP_URLAUTH_LOGIN_SETTINGS_H
-
-extern const struct setting_parser_info *imap_urlauth_login_setting_roots[];
-
-#endif
index cb4f8e8d3e546f50d6684faa67375f95cde7c254..2de90c08c33936278b68bdd0a81ae878e06e466a 100644 (file)
@@ -11,7 +11,6 @@
 #include "master-service.h"
 #include "auth-client.h"
 #include "client-common.h"
-#include "imap-urlauth-login-settings.h"
 
 #define IMAP_URLAUTH_PROTOCOL_MAJOR_VERSION 2
 #define IMAP_URLAUTH_PROTOCOL_MINOR_VERSION 0
@@ -164,7 +163,6 @@ static void imap_urlauth_client_notify_auth_ready(struct client *client)
 
 static void imap_urlauth_login_preinit(void)
 {
-       login_set_roots = imap_urlauth_login_setting_roots;
 }
 
 static void imap_urlauth_login_init(void)
index 882a6faba573c0492470f99499f91037394f6a1f..d356b8cc2f593fbd057dc7d91cdcc289637e9232 100644 (file)
@@ -211,10 +211,6 @@ static void client_connected(struct master_service_connection *conn)
 
 int main(int argc, char *argv[])
 {
-       static const struct setting_parser_info *set_roots[] = {
-               &imap_urlauth_setting_parser_info,
-               NULL
-       };
        struct login_server_settings login_set;
        struct master_service_settings_input input;
        struct master_service_settings_output output;
@@ -253,7 +249,6 @@ int main(int argc, char *argv[])
        master_service_init_log(master_service);
 
        i_zero(&input);
-       input.roots = set_roots;
        input.service = "imap-urlauth";
        input.disable_check_settings = TRUE;
        if (master_service_settings_read(master_service, &input, &output,
index d789c25cf226ddc9a49a4626986757cb363e0e37..6b3997a5fd7c02e9add2be0cff35166256c39edf 100644 (file)
@@ -109,8 +109,7 @@ int main(int argc, char *argv[])
        if (master_getopt(master_service) > 0)
                return FATAL_DEFAULT;
 
-       if (master_service_settings_read_simple(master_service, NULL,
-                                               &error) < 0)
+       if (master_service_settings_read_simple(master_service, &error) < 0)
                i_fatal("%s", error);
        set = master_service_get_service_settings(master_service);
 
index 73d59aa04f053311857dc691a94bb4d8091b920c..d724d530edd260faae0a3fda3d34d4219f9ad8d4 100644 (file)
@@ -762,14 +762,12 @@ int master_service_settings_read(struct master_service *service,
 }
 
 int master_service_settings_read_simple(struct master_service *service,
-                                       const struct setting_parser_info **roots,
                                        const char **error_r)
 {
        struct master_service_settings_input input;
        struct master_service_settings_output output;
 
        i_zero(&input);
-       input.roots = roots;
        return master_service_settings_read(service, &input, &output, error_r);
 }
 
index 783b7f9d3f1bb5e8232e1228c933aa03621b8fe4..e2d9567d7b00231718c5eeff3f882cb03868f784 100644 (file)
@@ -52,7 +52,6 @@ struct master_service_settings {
 };
 
 struct master_service_settings_input {
-       const struct setting_parser_info *const *roots;
        const char *config_path;
        bool preserve_environment;
        bool preserve_user;
@@ -136,8 +135,7 @@ int master_service_settings_read(struct master_service *service,
                                 struct master_service_settings_output *output_r,
                                 const char **error_r);
 int master_service_settings_read_simple(struct master_service *service,
-                                       const struct setting_parser_info **roots,
-                                       const char **error_r) ATTR_NULL(2);
+                                       const char **error_r);
 
 const struct master_service_settings *
 master_service_get_service_settings(struct master_service *service);
index cd720b3aea0471d2a96b0097d0694c3891a4bdc4..2109ac41481a7ce8bb2ae8d2dc8ee670f9e235ff 100644 (file)
@@ -967,7 +967,6 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
 
        mail_storage_service_add_storage_set_roots(ctx);
        i_zero(&set_input);
-       set_input.roots = mail_storage_service_get_set_roots(ctx);
        set_input.preserve_user = TRUE;
        /* settings reader may exec doveconf, which is going to clear
           environment, and if we're not doing a userdb lookup we want to
index 1d031ce168e4d778ad487b56e9246cabc1f60f43..7cc6a9061255cf70ddecd43965622f2a420fd437 100644 (file)
@@ -79,8 +79,7 @@ int main(int argc, char *argv[])
        if (master_getopt(master_service) > 0)
                return FATAL_DEFAULT;
 
-       if (master_service_settings_read_simple(master_service,
-                                               NULL, &error) < 0)
+       if (master_service_settings_read_simple(master_service, &error) < 0)
                i_fatal("%s", error);
        master_service_init_log_with_prefix(master_service, global_log_prefix);
 
index 629d143cc7735d87d7d4e37b099055c8fe5ad9c0..9b76be3c01e817464708c09795f86a5f91b3e85f 100644 (file)
@@ -86,13 +86,6 @@ const struct setting_parser_info login_setting_parser_info = {
        .check_func = login_settings_check
 };
 
-static const struct setting_parser_info *default_login_set_roots[] = {
-       &login_setting_parser_info,
-       NULL
-};
-
-const struct setting_parser_info **login_set_roots = default_login_set_roots;
-
 /* <settings checks> */
 static bool login_settings_check(void *_set, pool_t pool,
                                 const char **error_r)
@@ -119,7 +112,6 @@ int login_settings_read(const struct ip_addr *local_ip,
        struct master_service_settings_output output;
 
        i_zero(&input);
-       input.roots = login_set_roots;
        input.service = login_binary->protocol;
        input.local_name = local_name;
        input.disable_check_settings = TRUE;
index 73f204d7a36d018473e6c4d50da0f713b6ae0898..e41a714cd96063dd2cb74398403adce1639bfc2e 100644 (file)
@@ -36,7 +36,6 @@ struct login_settings {
        char *const *log_format_elements_split;
 };
 
-extern const struct setting_parser_info **login_set_roots;
 extern const struct setting_parser_info login_setting_parser_info;
 
 int login_settings_read(const struct ip_addr *local_ip,
index edbfcb00ece3960d335aac4ae2507d77fcbb2f39..4a0cef741b2d9019c231d5bdbae3ce1e52b489c6 100644 (file)
@@ -75,11 +75,6 @@ static pool_t delayed_errors_pool;
 static failure_callback_t *orig_fatal_callback;
 static failure_callback_t *orig_error_callback;
 
-static const struct setting_parser_info *set_roots[] = {
-       &master_setting_parser_info,
-       NULL
-};
-
 void process_exec(const char *cmd)
 {
        const char *executable, *p, **argv;
@@ -417,7 +412,6 @@ sig_settings_reload(const siginfo_t *si ATTR_UNUSED,
        }
 
        i_zero(&input);
-       input.roots = set_roots;
        input.config_path = services_get_config_socket_path(services);
        input.never_exec = TRUE;
        input.reload_config = TRUE;
@@ -512,7 +506,6 @@ static const struct master_settings *master_settings_read(void)
        const char *error;
 
        i_zero(&input);
-       input.roots = set_roots;
        input.preserve_environment = TRUE;
        input.always_exec = TRUE;
        input.return_config_fd = TRUE;
index be814b59d532746175ef46f309a9dd16666efb4e..c5ac66b06a73b1cdba63670f58486d8dfba7cad4 100644 (file)
 static const struct fs_crypt_settings *
 fs_crypt_load_settings(void)
 {
-       static const struct setting_parser_info *set_roots[] = {
-               &fs_crypt_setting_parser_info,
-               NULL
-       };
        struct master_service_settings_input input;
        struct master_service_settings_output output;
        const char *error;
 
        i_zero(&input);
-       input.roots = set_roots;
        input.service = "fs-crypt";
        input.disable_check_settings = TRUE;
        if (master_service_settings_read(master_service, &input,
index 135d24e34a7176709c03e0d3781e41d34b113d56..1c87773e3643ac624ebc192f9cc4b7aaf0089f08 100644 (file)
@@ -32,5 +32,4 @@ pop3_login_SOURCES = \
 noinst_HEADERS = \
        client.h \
        client-authenticate.h \
-       pop3-login-settings.h \
        pop3-proxy.h
index f90a5387b4a29be592c2f0f1da8fc579eff3942d..546807b6d3161336e73006c50ac2e92ebe3c45de 100644 (file)
@@ -17,7 +17,6 @@
 #include "client-authenticate.h"
 #include "auth-client.h"
 #include "pop3-proxy.h"
-#include "pop3-login-settings.h"
 
 #include <ctype.h>
 
@@ -335,7 +334,6 @@ static void pop3_login_die(void)
 
 static void pop3_login_preinit(void)
 {
-       login_set_roots = pop3_login_setting_roots;
 }
 
 static void pop3_login_init(void)
index 329c426c2ce101c46c7f94ae8f54ccc3e2e594ea..23884b52e4960faaf364731109caf96e2b1ab1ba 100644 (file)
@@ -6,7 +6,6 @@
 #include "service-settings.h"
 #include "login-settings.h"
 #include "pop3-protocol.h"
-#include "pop3-login-settings.h"
 
 #include <stddef.h>
 
@@ -91,9 +90,3 @@ const struct setting_parser_info pop3_login_setting_parser_info = {
 
        .dependencies = pop3_login_setting_dependencies
 };
-
-const struct setting_parser_info *pop3_login_setting_roots[] = {
-       &login_setting_parser_info,
-       &pop3_login_setting_parser_info,
-       NULL
-};
diff --git a/src/pop3-login/pop3-login-settings.h b/src/pop3-login/pop3-login-settings.h
deleted file mode 100644 (file)
index 1c497eb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef POP3_LOGIN_SETTINGS_H
-#define POP3_LOGIN_SETTINGS_H
-
-extern const struct setting_parser_info *pop3_login_setting_roots[];
-
-#endif
index b076592c1465c76d65dd24eb7886309b375e53be..0ff12a8c32f59767c864d1154a7298e8ba042bd0 100644 (file)
@@ -74,10 +74,6 @@ static void main_deinit(void)
 
 int main(int argc, char *argv[])
 {
-       const struct setting_parser_info *set_roots[] = {
-               &stats_setting_parser_info,
-               NULL
-       };
        const enum master_service_flags service_flags =
                MASTER_SERVICE_FLAG_NO_SSL_INIT |
                MASTER_SERVICE_FLAG_DONT_SEND_STATS |
@@ -91,7 +87,6 @@ int main(int argc, char *argv[])
                return FATAL_DEFAULT;
 
        const struct master_service_settings_input set_input = {
-               .roots = set_roots,
                .disable_check_settings = TRUE,
        };
        struct master_service_settings_output output;
index 95cb95ab21a3b64aba6ec8b7902f5ac17ba578de..993a2bb6afa667bcc59ec3f76355a7faad3c9df9 100644 (file)
@@ -252,7 +252,6 @@ static void submission_login_die(void)
 
 static void submission_login_preinit(void)
 {
-       login_set_roots = submission_login_setting_roots;
 }
 
 static void submission_login_init(void)
index d34484b1a369f47f704654c345b0bc47c00995ae..088a8638bb88d241b1d9557e19ad8a486d592610 100644 (file)
@@ -118,12 +118,6 @@ const struct setting_parser_info submission_login_setting_parser_info = {
        .dependencies = submission_login_setting_dependencies
 };
 
-const struct setting_parser_info *submission_login_setting_roots[] = {
-       &login_setting_parser_info,
-       &submission_login_setting_parser_info,
-       NULL
-};
-
 /* <settings checks> */
 struct submission_login_client_workaround_list {
        const char *name;
index f4f7c2c8598989b8f1ad02596ad8516e54ebb045..18fb896f969e527c9c00d276ef43e333c044a0a5 100644 (file)
@@ -20,7 +20,6 @@ struct submission_login_settings {
        enum submission_login_client_workarounds parsed_workarounds;
 };
 
-extern const struct setting_parser_info *submission_login_setting_roots[];
 extern const struct setting_parser_info submission_login_setting_parser_info;
 
 #endif