/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "str.h"
#include "write-full.h"
#include "istream.h"
#include "ostream.h"
#include "process-title.h"
#include "restrict-access.h"
#include "time-util.h"
#include "master-service.h"
#include <unistd.h>
#include <fcntl.h>
enum rawlog_flags {
};
struct rawlog_proxy {
};
{
i_error("write(in) failed: %s",
}
}
i_error("write(out) failed: %s",
}
}
i_error("close(client_in_fd) failed: %m");
i_error("close(client_out_fd) failed: %m");
i_error("close(server_fd) failed: %m");
}
static void
{
T_BEGIN {
(long)ioloop_timeval.tv_sec,
(unsigned long)ioloop_timeval.tv_usec);
size_t i;
if (*prev_lf)
for (i = 0; i < size; i++) {
}
} T_END;
}
{
if (flushed)
}
{
return;
else
}
}
{
}
{
}
{
/* client's output buffer is already quite full.
don't send more until we're below threshold. */
return;
}
if (ret > 0) {
} else if (ret <= 0)
}
{
/* proxy's output buffer is already quite full.
don't send more until we're below threshold. */
return;
}
if (ret > 0) {
} else if (ret < 0)
}
{
return 1;
}
/* there's again space in proxy's output buffer, so we can
read more from client. */
}
return 1;
}
{
return 1;
}
/* there's again space in client's output buffer, so we can
read more from proxy. */
}
return 1;
}
const char *ip_addr)
{
int fd;
if (fd == -1) {
return;
}
}
if (fd == -1) {
return;
}
}
}
static struct rawlog_proxy *
enum rawlog_flags flags)
{
return proxy;
}
{
if (chroot_dir != NULL)
home = ".";
/* see if we want rawlog */
return;
}
return;
}
if (chroot_dir != NULL) {
/* we'll chroot soon. skip over the chroot in the path. */
}
i_fatal("socketpair() failed: %m");
if (pid < 0)
i_fatal("fork() failed: %m");
if (pid > 0) {
/* parent */
i_fatal("dup2(sfd, 0)");
i_fatal("dup2(sfd, 1)");
i_close_fd(&sfd[0]);
return;
}
ioloop = io_loop_create();
lib_deinit();
exit(0);
}
{
char *executable, *p;
int c;
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'f':
else
break;
case 'b':
break;
case 'I':
break;
case 't':
break;
default:
return FATAL_DEFAULT;
}
}
if (argc < 1)
i_fatal("Usage: rawlog [-f in|out] [-I] [-b] [-t] <binary> <arguments>");
executable = argv[0];
/* hide the executable path, it's ugly */
/* not reached */
return FATAL_EXEC;
}