These were no longer used for anything.
}
if (!userdb_only) {
- storage_service = mail_storage_service_init(master_service, NULL,
+ storage_service = mail_storage_service_init(master_service,
MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR |
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
}
if (!userdb_only) {
- storage_service = mail_storage_service_init(master_service, NULL,
+ storage_service = mail_storage_service_init(master_service,
MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR |
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
i_assert(cctx->username != NULL);
doveadm_mail_ctx_to_storage_service_input(ctx, &ctx->storage_service_input);
- ctx->storage_service = mail_storage_service_init(master_service, NULL,
+ ctx->storage_service = mail_storage_service_init(master_service,
ctx->service_flags);
T_BEGIN {
ctx->v.init(ctx);
ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
doveadm_mail_ctx_to_storage_service_input(ctx, &ctx->storage_service_input);
- ctx->storage_service = mail_storage_service_init(master_service, NULL,
+ ctx->storage_service = mail_storage_service_init(master_service,
ctx->service_flags);
T_BEGIN {
int main(int argc, char *argv[])
{
- static const struct setting_parser_info *set_roots[] = {
- &imap_urlauth_worker_setting_parser_info,
- NULL
- };
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags =
MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
storage_service =
mail_storage_service_init(master_service,
- set_roots, storage_service_flags);
+ storage_service_flags);
master_service_init_finish(master_service);
/* fake that we're running, so we know if client was destroyed
int main(int argc, char *argv[])
{
- static const struct setting_parser_info *set_roots[] = {
- &smtp_submit_setting_parser_info,
- &imap_setting_parser_info,
- NULL
- };
struct login_server_settings login_set;
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags =
storage_service =
mail_storage_service_init(master_service,
- set_roots, storage_service_flags);
+ storage_service_flags);
master_service_init_finish(master_service);
/* NOTE: login_set.*_socket_path are now invalid due to data stack
having been freed */
struct test_imap_client_hibernate ctx;
const char *error;
- storage_service = mail_storage_service_init(master_service, NULL,
+ storage_service = mail_storage_service_init(master_service,
MAIL_STORAGE_SERVICE_FLAG_ALLOW_ROOT |
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR |
drop_privileges();
master_service_init_log_with_pid(master_service);
- storage_service = mail_storage_service_init(master_service, NULL,
+ storage_service = mail_storage_service_init(master_service,
storage_service_flags);
restrict_access_allow_coredumps(TRUE);
master_service_init_finish(master_service);
int main(int argc, char *argv[])
{
- const struct setting_parser_info *set_roots[] = {
- &smtp_submit_setting_parser_info,
- &lda_setting_parser_info,
- NULL
- };
struct mail_deliver_input dinput;
enum mail_storage_service_flags service_flags = 0;
const char *user, *errstr, *path;
service_input.event_parent = event;
service_flags |= MAIL_STORAGE_SERVICE_FLAG_USE_SYSEXITS;
- storage_service = mail_storage_service_init(master_service, set_roots,
+ storage_service = mail_storage_service_init(master_service,
service_flags);
mail_deliver_hooks_init();
/* set before looking up the user (or ideally we'd do this between
struct auth_master_connection *conn, *iter_conn;
struct auth_master_user_list_ctx *auth_list;
- ARRAY(const struct setting_parser_info *) set_roots;
enum mail_storage_service_flags flags;
bool debug:1;
struct mail_storage_service_ctx *
mail_storage_service_init(struct master_service *service,
- const struct setting_parser_info *set_roots[],
enum mail_storage_service_flags flags)
{
struct mail_storage_service_ctx *ctx;
const char *version;
pool_t pool;
- unsigned int count;
version = master_service_get_version_string(service);
if (version != NULL && strcmp(version, PACKAGE_VERSION) != 0) {
ctx->service = service;
ctx->flags = flags;
- /* @UNSAFE */
- if (set_roots == NULL)
- count = 0;
- else
- for (count = 0; set_roots[count] != NULL; count++) ;
- p_array_init(&ctx->set_roots, pool, count + 16);
- const struct setting_parser_info *info = &mail_user_setting_parser_info;
- array_push_back(&ctx->set_roots, &info);
- info = &mail_storage_setting_parser_info;
- array_push_back(&ctx->set_roots, &info);
- array_append(&ctx->set_roots, set_roots, count);
-
/* note: we may not have read any settings yet, so this logging
may still be going to wrong location */
const char *configured_name =
return flags;
}
-const struct setting_parser_info *const *
-mail_storage_service_get_set_roots(struct mail_storage_service_ctx *ctx)
-{
- /* Make sure the array is NULL-terminated */
- array_append_zero(&ctx->set_roots);
- array_pop_back(&ctx->set_roots);
- return array_front(&ctx->set_roots);
-}
-
-static void
-mail_storage_service_add_set_info(struct mail_storage_service_ctx *ctx,
- const struct setting_parser_info *info)
-{
- const struct setting_parser_info *old_info;
-
- array_foreach_elem(&ctx->set_roots, old_info) {
- if (old_info == info)
- return;
- }
- array_push_back(&ctx->set_roots, &info);
-}
-
-static void
-mail_storage_service_add_storage_set_roots(struct mail_storage_service_ctx *ctx)
-{
- struct mail_storage *storage;
-
- array_foreach_elem(&mail_storage_classes, storage) {
- if (storage->v.get_setting_parser_info != NULL) {
- mail_storage_service_add_set_info(ctx,
- storage->v.get_setting_parser_info());
- }
- }
-}
-
int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
const struct mail_storage_service_input *input,
struct master_service_settings_instance **instance_r,
flags = input == NULL ? ctx->flags :
mail_storage_service_input_get_flags(ctx, input);
- mail_storage_service_add_storage_set_roots(ctx);
i_zero(&set_input);
set_input.preserve_user = TRUE;
/* settings reader may exec doveconf, which is going to clear
struct mail_storage_service_ctx *
mail_storage_service_init(struct master_service *service,
- const struct setting_parser_info *set_roots[],
- enum mail_storage_service_flags flags) ATTR_NULL(2);
+ enum mail_storage_service_flags flags);
struct auth_master_connection *
mail_storage_service_get_auth_conn(struct mail_storage_service_ctx *ctx);
/* Set auth connection (instead of creating a new one automatically). */
const char *
mail_storage_service_user_get_username(const struct mail_storage_service_user *user);
-/* Return all service settings roots. This includes the roots given to
- mail_storage_service_init() as well as all dynamically created
- mail_storage_classes. */
-const struct setting_parser_info *const *
-mail_storage_service_get_set_roots(struct mail_storage_service_ctx *ctx);
const char *
mail_storage_service_get_log_prefix(struct mail_storage_service_ctx *ctx);
const struct var_expand_table *
ctx->ioloop = io_loop_create();
- ctx->storage_service = mail_storage_service_init(master_service, NULL,
+ ctx->storage_service = mail_storage_service_init(master_service,
MAIL_STORAGE_SERVICE_FLAG_NO_RESTRICT_ACCESS |
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
MAIL_STORAGE_SERVICE_FLAG_NO_PLUGINS);
int main(int argc, char *argv[])
{
- const struct setting_parser_info *set_roots[] = {
- &smtp_submit_setting_parser_info,
- &lda_setting_parser_info,
- &lmtp_setting_parser_info,
- NULL
- };
enum master_service_flags service_flags =
MASTER_SERVICE_FLAG_HAVE_STARTTLS;
enum mail_storage_service_flags storage_service_flags =
drop_privileges();
master_service_init_log_with_pid(master_service);
- storage_service = mail_storage_service_init(master_service, set_roots,
+ storage_service = mail_storage_service_init(master_service,
storage_service_flags);
restrict_access_allow_coredumps(TRUE);
static void main_init(void)
{
- static const struct setting_parser_info *set_roots[] = {
- "a_status_setting_parser_info,
- NULL
- };
struct mail_storage_service_input input;
struct master_service_settings_instance *set_instance;
const struct mail_storage_settings *mail_set;
const char *value, *error;
clients = connection_list_init(&client_set, &client_vfuncs);
- storage_service = mail_storage_service_init(master_service, set_roots,
+ storage_service = mail_storage_service_init(master_service,
MAIL_STORAGE_SERVICE_FLAG_ALLOW_ROOT |
MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP |
int main(int argc, char *argv[])
{
- static const struct setting_parser_info *set_roots[] = {
- &pop3_setting_parser_info,
- NULL
- };
struct login_server_settings login_set;
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags = 0;
storage_service =
mail_storage_service_init(master_service,
- set_roots, storage_service_flags);
+ storage_service_flags);
master_service_init_finish(master_service);
/* NOTE: login_set.*_socket_path are now invalid due to data stack
having been freed */
int main(int argc, char *argv[])
{
- static const struct setting_parser_info *set_roots[] = {
- &submission_setting_parser_info,
- NULL
- };
struct login_server_settings login_set;
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags = 0;
storage_service =
mail_storage_service_init(master_service,
- set_roots, storage_service_flags);
+ storage_service_flags);
/* initialize SMTP server */
i_zero(&smtp_server_set);
t_strdup_printf("script-login(%s): ", input.username));
if (drop_to_userdb_privileges) {
- service_ctx = mail_storage_service_init(master_service, NULL, flags);
+ service_ctx = mail_storage_service_init(master_service, flags);
if (mail_storage_service_lookup(service_ctx, &input, &user, &error) <= 0)
i_fatal("%s", error);
mail_storage_service_restrict_setenv(user);