master-service-settings.c revision 1cfdcb36985904eff281fc6d7ea2d13b3c375980
/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "istream.h"
#include "write-full.h"
#include "str.h"
#include "settings-parser.h"
#include "master-service-private.h"
#include "master-service-settings.h"
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#define CONFIG_READ_TIMEOUT_SECS 10
#define CONFIG_HANDSHAKE "VERSION\tconfig\t1\t0\n"
static struct setting_define master_service_setting_defines[] = {
};
static struct master_service_settings master_service_default_settings = {
};
};
static void ATTR_NORETURN
{
/* already have the path */
/* relative to current directory */
/* we have to find our executable from path */
binary_path = path;
break;
}
}
}
if (!service->keep_environment)
/* @UNSAFE */
}
static int
const struct master_service_settings_input *input,
const char **error_r)
{
} else {
if (fd < 0) {
"net_connect_unix(%s) failed: %m", path);
/* it's a file, not a socket */
}
return -1;
}
}
T_BEGIN {
}
}
} T_END;
if (ret < 0) {
return -1;
}
return fd;
}
static int
struct setting_parser_context *parser,
const char **error_r)
{
const char *const *overrides;
unsigned int i, count;
for (i = 0; i < count; i++) {
"Invalid -o parameter %s: %s", overrides[i],
return -1;
}
}
return 0;
}
const struct master_service_settings_input *input,
const char **error_r)
{
const struct setting_parser_info *tmp_root;
struct setting_parser_context *parser;
void **sets;
unsigned int i;
if (fd == -1)
return -1;
}
} else {
}
input->dyn_parsers);
}
}
if (fd != -1) {
do {
alarm(0);
if (ret <= 0)
break;
/* most likely timed out, but just in case some other
signal was delivered early check if we need to
continue */
if (ret != 0) {
"Timeout reading config from %s", path) :
return -1;
}
}
else if (fd != -1)
/* let environment override settings. especially useful for the
settings from userdb. */
if (settings_parse_environ(parser) < 0) {
return -1;
}
keys);
} T_END;
}
error_r) < 0)
return -1;
}
return -1;
}
/* running standalone. we want to ignore plugin versions. */
}
/* if we change any settings afterwards, they're in expanded form.
especially all settings from userdb are already expanded. */
return 0;
}
const struct setting_parser_info **roots,
const char **error_r)
{
struct master_service_settings_input input;
}
{
return pool;
}
const struct master_service_settings *
{
void **sets;
return sets[0];
}
{
}
{
}