main.c revision 5a47b70946f83e80c9195d8cb71a616f62feb388
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "network.h"
#include "lib-signals.h"
#include "restrict-access.h"
#include "randgen.h"
#include "auth.h"
#include "cookie.h"
#include "login-connection.h"
#include "userinfo.h"
#include <stdlib.h>
#include <syslog.h>
void master_init(void);
void master_deinit(void);
{
}
{
int fd;
if (fd < 0) {
if (fd < -1)
i_fatal("accept() failed: %m");
} else {
(void)login_connection_create(fd);
}
}
static void main_init(void)
{
const char *logfile;
/* open the syslog immediately so chroot() won't
break logging */
} else {
/* log failures into specified log file */
}
random_init();
auth_init();
cookies_init();
master_init();
}
static void main_deinit(void)
{
if (lib_signal_kill != 0)
auth_deinit();
closelog();
}
{
/* NOTE: we start rooted, so keep the code minimal until
restrict_access_by_env() is called */
lib_init();
main_init();
main_deinit();
lib_deinit();
return 0;
}