00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _CONF_DB_H
00023 #define _CONF_DB_H
00024
00025 #include <stdbool.h>
00026 #include "talloc.h"
00027 #include "tevent.h"
00028 #include "ldb.h"
00029 #include "ldb_errors.h"
00030
00047 #define CONFDB_FILE "config.ldb"
00048 #define CONFDB_DEFAULT_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
00049 #define SSSD_MIN_ID 1000
00050
00051
00052
00053
00054
00055 #define CONFDB_SERVICE_PATH_TMPL "config/%s"
00056 #define CONFDB_SERVICE_COMMAND "command"
00057 #define CONFDB_SERVICE_DEBUG_LEVEL "debug_level"
00058 #define CONFDB_SERVICE_DEBUG_TIMESTAMPS "debug_timestamps"
00059 #define CONFDB_SERVICE_DEBUG_TO_FILES "debug_to_files"
00060 #define CONFDB_SERVICE_TIMEOUT "timeout"
00061 #define CONFDB_SERVICE_RECON_RETRIES "reconnection_retries"
00062
00063
00064 #define CONFDB_MONITOR_CONF_ENTRY "config/sssd"
00065 #define CONFDB_MONITOR_SBUS_TIMEOUT "sbus_timeout"
00066 #define CONFDB_MONITOR_ACTIVE_SERVICES "services"
00067 #define CONFDB_MONITOR_ACTIVE_DOMAINS "domains"
00068 #define CONFDB_MONITOR_NAME_REGEX "re_expression"
00069 #define CONFDB_MONITOR_FULL_NAME_FORMAT "full_name_format"
00070
00071
00072 #define CONFDB_NSS_CONF_ENTRY "config/nss"
00073 #define CONFDB_NSS_ENUM_CACHE_TIMEOUT "enum_cache_timeout"
00074 #define CONFDB_NSS_ENTRY_CACHE_NOWAIT_PERCENTAGE "entry_cache_nowait_percentage"
00075 #define CONFDB_NSS_ENTRY_NEG_TIMEOUT "entry_negative_timeout"
00076 #define CONFDB_NSS_FILTER_USERS_IN_GROUPS "filter_users_in_groups"
00077 #define CONFDB_NSS_FILTER_USERS "filter_users"
00078 #define CONFDB_NSS_FILTER_GROUPS "filter_groups"
00079 #define CONFDB_NSS_PWFIELD "pwfield"
00080
00081
00082 #define CONFDB_PAM_CONF_ENTRY "config/pam"
00083 #define CONFDB_PAM_CRED_TIMEOUT "offline_credentials_expiration"
00084
00085
00086 #define CONFDB_DP_CONF_ENTRY "config/dp"
00087
00088
00089 #define CONFDB_DOMAIN_PATH_TMPL "config/domain/%s"
00090 #define CONFDB_DOMAIN_BASEDN "cn=domain,cn=config"
00091 #define CONFDB_DOMAIN_ID_PROVIDER "id_provider"
00092 #define CONFDB_DOMAIN_AUTH_PROVIDER "auth_provider"
00093 #define CONFDB_DOMAIN_ACCESS_PROVIDER "access_provider"
00094 #define CONFDB_DOMAIN_CHPASS_PROVIDER "chpass_provider"
00095 #define CONFDB_DOMAIN_COMMAND "command"
00096 #define CONFDB_DOMAIN_TIMEOUT "timeout"
00097 #define CONFDB_DOMAIN_ATTR "cn"
00098 #define CONFDB_DOMAIN_ENUMERATE "enumerate"
00099 #define CONFDB_DOMAIN_MINID "min_id"
00100 #define CONFDB_DOMAIN_MAXID "max_id"
00101 #define CONFDB_DOMAIN_CACHE_CREDS "cache_credentials"
00102 #define CONFDB_DOMAIN_LEGACY_PASS "store_legacy_passwords"
00103 #define CONFDB_DOMAIN_MPG "magic_private_groups"
00104 #define CONFDB_DOMAIN_FQ "use_fully_qualified_names"
00105 #define CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT "entry_cache_timeout"
00106
00107
00108 #define CONFDB_LOCAL_DEFAULT_SHELL "default_shell"
00109 #define CONFDB_LOCAL_DEFAULT_BASEDIR "base_directory"
00110 #define CONFDB_LOCAL_CREATE_HOMEDIR "create_homedir"
00111 #define CONFDB_LOCAL_REMOVE_HOMEDIR "remove_homedir"
00112 #define CONFDB_LOCAL_UMASK "homedir_umask"
00113 #define CONFDB_LOCAL_SKEL_DIR "skel_dir"
00114 #define CONFDB_LOCAL_MAIL_DIR "mail_dir"
00115
00116
00117 #define CONFDB_PROXY_LIBNAME "proxy_lib_name"
00118 #define CONFDB_PROXY_PAM_TARGET "proxy_pam_target"
00119
00120
00121 #define CONFDB_KRB5_KDCIP "krb5_kdcip"
00122 #define CONFDB_KRB5_REALM "krb5_realm"
00123 #define CONFDB_KRB5_CCACHEDIR "krb5_ccachedir"
00124 #define CONFDB_KRB5_CCNAME_TMPL "krb5_ccname_template"
00125 #define CONFDB_KRB5_CHANGEPW_PRINC "krb5_changepw_principal"
00126 #define CONFDB_KRB5_AUTH_TIMEOUT "krb5_auth_timeout"
00127
00128 struct confdb_ctx;
00129 struct config_file_ctx;
00130
00135 struct sss_domain_info {
00136 char *name;
00137 char *provider;
00138 int timeout;
00139 bool enumerate;
00140 bool fqnames;
00141 uint32_t id_min;
00142 uint32_t id_max;
00143
00144 bool cache_credentials;
00145 bool legacy_passwords;
00146
00147 struct sss_domain_info *next;
00148 };
00149
00162 int confdb_init(TALLOC_CTX *mem_ctx,
00163 struct confdb_ctx **cdb_ctx,
00164 char *confdb_location);
00165
00178 int confdb_get_domain(struct confdb_ctx *cdb,
00179 const char *name,
00180 struct sss_domain_info **domain);
00181
00192 int confdb_get_domains(struct confdb_ctx *cdb,
00193 struct sss_domain_info **domains);
00194
00195
00221 int confdb_add_param(struct confdb_ctx *cdb,
00222 bool replace,
00223 const char *section,
00224 const char *attribute,
00225 const char **values);
00226
00246 int confdb_get_param(struct confdb_ctx *cdb,
00247 TALLOC_CTX *mem_ctx,
00248 const char *section,
00249 const char *attribute,
00250 char ***values);
00251
00274 int confdb_get_string(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
00275 const char *section, const char *attribute,
00276 const char *defstr, char **result);
00277
00302 int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
00303 const char *section, const char *attribute,
00304 int defval, int *result);
00305
00331 int confdb_get_bool(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
00332 const char *section, const char *attribute,
00333 bool defval, bool *result);
00334
00361 int confdb_get_string_as_list(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
00362 const char *section, const char *attribute,
00363 char ***result);
00367 #endif