master-settings.h revision 617e13833c798435e2be425b99c27ecaad1b8393
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#ifndef MASTER_SETTINGS_H
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#define MASTER_SETTINGS_H
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct file_listener_settings {
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *path;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int mode;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *user;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *group;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen};
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenARRAY_DEFINE_TYPE(file_listener_settings, struct file_listener_settings *);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct inet_listener_settings {
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *address;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int port;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen bool ssl;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen};
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct service_settings {
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen struct master_settings *master_set;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *name;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *type;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *executable;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *user;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *group;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *privileged_group;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *extra_groups;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *chroot;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen const char *auth_dest_service;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen bool drop_priv_before_exec;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int process_limit;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int client_limit;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int vsz_limit;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_TYPE(file_listener_settings) unix_listeners;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_TYPE(file_listener_settings) fifo_listeners;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(inet_listeners, struct inet_listener_settings *);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen};
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct master_auth_settings {
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen bool debug;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen};
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct master_settings {
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *base_dir;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *libexec_dir;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int default_process_limit;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int default_client_limit;
93a7d1ee4b518b5c85f9721dc6539e4dab6aae00Timo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen bool version_ignore;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int first_valid_uid, last_valid_uid;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int first_valid_gid, last_valid_gid;
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainen ARRAY_DEFINE(services, struct service_settings *);
35fcdde46a71ac151c2518d48c841019f1181bb2Timo Sirainen ARRAY_DEFINE(auths, struct master_auth_settings *);
35fcdde46a71ac151c2518d48c841019f1181bb2Timo Sirainen};
35fcdde46a71ac151c2518d48c841019f1181bb2Timo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenextern struct setting_parser_info master_setting_parser_info;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct master_settings *
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenmaster_settings_read(pool_t pool, const char *config_binary,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *config_path);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenbool master_settings_do_fixes(const struct master_settings *set);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#endif
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen