ssl-init-main.c revision 45312f52ff3a3d4c137447be4c7556500c2f8bf2
/* Copyright (c) 2006-2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "lib-signals.h"
#include "file-lock.h"
#include "randgen.h"
#include "ssl-init.h"
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef HAVE_SSL
static int generate_parameters_file(const char *fname)
{
const char *temp_fname;
if (fd == -1) {
i_fatal("Can't create temporary SSL parameters file %s: %m",
}
/* If multiple dovecot instances are running, only one of them needs
to regenerate this file. */
if (ret < 0)
if (ret == 0) {
/* someone else is writing this */
return -1;
}
i_info("SSL parameters regeneration completed");
return 0;
}
#else
{
i_fatal("Dovecot built without SSL support");
return -1;
}
#endif
{
int ret = 0;
lib_init();
if (argc < 2)
i_fatal("Usage: ssl-build-param <path>");
random_init();
ret = 1;
lib_deinit();
return ret;
}