summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2012-06-05 09:10:24 -0400
committerJakub Hrozek <jhrozek@redhat.com>2012-08-01 16:19:42 +0200
commitf6cd1236c27817b97db002094b76648d92b55f82 (patch)
treeec52e8402eed1564c005b7bddf1505eaaf084488 /src/providers
parent9da182cf4e6af46164d7e60574dcdd07bc11de3e (diff)
downloadsssd-f6cd1236c27817b97db002094b76648d92b55f82.tar.gz
sssd-f6cd1236c27817b97db002094b76648d92b55f82.tar.xz
sssd-f6cd1236c27817b97db002094b76648d92b55f82.zip
Primary server support: new option in ldap provider
This patch adds support for new config option ldap_backup_uri. The description of this option's functionality is included in man page in previous patch.
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ad/ad_opts.h2
-rw-r--r--src/providers/ipa/ipa_opts.h2
-rw-r--r--src/providers/ldap/ldap_init.c7
-rw-r--r--src/providers/ldap/ldap_opts.h2
-rw-r--r--src/providers/ldap/sdap.h2
5 files changed, 11 insertions, 4 deletions
diff --git a/src/providers/ad/ad_opts.h b/src/providers/ad/ad_opts.h
index 0d957bcd4..41491ddc2 100644
--- a/src/providers/ad/ad_opts.h
+++ b/src/providers/ad/ad_opts.h
@@ -38,6 +38,7 @@ struct dp_option ad_basic_opts[] = {
struct dp_option ad_def_ldap_opts[] = {
{ "ldap_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_search_base", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_bind_dn", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_authtok_type", DP_OPT_STRING, { "password" }, NULL_STRING},
@@ -96,6 +97,7 @@ struct dp_option ad_def_ldap_opts[] = {
{ "ldap_account_expire_policy", DP_OPT_STRING, { "ad" }, NULL_STRING },
{ "ldap_access_order", DP_OPT_STRING, { "filter" }, NULL_STRING },
{ "ldap_chpass_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_chpass_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_dns_service_name", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_update_last_change", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
{ "ldap_enumeration_search_timeout", DP_OPT_NUMBER, { .number = 60 }, NULL_NUMBER },
diff --git a/src/providers/ipa/ipa_opts.h b/src/providers/ipa/ipa_opts.h
index 6eedc0019..4925c599f 100644
--- a/src/providers/ipa/ipa_opts.h
+++ b/src/providers/ipa/ipa_opts.h
@@ -51,6 +51,7 @@ struct dp_option ipa_basic_opts[] = {
struct dp_option ipa_def_ldap_opts[] = {
{ "ldap_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_search_base", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_bind_dn", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_authtok_type", DP_OPT_STRING, NULL_STRING, NULL_STRING},
@@ -109,6 +110,7 @@ struct dp_option ipa_def_ldap_opts[] = {
{ "ldap_account_expire_policy", DP_OPT_STRING, { "ipa" }, NULL_STRING },
{ "ldap_access_order", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_chpass_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_dns_service_name", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_update_last_change", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
{ "ldap_enumeration_search_timeout", DP_OPT_NUMBER, { .number = 60 }, NULL_NUMBER },
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 90e5f666b..52bd233f1 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -88,6 +88,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
{
struct sdap_id_ctx *ctx;
const char *urls;
+ const char *backup_urls;
const char *dns_service_name;
const char *sasl_mech;
int ret;
@@ -117,12 +118,10 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
DEBUG(7, ("Service name for discovery set to %s\n", dns_service_name));
urls = dp_opt_get_string(ctx->opts->basic, SDAP_URI);
- if (!urls) {
- DEBUG(SSSDBG_CONF_SETTINGS, ("Missing ldap_uri, will use service discovery\n"));
- }
+ backup_urls = dp_opt_get_string(ctx->opts->basic, SDAP_BACKUP_URI);
ret = sdap_service_init(ctx, ctx->be, "LDAP",
- dns_service_name, urls, NULL,
+ dns_service_name, urls, backup_urls,
&ctx->service);
if (ret != EOK) {
DEBUG(1, ("Failed to initialize failover service!\n"));
diff --git a/src/providers/ldap/ldap_opts.h b/src/providers/ldap/ldap_opts.h
index 4ed6aaff4..9be6a0f65 100644
--- a/src/providers/ldap/ldap_opts.h
+++ b/src/providers/ldap/ldap_opts.h
@@ -31,6 +31,7 @@
struct dp_option default_basic_opts[] = {
{ "ldap_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_search_base", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_bind_dn", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_default_authtok_type", DP_OPT_STRING, { "password" }, NULL_STRING},
@@ -89,6 +90,7 @@ struct dp_option default_basic_opts[] = {
{ "ldap_account_expire_policy", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_access_order", DP_OPT_STRING, { "filter" }, NULL_STRING },
{ "ldap_chpass_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_chpass_backup_uri", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_dns_service_name", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_chpass_update_last_change", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
{ "ldap_enumeration_search_timeout", DP_OPT_NUMBER, { .number = 60 }, NULL_NUMBER },
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 4ca755e32..70b4e6ada 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -150,6 +150,7 @@ enum sdap_result {
enum sdap_basic_opt {
SDAP_URI = 0,
+ SDAP_BACKUP_URI,
SDAP_SEARCH_BASE,
SDAP_DEFAULT_BIND_DN,
SDAP_DEFAULT_AUTHTOK_TYPE,
@@ -207,6 +208,7 @@ enum sdap_basic_opt {
SDAP_ACCOUNT_EXPIRE_POLICY,
SDAP_ACCESS_ORDER,
SDAP_CHPASS_URI,
+ SDAP_CHPASS_BACKUP_URI,
SDAP_CHPASS_DNS_SERVICE_NAME,
SDAP_CHPASS_UPDATE_LAST_CHANGE,
SDAP_ENUM_SEARCH_TIMEOUT,