/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "hash-method.h"
#include "settings-parser.h"
#include "master-service-private.h"
#include "master-service-settings.h"
#include "service-settings.h"
#include "auth-settings.h"
#include <stddef.h>
/* <settings checks> */
{ "auth-login", 0600, "$default_internal_user", "" },
{ "auth-client", 0600, "$default_internal_user", "" },
{ "auth-userdb", 0666, "$default_internal_user", "" },
{ "auth-master", 0600, "", "" }
};
};
};
/* </settings checks> */
.name = "auth",
.protocol = "",
.type = "",
.executable = "auth",
.user = "$default_internal_user",
.group = "",
.privileged_group = "",
.extra_groups = "",
.chroot = "",
.process_min_avail = 0,
.process_limit = 1,
.client_limit = 0,
.service_count = 0,
.idle_kill = 0,
.unix_listeners = { { &auth_unix_listeners_buf,
sizeof(auth_unix_listeners[0]) } },
};
/* <settings checks> */
{ "auth-worker", 0600, "$default_internal_user", "" }
};
};
};
/* </settings checks> */
.name = "auth-worker",
.protocol = "",
.type = "",
.executable = "auth -w",
.user = "",
.group = "",
.privileged_group = "",
.extra_groups = "",
.chroot = "",
.process_min_avail = 0,
.process_limit = 0,
.client_limit = 1,
.service_count = 1,
.idle_kill = 0,
sizeof(auth_worker_unix_listeners[0]) } },
};
};
.name = "",
.driver = "",
.args = "",
.default_fields = "",
.override_fields = "",
.mechanisms = "",
.username_filter = "",
.skip = "never:authenticated:unauthenticated",
.result_success = "return-ok:return:return-fail:continue:continue-ok:continue-fail",
.result_failure = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
.result_internalfail = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
.auth_verbose = "default:yes:no"
};
.struct_size = sizeof(struct auth_passdb_settings),
};
};
/* NOTE: when adding fields, update also auth.c:userdb_dummy_set */
.name = "",
.driver = "",
.args = "",
.default_fields = "",
.override_fields = "",
.skip = "never:found:notfound",
.result_success = "return-ok:return:return-fail:continue:continue-ok:continue-fail",
.result_failure = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
.result_internalfail = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
.auth_verbose = "default:yes:no"
};
.struct_size = sizeof(struct auth_userdb_settings),
};
/* we're kind of kludging here to avoid "auth_" prefix in the struct fields */
};
.mechanisms = "plain",
.realms = "",
.default_realm = "",
.cache_size = 0,
.username_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@",
.username_translation = "",
.username_format = "%Lu",
.master_user_separator = "",
.anonymous_username = "anonymous",
.krb5_keytab = "",
.gssapi_hostname = "",
.winbind_helper_path = "/usr/bin/ntlm_auth",
.proxy_self = "",
.failure_delay = 2,
.policy_server_url = "",
.policy_server_api_header = "",
.policy_server_timeout_msecs = 2000,
.policy_hash_mech = "sha256",
.policy_hash_nonce = "",
.policy_request_attributes = "login=%{requested_username} pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%s",
.policy_hash_truncate = 12,
.debug_passwords = FALSE,
.verbose_passwords = "no",
.ssl_client_ca_dir = "",
.ssl_client_ca_file = "",
.use_winbind = FALSE,
.worker_max_count = 30,
.passdbs = ARRAY_INIT,
.userdbs = ARRAY_INIT,
.base_dir = PKG_RUNDIR,
.first_valid_uid = 500,
.last_valid_uid = 0,
.first_valid_gid = 1,
.last_valid_gid = 0,
};
.module_name = "auth",
.struct_size = sizeof(struct auth_settings),
};
/* <settings checks> */
static bool
const char **error_r)
{
const char *const *tmp;
unsigned int ips_count;
int ret;
return TRUE;
}
if (ret != 0) {
"gethostbyname(%s) failed: %s",
}
}
return TRUE;
}
static bool
const char **error_r)
{
unsigned int num;
if (p != NULL) {
"Invalid truncation number: '%s'", p+1);
return FALSE;
}
}
return TRUE;
return TRUE;
return TRUE;
/* just use it as alias for "plain" */
return TRUE;
} else {
*error_r = "auth_verbose_passwords: Invalid value";
return FALSE;
}
}
const char **error_r)
{
const char *p;
if (set->debug_passwords)
if (set->worker_max_count == 0) {
*error_r = "auth_worker_max_count must be above zero";
return FALSE;
}
/* probably a configuration error.
older versions used megabyte numbers */
set->cache_size);
return FALSE;
}
return FALSE;
/* all chars are allowed */
sizeof(set->username_chars_map));
} else {
}
p = set->username_translation;
for (; *p != '\0' && p[1] != '\0'; p += 2)
}
set->realms_arr =
*error_r = "auth_policy_hash_nonce must be set when policy server is used";
return FALSE;
}
*error_r = "invalid auth_policy_hash_mech given";
return FALSE;
}
return FALSE;
}
}
return FALSE;
return TRUE;
}
static bool
const char **error_r)
{
*error_r = "passdb is missing driver";
return FALSE;
}
*error_r = "Obsolete pass=yes setting mixed with non-default result_success";
return FALSE;
}
return TRUE;
}
static bool
const char **error_r)
{
*error_r = "userdb is missing driver";
return FALSE;
}
return TRUE;
}
/* </settings checks> */
struct auth_settings *
struct master_service_settings_output *output_r)
{
};
const char *error;
void **sets;
i_unreached();
return sets[0];
}