tcpwrap.c revision 02c335c23bf5fa225a467c19f2c063fb0dc7b8c3
/* Copyright (c) 2010-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "fdpass.h"
#include "write-full.h"
#include "restrict-access.h"
#include "master-service.h"
#include <unistd.h>
#include <syslog.h>
#include <tcpd.h>
struct tcpwrap_client {
int fd;
};
/* for tcpwrap library */
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;
const char *daemon_name)
{
struct request_info request;
if (!hosts_access(&request))
else
exit(0);
}
{
unsigned char buf[1024];
int check_fd = -1;
if (ret <= 0) {
i_error("fd_read() failed: %m");
} else {
i_error("Invalid input from client");
}
if (check_fd != -1) {
i_error("close(fdread fd) failed: %m");
}
}
{
}
{
struct tcpwrap_client *client;
client);
return client;
}
{
i_error("close() failed: %m");
}
{
if (tcpwrap_client != NULL) {
i_error("tcpwrap must be configured with client_limit=1");
return;
}
}
{
if (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
if (tcpwrap_client != NULL)
return 0;
}