main.c revision 7cba14a4c3beb026a2862ee50d24c554fa713329
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "array.h"
#include "ioloop.h"
#include "network.h"
#include "lib-signals.h"
#include "restrict-access.h"
#include "child-wait.h"
#include "sql-api.h"
#include "module-dir.h"
#include "randgen.h"
#include "master-service.h"
#include "master-interface.h"
#include "password-scheme.h"
#include "mech.h"
#include "auth.h"
#include "auth-request-handler.h"
#include "auth-worker-server.h"
#include "auth-worker-client.h"
#include "auth-master-connection.h"
#include "auth-client-connection.h"
enum auth_socket_type {
AUTH_SOCKET_UNKNOWN = 0,
};
static struct auth_worker_client *worker_client;
{
random_init();
/* Load built-in SQL drivers (if any) */
/* Initialize databases so their configuration files can be readable
only by root. Also load all modules here. */
passdbs_init();
userdbs_init();
/* Password lookups etc. may require roots, allow it. */
}
static void main_init(void)
{
/* If auth caches aren't used, just ignore these signals */
if (worker) {
/* workers have only a single connection from the master
auth process */
}
}
static void main_deinit(void)
{
if (worker_client != NULL)
else
auth_deinit(&auth);
}
{
}
{
enum auth_socket_type *type;
if (*type == AUTH_SOCKET_UNKNOWN) {
/* figure out if this is a server or network socket by
checking the socket path name. */
else {
suffix++;
else
}
}
switch (*type) {
case AUTH_SOCKET_MASTER:
break;
case AUTH_SOCKET_USERDB:
break;
case AUTH_SOCKET_CLIENT:
break;
default:
i_unreached();
}
}
{
int c;
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'w':
break;
default:
return FATAL_DEFAULT;
}
}
main_init();
main_deinit();
return 0;
}