summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-01-20 11:21:50 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-02-02 14:41:40 -0500
commit0d85b37ab0ede884408e68246ec21092c3718610 (patch)
tree5588fe771a798ce02633233c795d34a773debc1f /server/providers
parent7c8f422495347e6ff829246ebf5d7faad9f6d160 (diff)
downloadsssd-0d85b37ab0ede884408e68246ec21092c3718610.tar.gz
sssd-0d85b37ab0ede884408e68246ec21092c3718610.tar.bz2
sssd-0d85b37ab0ede884408e68246ec21092c3718610.zip
Add new option ldap_referrals
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/ldap/ldap_common.c3
-rw-r--r--server/providers/ldap/sdap.h1
-rw-r--r--server/providers/ldap/sdap_async_connection.c11
3 files changed, 14 insertions, 1 deletions
diff --git a/server/providers/ldap/ldap_common.c b/server/providers/ldap/ldap_common.c
index 74b478cc..15d44dc1 100644
--- a/server/providers/ldap/ldap_common.c
+++ b/server/providers/ldap/ldap_common.c
@@ -61,7 +61,8 @@ struct dp_option default_basic_opts[] = {
{ "ldap_krb5_init_creds", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
/* use the same parm name as the krb5 module so we set it only once */
{ "krb5_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
- { "ldap_pwd_policy", DP_OPT_STRING, { "none" } , NULL_STRING }
+ { "ldap_pwd_policy", DP_OPT_STRING, { "none" } , NULL_STRING },
+ { "ldap_referrals", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE }
};
struct sdap_attr_map generic_attr_map[] = {
diff --git a/server/providers/ldap/sdap.h b/server/providers/ldap/sdap.h
index a5b9e832..f32ce050 100644
--- a/server/providers/ldap/sdap.h
+++ b/server/providers/ldap/sdap.h
@@ -137,6 +137,7 @@ enum sdap_basic_opt {
SDAP_KRB5_KINIT,
SDAP_KRB5_REALM,
SDAP_PWD_POLICY,
+ SDAP_REFERRALS,
SDAP_OPTS_BASIC /* opts counter */
};
diff --git a/server/providers/ldap/sdap_async_connection.c b/server/providers/ldap/sdap_async_connection.c
index 99cb3754..1ed6b3f8 100644
--- a/server/providers/ldap/sdap_async_connection.c
+++ b/server/providers/ldap/sdap_async_connection.c
@@ -57,6 +57,7 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx,
int ret = EOK;
int msgid;
struct ldap_cb_data *cb_data;
+ bool ldap_referrals;
req = tevent_req_create(memctx, &state, struct sdap_connect_state);
if (!req) return NULL;
@@ -109,6 +110,16 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx,
goto fail;
}
+ /* Set Referral chasing */
+ ldap_referrals = dp_opt_get_bool(opts->basic, SDAP_REFERRALS);
+ lret = ldap_set_option(state->sh->ldap, LDAP_OPT_REFERRALS,
+ (ldap_referrals ? LDAP_OPT_ON : LDAP_OPT_OFF));
+ if (lret != LDAP_OPT_SUCCESS) {
+ DEBUG(1, ("Failed to set referral chasing to %s\n",
+ (ldap_referrals ? "LDAP_OPT_ON" : "LDAP_OPT_OFF")));
+ goto fail;
+ }
+
/* add connection callback */
state->sh->conncb = talloc_zero(state->sh, struct ldap_conncb);
if (state->sh->conncb == NULL) {