master-settings.c revision 1dd7e17bcb59e158457eed755223e1981a1eed96
/* 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 "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 struct setting_parser_info service_setting_parser_info;
static struct setting_define file_listener_setting_defines[] = {
};
static struct file_listener_settings file_listener_default_settings = {
};
static struct setting_parser_info file_listener_setting_parser_info = {
};
static struct setting_define inet_listener_setting_defines[] = {
};
static struct inet_listener_settings inet_listener_default_settings = {
};
static struct setting_parser_info inet_listener_setting_parser_info = {
};
static struct setting_define service_setting_defines[] = {
};
static struct service_settings service_default_settings = {
MEMBER(client_limit) 0,
MEMBER(service_count) 0,
};
struct setting_parser_info service_setting_parser_info = {
};
static struct setting_define master_auth_setting_defines[] = {
};
static struct master_auth_settings master_auth_default_settings = {
};
};
static struct setting_define master_setting_defines[] = {
};
static struct master_settings master_default_settings = {
MEMBER(last_valid_uid) 0,
MEMBER(last_valid_gid) 0,
};
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++) {
}
}
}
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++) {
services[i]->executable =
}
}
if (services[i]->drop_priv_before_exec &&
"drop_priv_before_exec=yes can't be "
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++) {
}
}
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;
}
/* remove auth worker sockets left by unclean exits */
/* 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;
}