login-settings.c revision 4819488364b20ee82a9d60177d15c79d0b5abbe0
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock/* Copyright (c) 2005-2016 Dovecot authors, see the included COPYING file */
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic bool login_settings_check(void *_set, pool_t pool, const char **error_r);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock { type, #name, offsetof(struct login_settings, name), NULL }
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic const struct setting_define login_setting_defines[] = {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic const struct login_settings login_default_settings = {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock .login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c session=<%{session}>",
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockconst struct setting_parser_info login_setting_parser_info = {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic const struct setting_parser_info *default_login_set_roots[] = {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockconst struct setting_parser_info **login_set_roots = default_login_set_roots;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic struct master_service_settings_cache *set_cache;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock/* <settings checks> */
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic bool login_settings_check(void *_set, pool_t pool,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock p_strsplit(pool, set->login_log_format_elements, " ");
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock/* </settings checks> */
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic const struct var_expand_table *
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrocklogin_set_var_expand_table(const struct master_service_settings_input *input)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockstatic void *
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrocklogin_setting_dup(pool_t pool, const struct setting_parser_info *info,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock const void *src_set)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock const char *error;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock const struct master_service_ssl_settings **ssl_set_r,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock const char *error;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock void *const *cache_sets;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock unsigned int i, count;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock set_cache = master_service_settings_cache_init(master_service,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock if (master_service_settings_cache_read(set_cache, &input, NULL,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock cache_sets = master_service_settings_parser_get_others(master_service, parser);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock for (count = 0; input.roots[count] != NULL; count++) ;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock for (i = 0; i < count; i++)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock sets[i] = login_setting_dup(pool, input.roots[i], cache_sets[i]);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock settings_var_expand(&login_setting_parser_info, sets[0], pool,