dsync.c revision 578ef2538ccf42e2a48234c24a8b709397101d88
/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "master-service.h"
#include "mail-storage-service.h"
#include "mail-user.h"
#include "dsync-brain.h"
#include "dsync-worker.h"
#include "dsync-proxy-server.h"
#include <stdlib.h>
#include <unistd.h>
static struct dsync_brain *brain;
static struct dsync_proxy_server *server;
{
char **args;
i_fatal("pipe() failed: %m");
switch (fork()) {
case -1:
i_fatal("fork() failed: %m");
break;
case 0:
goes to pipes which we'll pass to proxy client. */
i_fatal("dup2() failed: %m");
break;
default:
/* parent */
break;
}
}
static void ATTR_NORETURN
usage(void)
{
i_fatal("usage: dsync [-v] [-u <user>] [-e <cmd>]");
}
static void
{
i_fatal("Running as service not supported currently");
}
{
enum dsync_brain_flags brain_flags = 0;
struct mail_storage_service_input input;
while ((c = master_getopt(master_service)) > 0) {
if (c == '-')
break;
switch (c) {
case 'b':
break;
case 'e':
break;
case 'f':
break;
case 'u':
break;
case 'v':
break;
default:
usage();
}
}
usage();
/* user initialization may exec doveconf, so do our forking
after that */
}
if (dest) {
username));
} else {
username));
}
else
ret = 0;
return ret < 0 ? 1 : 0;
}