MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT;
ARRAY_TYPE (const_string) access_apps;
- const char *access_user = NULL;
+ const char *access_user = NULL, *error;
int c;
if (IS_STANDALONE()) {
master_service_init_log_with_pid(master_service);
master_service_set_die_callback(master_service, imap_urlauth_worker_die);
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
storage_service =
mail_storage_service_init(master_service,
storage_service_flags);
*/
MAIL_STORAGE_SERVICE_FLAG_NO_NAMESPACES;
const char *username = NULL, *auth_socket_path = "auth-master";
+ const char *error;
int c;
i_zero(&login_set);
master_admin_clients_init(&admin_callbacks);
master_service_set_die_callback(master_service, imap_die);
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
/* plugins may want to add commands, so this needs to be called early */
commands_init();
imap_fetch_handlers_init();
verbose_proctitle = !IS_STANDALONE() &&
getenv(MASTER_VERBOSE_PROCTITLE_ENV) != NULL;
- const char *error;
if (t_abspath(auth_socket_path, &login_set.auth_socket_path, &error) < 0)
i_fatal("t_abspath(%s) failed: %s", auth_socket_path, error);
struct restrict_access_settings set;
const char *error;
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
/* by default we don't drop any privileges, but keep running as root. */
restrict_access_get_env(&set);
- if (set.uid != 0) {
- /* open config connection before dropping privileges */
- struct master_service_settings_input input;
- struct master_service_settings_output output;
-
- i_zero(&input);
- input.service = "indexer-worker";
- (void)master_service_settings_read(master_service,
- &input, &output, &error);
- }
restrict_access_by_env(RESTRICT_ACCESS_FLAG_ALLOW_ROOT, NULL);
}
{
struct mail_deliver_input dinput;
enum mail_storage_service_flags service_flags = 0;
- const char *user, *errstr, *path;
+ const char *user, *errstr, *path, *error;
struct smtp_address *rcpt_to, *final_rcpt_to, *mail_from;
struct mail_storage_service_ctx *storage_service;
struct mail_storage_service_input service_input;
i_fatal_status(EX_USAGE, "Unknown argument: %s", argv[optind]);
}
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
process_euid = geteuid();
if ((service_flags & MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP) != 0)
;
struct restrict_access_settings set;
const char *error;
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
/* by default we don't drop any privileges, but keep running as root. */
restrict_access_get_env(&set);
- /* open config connection before dropping privileges */
- struct master_service_settings_input input;
- struct master_service_settings_output output;
-
- i_zero(&input);
- input.service = "lmtp";
- if (master_service_settings_read(master_service,
- &input, &output, &error) < 0)
- i_fatal("%s", error);
restrict_access_by_env(RESTRICT_ACCESS_FLAG_ALLOW_ROOT, NULL);
}
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags = 0;
const char *username = NULL, *auth_socket_path = "auth-master";
+ const char *error;
int c;
i_zero(&login_set);
}
}
- const char *error;
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
if (t_abspath(auth_socket_path, &login_set.auth_socket_path, &error) < 0) {
i_fatal("t_abspath(%s) failed: %s", auth_socket_path, error);
}
master_admin_clients_init(&admin_callbacks);
master_service_set_die_callback(master_service, submission_die);
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
+
storage_service =
mail_storage_service_init(master_service,
storage_service_flags);
t_strdup_printf("script-login(%s): ", input.username));
if (drop_to_userdb_privileges) {
+ if (master_service_settings_read_simple(master_service, &error) < 0)
+ i_fatal("%s", error);
service_ctx = mail_storage_service_init(master_service, flags);
if (mail_storage_service_lookup(service_ctx, &input, &user, &error) <= 0)
i_fatal("%s", error);