bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "lib.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "buffer.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "settings-parser.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "service-settings.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "login-settings.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include "imap-urlauth-login-settings.h"
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch#include <stddef.h>
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch/* <settings checks> */
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstatic struct file_listener_settings
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschimap_urlauth_login_unix_listeners_array[] = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch { "imap-urlauth", 0666, "", "" }
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstatic struct file_listener_settings *imap_urlauth_login_unix_listeners[] = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch &imap_urlauth_login_unix_listeners_array[0]
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstatic buffer_t imap_urlauth_login_unix_listeners_buf = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch imap_urlauth_login_unix_listeners,
da7f1a07f583df8905684a7b78469960afd7c78dPhil Carmody sizeof(imap_urlauth_login_unix_listeners), { NULL, }
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch/* </settings checks> */
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstruct service_settings imap_urlauth_login_service_settings = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .name = "imap-urlauth-login",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .protocol = "imap",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .type = "login",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .executable = "imap-urlauth-login",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .user = "$default_login_user",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .group = "",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .privileged_group = "",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .extra_groups = "",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .chroot = "token-login",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .drop_priv_before_exec = FALSE,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .process_min_avail = 0,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .process_limit = 0,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .client_limit = 0,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .service_count = 1,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .idle_kill = 0,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .vsz_limit = (uoff_t)-1,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .unix_listeners = { { &imap_urlauth_login_unix_listeners_buf,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch sizeof(imap_urlauth_login_unix_listeners[0]) } },
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .fifo_listeners = ARRAY_INIT,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .inet_listeners = ARRAY_INIT
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstatic const struct setting_define imap_urlauth_login_setting_defines[] = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch SETTING_DEFINE_LIST_END
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschstatic const struct setting_parser_info *imap_urlauth_login_setting_dependencies[] = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch &login_setting_parser_info,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch NULL
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschconst struct setting_parser_info imap_urlauth_login_setting_parser_info = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .module_name = "imap-urlauth-login",
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .defines = imap_urlauth_login_setting_defines,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .type_offset = (size_t)-1,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .parent_offset = (size_t)-1,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch .dependencies = imap_urlauth_login_setting_dependencies
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Boschconst struct setting_parser_info *imap_urlauth_login_setting_roots[] = {
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch &login_setting_parser_info,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch &imap_urlauth_login_setting_parser_info,
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch NULL
f9511e684858bf5f6ac77ab12254b85b737beae8Stephan Bosch};