From: Timo Sirainen Date: Fri, 12 Feb 2021 17:17:25 +0000 (+0200) Subject: lib-master: Add master_service_settings_input.extra_modules X-Git-Tag: 2.3.16~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca96472b0568de7d56b915374c6dba929228ccfd;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Add master_service_settings_input.extra_modules This allows specifying more than one module. --- diff --git a/src/lib-master/master-service-settings.c b/src/lib-master/master-service-settings.c index eded8d139b..d9c70eb333 100644 --- a/src/lib-master/master-service-settings.c +++ b/src/lib-master/master-service-settings.c @@ -216,11 +216,18 @@ master_service_exec_config(struct master_service *service, if (input->module != NULL) { strarr_push(&conf_argv, "-m"); strarr_push(&conf_argv, input->module); - if (service->want_ssl_settings) { + } + if (input->extra_modules != NULL) { + for (unsigned int i = 0; input->extra_modules[i] != NULL; i++) { strarr_push(&conf_argv, "-m"); - strarr_push(&conf_argv, "ssl"); + strarr_push(&conf_argv, input->extra_modules[i]); } } + if (service->want_ssl_settings && + (input->module != NULL || input->extra_modules != NULL)) { + strarr_push(&conf_argv, "-m"); + strarr_push(&conf_argv, "ssl"); + } if (input->parse_full_config) strarr_push(&conf_argv, "-p"); diff --git a/src/lib-master/master-service-settings.h b/src/lib-master/master-service-settings.h index b8d75b4427..4fe281f414 100644 --- a/src/lib-master/master-service-settings.h +++ b/src/lib-master/master-service-settings.h @@ -41,7 +41,10 @@ struct master_service_settings_input { bool use_sysexits; bool parse_full_config; + /* Either/both module and extra_modules can be set. Usually just one + is needed, so module is simpler to set. */ const char *module; + const char *const *extra_modules; const char *service; const char *username; struct ip_addr local_ip, remote_ip;