master-settings.c revision d63442674f4adca0134e2b6203d2658e228e6d7c
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "istream.h"
#include "safe-mkdir.h"
#include "unlink-directory.h"
#include "settings.h"
#include <stdio.h>
#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
#include <pwd.h>
static struct setting_def setting_defs[] = {
/* common */
/* general */
/* login */
/* mail */
/* imap */
/* pop3 */
{ 0, NULL, 0 }
};
static struct setting_def login_setting_defs[] = {
{ 0, NULL, 0 }
};
static struct setting_def auth_setting_defs[] = {
{ 0, NULL, 0 }
};
struct settings default_settings = {
/* common */
/* general */
/* login */
/* mail */
MEMBER(last_valid_uid) 0,
MEMBER(last_valid_gid) 0,
/* imap */
/* pop3 */
};
struct login_settings default_login_settings = {
};
static pool_t settings_pool;
{
}
}
struct login_settings *login_set)
{
i_fatal("All login process users must belong to same group "
}
}
{
i_fatal("Can't access auth chroot directory %s: %m",
}
}
{
i_fatal("Can't use login executable %s: %m",
login->executable);
}
i_fatal("login_processes_count must be at least 1");
i_fatal("max_logging_users must be at least 1");
}
static const char *get_directory(const char *path)
{
char *str, *p;
if (p == NULL)
return ".";
else {
*p = '\0';
return str;
}
}
{
struct login_settings *login;
struct auth_settings *auth;
const char *const *str;
const char *dir;
}
i_fatal("Can't use imap executable %s: %m",
}
}
i_fatal("Can't use pop3 executable %s: %m",
}
}
}
i_fatal("Can't write to info log directory %s: %m",
dir);
}
}
#ifdef HAVE_SSL
if (!set->ssl_disable) {
i_fatal("Can't use SSL certificate %s: %m",
set->ssl_cert_file);
}
i_fatal("Can't use SSL key file %s: %m",
set->ssl_key_file);
}
}
#endif
/* fix relative paths */
deleted. */
i_warning("Corrected permissions for base directory %s",
}
/* wipe out contents of login directory, if it exists */
i_warning("Corrected permissions for login directory %s",
}
i_fatal("max_mail_processes must be at least 1");
if (set->last_valid_uid != 0 &&
i_fatal("first_valid_uid can't be larger than last_valid_uid");
if (set->last_valid_gid != 0 &&
i_fatal("first_valid_gid can't be larger than last_valid_gid");
dotlock_got = TRUE;
else
}
#ifndef HAVE_FLOCK
i_fatal("mbox_locks: Only flock selected, "
"and flock() isn't supported in this system");
}
#endif
i_fatal("mbox_locks: No mbox locking methods selected");
i_warning("mbox_locks: Only dotlock selected, forcing "
"mbox_read_dotlock = yes to avoid corruption.");
}
}
{
struct auth_settings *auth;
PKG_LIBEXECDIR"/dovecot-auth");
}
{
struct auth_settings *auth;
return "Authentication process name must not contain '/'";
return "Authentication process already exists "
"with the same name";
}
}
return NULL;
}
{
struct login_settings *login;
/* copy defaults */
} else {
}
}
{
struct login_settings *login;
return "Login process already exists "
"with the same name";
}
}
return NULL;
}
void *context)
{
const char *error;
/* check defaults first, there's a few login_ settings defined in it
which need to be checked before trying to feed it to login
handler.. */
return NULL;
return "Authentication process name not defined yet";
}
return "Login process name not defined yet";
return parse_setting_from_defs(settings_pool,
}
return error;
}
void master_settings_read(const char *path)
{
*set = default_settings;
}
void master_settings_init(void)
{
}
void master_settings_deinit(void)
{
}