const char *username, *const *fields, *p;
int ret;
- if (auth_socket_path == NULL)
- auth_socket_path = PKG_RUNDIR"/auth-userdb";
+ if (auth_socket_path == NULL) {
+ auth_socket_path = t_strconcat(doveadm_settings->base_dir,
+ "/auth-userdb", NULL);
+ }
pool = pool_alloconly_create("auth master lookup", 1024);
{
struct auth_client *client;
- if (auth_socket_path == NULL)
- auth_socket_path = PKG_RUNDIR"/auth-client";
+ if (auth_socket_path == NULL) {
+ auth_socket_path = t_strconcat(doveadm_settings->base_dir,
+ "/auth-client", NULL);
+ }
client = auth_client_init(auth_socket_path, getpid(), FALSE);
auth_client_set_connect_notify(client, auth_connected, input);
int c;
ctx = t_new(struct director_context, 1);
- ctx->socket_path = PKG_RUNDIR"/director-admin";
+ ctx->socket_path = t_strconcat(doveadm_settings->base_dir,
+ "/director-admin", NULL);
while ((c = getopt(argc, argv, "a:")) > 0) {
switch (c) {
int c;
memset(&ctx, 0, sizeof(ctx));
- ctx.who.anvil_path = PKG_RUNDIR"/anvil";
+ ctx.who.anvil_path = t_strconcat(doveadm_settings->base_dir, "/anvil", NULL);
ctx.force_kick = FALSE;
ctx.who.pool = pool_alloconly_create("kick pids", 10240);
ctx.pids = hash_table_create(default_pool, ctx.who.pool, 0, NULL, NULL);
int c;
memset(&ctx, 0, sizeof(ctx));
- ctx.anvil_path = PKG_RUNDIR"/anvil";
+ ctx.anvil_path = t_strconcat(doveadm_settings->base_dir, "/anvil", NULL);
while ((c = getopt(argc, argv, "a:")) > 0) {
switch (c) {
case 'a':
{ type, #name, offsetof(struct doveadm_settings, name), NULL }
static const struct setting_define doveadm_setting_defines[] = {
+ DEF(SET_STR, base_dir),
DEF(SET_STR, mail_plugins),
DEF(SET_STR, mail_plugin_dir),
};
const struct doveadm_settings doveadm_default_settings = {
+ .base_dir = PKG_RUNDIR,
.mail_plugins = "",
.mail_plugin_dir = MODULEDIR
};
#define DOVEADM_SETTINGS_H
struct doveadm_settings {
+ const char *base_dir;
const char *mail_plugins;
const char *mail_plugin_dir;
};
int c;
memset(&ctx, 0, sizeof(ctx));
- ctx.anvil_path = PKG_RUNDIR"/anvil";
+ ctx.anvil_path = t_strconcat(doveadm_settings->base_dir, "/anvil", NULL);
ctx.pool = pool_alloconly_create("who users", 10240);
ctx.users = hash_table_create(default_pool, ctx.pool, 0,
who_user_hash, who_user_cmp);
#ifndef DOVEADM_H
#define DOVEADM_H
+#include "doveadm-settings.h"
+
#define USAGE_CMDNAME_FMT " %-12s"
typedef void doveadm_command_t(int argc, char *argv[]);