auth-settings.c revision 93a7d1ee4b518b5c85f9721dc6539e4dab6aae00
/* Copyright (c) 2005-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "settings-parser.h"
#include "master-service-private.h"
#include "master-service-settings.h"
#include "service-settings.h"
#include "auth-settings.h"
#include <stddef.h>
/* <settings checks> */
static struct file_listener_settings auth_unix_listeners_array[] = {
{ "auth-login", 0600, "$default_internal_user", "" },
{ "auth-client", 0600, "", "" },
{ "auth-userdb", 0600, "", "" },
{ "auth-master", 0600, "", "" }
};
static struct file_listener_settings *auth_unix_listeners[] = {
};
static buffer_t auth_unix_listeners_buf = {
auth_unix_listeners, sizeof(auth_unix_listeners), { 0, }
};
/* </settings checks> */
struct service_settings auth_service_settings = {
.name = "auth",
.protocol = "",
.type = "",
.executable = "auth",
.user = "$default_internal_user",
.group = "",
.privileged_group = "",
.extra_groups = "",
.chroot = "",
.process_min_avail = 0,
.process_limit = 1,
.client_limit = 4096,
.service_count = 0,
.idle_kill = 0,
.vsz_limit = -1U,
.unix_listeners = { { &auth_unix_listeners_buf,
sizeof(auth_unix_listeners[0]) } },
};
/* <settings checks> */
static struct file_listener_settings auth_worker_unix_listeners_array[] = {
{ "auth-worker", 0600, "$default_internal_user", "" }
};
static struct file_listener_settings *auth_worker_unix_listeners[] = {
};
static buffer_t auth_worker_unix_listeners_buf = {
auth_worker_unix_listeners, sizeof(auth_worker_unix_listeners), { 0, }
};
/* </settings checks> */
struct service_settings auth_worker_service_settings = {
.name = "auth-worker",
.protocol = "",
.type = "",
.executable = "auth -w",
.user = "",
.group = "",
.privileged_group = "",
.extra_groups = "",
.chroot = "",
.process_min_avail = 0,
.process_limit = 0,
.client_limit = 1,
.service_count = 1,
.idle_kill = 0,
.vsz_limit = -1U,
sizeof(auth_worker_unix_listeners[0]) } },
};
static const struct setting_define auth_passdb_setting_defines[] = {
};
static const struct auth_passdb_settings auth_passdb_default_settings = {
.driver = "",
.args = "",
};
const struct setting_parser_info auth_passdb_setting_parser_info = {
.struct_size = sizeof(struct auth_passdb_settings),
};
static const struct setting_define auth_userdb_setting_defines[] = {
};
static const struct auth_userdb_settings auth_userdb_default_settings = {
.driver = "",
.args = ""
};
const struct setting_parser_info auth_userdb_setting_parser_info = {
.struct_size = sizeof(struct auth_userdb_settings),
};
/* we're kind of kludging here to avoid "auth_" prefix in the struct fields */
static const struct setting_define auth_setting_defines[] = {
};
static const struct auth_settings auth_default_settings = {
.mechanisms = "plain",
.realms = "",
.default_realm = "",
.cache_size = 0,
.cache_negative_ttl = 0,
.username_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@",
.username_translation = "",
.username_format = "",
.master_user_separator = "",
.anonymous_username = "anonymous",
.krb5_keytab = "",
.gssapi_hostname = "",
.winbind_helper_path = "/usr/bin/ntlm_auth",
.failure_delay = 2,
.debug_passwords = FALSE,
.verbose_passwords = "no:plain:sha1",
.use_winbind = FALSE,
.worker_max_count = 30,
.passdbs = ARRAY_INIT,
.userdbs = ARRAY_INIT,
};
const struct setting_parser_info auth_setting_parser_info = {
.module_name = "auth",
.struct_size = sizeof(struct auth_settings),
};
/* <settings checks> */
const char **error_r ATTR_UNUSED)
{
const char *p;
if (set->debug_passwords)
/* all chars are allowed */
sizeof(set->username_chars_map));
} else {
}
p = set->username_translation;
for (; *p != '\0' && p[1] != '\0'; p += 2)
}
set->realms_arr =
return TRUE;
}
static bool
const char **error_r)
{
*error_r = "passdb is missing driver";
return FALSE;
}
return TRUE;
}
static bool
const char **error_r)
{
*error_r = "userdb is missing driver";
return FALSE;
}
return TRUE;
}
/* </settings checks> */
struct auth_settings *global_auth_settings;
struct auth_settings *
struct master_service_settings_output *output_r)
{
static const struct setting_parser_info *set_roots[] = {
};
struct master_service_settings_input input;
struct setting_parser_context *set_parser;
const char *error;
i_unreached();
}