login-settings.c revision 9d6307357b77c1006fff39f324d4f536d456b170
/* Copyright (c) 2005-2010 Dovecot authors, see the included COPYING file */
#include "login-common.h"
#include "hostpid.h"
#include "var-expand.h"
#include "settings-parser.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "master-service-settings-cache.h"
#include "login-settings.h"
#include <stddef.h>
#include <unistd.h>
static const struct setting_define login_setting_defines[] = {
};
static const struct login_settings login_default_settings = {
.login_trusted_networks = "",
.login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l %c",
.login_log_format = "%$: %s",
.login_access_sockets = "",
.ssl = "yes:no:required",
.ssl_ca = "",
.ssl_cert = "",
.ssl_key = "",
.ssl_key_password = "",
.ssl_parameters_file = "ssl-parameters.dat",
.ssl_cipher_list = "ALL:!LOW:!SSLv2:!EXP:!aNULL",
.ssl_cert_username_field = "commonName",
.verbose_ssl = FALSE,
.verbose_auth = FALSE,
.auth_debug = FALSE,
};
const struct setting_parser_info login_setting_parser_info = {
.module_name = "login",
.struct_size = sizeof(struct login_settings),
};
static const struct setting_parser_info *default_login_set_roots[] = {
};
static struct master_service_settings_cache *set_cache;
/* <settings checks> */
{
#ifndef HAVE_SSL
return FALSE;
#else
*error_r = "ssl enabled, but ssl_cert not set";
return FALSE;
}
*error_r = "ssl enabled, but ssl_key not set";
return FALSE;
}
*error_r = "ssl_verify_client_cert set, but ssl_ca not";
return FALSE;
}
return TRUE;
#endif
}
{
/* if we require valid cert, make sure we also ask for it */
}
/* disabled */
return FALSE;
return FALSE;
} else {
return FALSE;
}
return TRUE;
}
/* </settings checks> */
static const struct var_expand_table *
{
static struct var_expand_table static_tab[] = {
};
struct var_expand_table *tab;
return tab;
}
struct login_settings *
const char *local_host,
void ***other_settings_r)
{
struct master_service_settings_input input;
const char *error;
const struct setting_parser_context *parser;
void *const *cache_sets;
void **sets;
unsigned int i, count;
}
for (i = 0; i < count; i++) {
i_fatal("settings_check(%s) failed: %s",
}
}
return sets[0];
}
void login_settings_deinit(void)
{
}