mail-storage-service.c revision bff606130fa332dbf837569f922028b68f45fd61
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen/* Copyright (c) 2009-2014 Dovecot authors, see the included COPYING file */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen/* If time moves backwards more than this, kill ourself instead of sleeping. */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen "Invalid user settings. Refer to server log for more information."
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen struct auth_master_connection *conn, *iter_conn;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen const char *set_cache_module, *set_cache_service;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen struct master_service_settings_cache *set_cache;
const char *const **userdb_next_fieldsp;
struct mail_storage_service_user {
const char *str;
key);
const char *line)
bool mail_debug;
unsigned int len;
int ret;
if (mail_debug) {
key);
const void *value;
return ret;
const char *dir)
const char *const *chroot_dirs;
return FALSE;
return FALSE;
return TRUE;
chroot_dirs++;
return FALSE;
const char **error_r)
unsigned int i, count;
int ret = 0;
for (i = 0; i < count; i++) {
#ifdef HAVE_SETPRIORITY
} else T_BEGIN {
} T_END;
if (ret < 0)
if (ret < 0) {
return ret;
const char *const **fields_r,
const char **error_r)
const char *new_username;
int ret;
if (ret > 0) {
} else if (ret == 0)
return ret;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
static const struct var_expand_table *
return tab;
const struct var_expand_table *
const char *str)
const char **error_r)
static void mail_storage_service_seteuid_root(void)
if (seteuid(0) < 0) {
&error)) {
if (disallow_root &&
if (keep_setuid_root) {
if (current_euid != 0) {
if (!setenv_only) {
const char **error_r)
T_BEGIN {
} T_END;
user);
if (diff > 0) {
diff++;
struct mail_storage_service_ctx *
const char *version;
unsigned int count;
geteuid() != 0) {
count = 0;
return ctx;
struct auth_master_connection *
static enum mail_storage_service_flags
return flags;
const char **error_r)
i_unreached();
const char **error_r)
void **sets;
geteuid() != 0) {
&error) < 0) {
error_r);
if (ret <= 0) {
return ret;
if (ret > 0) {
return ret;
const char *error;
unsigned int len;
bool disallow_root =
bool temp_priv_drop =
bool use_chroot;
if (use_chroot) {
if (!temp_priv_drop ||
const char *error;
const char **error_r)
int ret;
if (ret <= 0)
return ret;
if (ret < 0) {
return ret;
const char *error;
void **sets;
&error) < 0)
int ret = 0;
return ret;
flags);
const char **username_r)
const struct mail_storage_settings *
const struct mail_storage_service_input *
struct setting_parser_context *
T_BEGIN {
} T_END;
return set;