master-settings.c revision 69e84ff0440e1b344240adb8f6a8c3aa68840f1d
/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "array.h"
#include "env-util.h"
#include "istream.h"
#include "network.h"
#include "str.h"
#include "mkdir-parents.h"
#include "safe-mkdir.h"
#include "settings-parser.h"
#include "master-settings.h"
#include <stddef.h>
#include <dirent.h>
#include <unistd.h>
const char **error_r);
extern const struct setting_parser_info service_setting_parser_info;
static const struct setting_define file_listener_setting_defines[] = {
};
static const struct file_listener_settings file_listener_default_settings = {
};
static const struct setting_parser_info file_listener_setting_parser_info = {
};
static const struct setting_define inet_listener_setting_defines[] = {
};
static const struct inet_listener_settings inet_listener_default_settings = {
};
static const struct setting_parser_info inet_listener_setting_parser_info = {
};
static const struct setting_define service_setting_defines[] = {
};
static const struct service_settings service_default_settings = {
MEMBER(client_limit) 0,
MEMBER(service_count) 0,
};
const struct setting_parser_info service_setting_parser_info = {
};
static const struct setting_define master_setting_defines[] = {
};
static const struct master_settings master_default_settings = {
MEMBER(last_valid_uid) 0,
MEMBER(last_valid_gid) 0,
};
const struct setting_parser_info master_setting_parser_info = {
};
/* <settings checks> */
{
struct file_listener_settings *const *sets;
unsigned int i, count;
if (!array_is_created(l))
return;
for (i = 0; i < count; i++) {
}
}
}
const char **error_r)
{
else {
return FALSE;
}
return TRUE;
}
{
const char *p;
return;
}
static bool
{
struct service_settings *const *services;
unsigned int i, j, count;
if (set->last_valid_uid != 0 &&
*error_r = "first_valid_uid can't be larger than last_valid_uid";
return FALSE;
}
if (set->last_valid_gid != 0 &&
*error_r = "first_valid_gid can't be larger than last_valid_gid";
return FALSE;
}
/* check that we have at least one service. the actual service
structure validity is checked later while creating them. */
*error_r = "No services defined";
return FALSE;
}
for (i = 0; i < count; i++) {
"Service #%d is missing name", i);
return FALSE;
}
return FALSE;
for (j = 0; j < i; j++) {
"Duplicate service name: %s",
return FALSE;
}
}
}
for (i = 0; i < count; i++) {
}
}
if (service->drop_priv_before_exec &&
"drop_priv_before_exec=yes can't be "
return FALSE;
}
"process_min_avail is higher than process_limit",
return FALSE;
}
}
return TRUE;
}
/* </settings checks> */
static bool
{
struct service_settings *const *services;
unsigned int i, count;
const char *error;
for (i = 0; i < count; i++) {
if (services[i]->login_dump_core)
}
}
return cores;
}
static bool
const char *dir)
{
struct service_settings *const *services;
struct file_listener_settings *const *u;
for (i = 0; i < count; i++) {
for (j = 0; j < count2; j++) {
return TRUE;
}
}
}
return FALSE;
}
{
unsigned int prefix_len;
return;
}
continue;
continue;
str_truncate(str, 0);
continue;
}
continue;
/* try to avoid unlinking sockets if someone's already
listening in them. do this only at startup, because
when SIGHUPing a child process might catch the new
connection before it notices that it's supposed
to die. null_fd == -1 check is a bit kludgy, but works.. */
if (null_fd == -1) {
i_fatal("Dovecot is already running? "
"Socket already exists: %s",
}
}
}
}
{
deleted. */
return FALSE;
}
/* allow base_dir to be a symlink, so don't use lstat() */
return FALSE;
}
return FALSE;
}
/* Make sure our permanent state directory exists */
return FALSE;
}
/* we are not using external authentication, so make sure the
login directory exists with correct permissions and it's
empty. with external auth we wouldn't want to delete
existing sockets or break the permissions required by the
auth server. */
i_warning("Corrected permissions for login directory "
"%s", login_dir);
}
} else {
/* still make sure that login directory exists */
return FALSE;
}
}
i_warning("Corrected permissions for empty directory "
"%s", empty_dir);
}
return TRUE;
}