main.c revision a2fdfd2efdbb2d912aad23900a466cf74114920b
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi/* Copyright (c) 2002-2016 Dovecot authors, see the included COPYING file */
#include "process-title.h"
#include "settings-parser.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "master-interface.h"
#include "dict.h"
#include "password-scheme.h"
#include "passdb-cache.h"
#include "mech.h"
#include "auth.h"
#include "auth-penalty.h"
#include "auth-token.h"
#include "auth-request-handler.h"
#include "auth-request-stats.h"
#include "auth-worker-server.h"
#include "auth-worker-client.h"
#include "auth-master-connection.h"
#include "auth-client-connection.h"
#include "auth-postfix-connection.h"
#include <unistd.h>
enum auth_socket_type {
AUTH_SOCKET_UNKNOWN = 0,
struct auth_socket_listener {
char *path;
void auth_refresh_proctitle(void)
static const char *const *read_global_settings(void)
const char **services;
unsigned int i, count;
for (i = 0; i < count; i++) {
return services;
static enum auth_socket_type
name++;
suffix++;
return AUTH_SOCKET_LOGIN_CLIENT;
return AUTH_SOCKET_MASTER;
return AUTH_SOCKET_USERDB;
return AUTH_SOCKET_POSTFIX;
return AUTH_SOCKET_TOKEN;
return AUTH_SOCKET_TOKEN_LOGIN;
return AUTH_SOCKET_CLIENT;
static void listeners_init(void)
const char *path;
struct auth_socket_listener *l;
return FALSE;
return TRUE;
static void main_preinit(void)
const char *const *services;
random_init();
passdbs_init();
userdbs_init();
if (!worker)
if (!worker)
&mod_set);
static void main_init(void)
auths_init();
if (worker) {
static void main_deinit(void)
struct auth_socket_listener *l;
auths_deinit();
auths_free();
struct auth_socket_listener *l;
switch (l->type) {
case AUTH_SOCKET_MASTER:
case AUTH_SOCKET_USERDB:
case AUTH_SOCKET_POSTFIX:
case AUTH_SOCKET_LOGIN_CLIENT:
case AUTH_SOCKET_CLIENT:
case AUTH_SOCKET_TOKEN_LOGIN:
case AUTH_SOCKET_TOKEN:
i_unreached();
static void auth_die(void)
if (!worker) {
return FATAL_DEFAULT;
main_preinit();
main_init();
main_deinit();