main.c revision 8d521180732e086173d08d01e205fe3a8c232418
/* 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 "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-interface.h"
#include "auth-master-connection.h"
#include "auth-client-connection.h"
#include <stdlib.h>
#include <unistd.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 */
FALSE);
}
}
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. */
struct sockaddr_un sa;
const char *suffix;
i_fatal("getsockname(%d) isn't UNIX socket",
}
else
}
switch (*type) {
case AUTH_SOCKET_MASTER:
break;
case AUTH_SOCKET_USERDB:
break;
case AUTH_SOCKET_CLIENT:
break;
default:
i_unreached();
}
}
{
int c;
switch (c) {
case 'a':
break;
case 'w':
break;
default:
c, optarg))
break;
}
}
main_init();
main_deinit();
return 0;
}