From 893375f01381b1cd00cd8550291b8ed6b2a8edb9 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 4 Feb 2010 20:07:09 +0100 Subject: [PATCH 2/2] Document when LDAP referral chasing is available --- server/man/sssd-ldap.5.xml | 5 +++++ server/providers/ldap/ldap_common.c | 11 +++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/server/man/sssd-ldap.5.xml b/server/man/sssd-ldap.5.xml index 2737c24..18af37b 100644 --- a/server/man/sssd-ldap.5.xml +++ b/server/man/sssd-ldap.5.xml @@ -622,6 +622,11 @@ be enabled. + Please note that sssd only supports referral chasing + when it is compiled with OpenLDAP version 2.4.12 or + higher. + + Default: true diff --git a/server/providers/ldap/ldap_common.c b/server/providers/ldap/ldap_common.c index 15d44dc..a0cb223 100644 --- a/server/providers/ldap/ldap_common.c +++ b/server/providers/ldap/ldap_common.c @@ -165,6 +165,7 @@ int ldap_get_options(TALLOC_CTX *memctx, struct sdap_options *opts; char *schema; const char *pwd_policy; + bool ldap_referrals; int ret; opts = talloc_zero(memctx, struct sdap_options); @@ -217,6 +218,16 @@ int ldap_get_options(TALLOC_CTX *memctx, goto done; } + +#ifndef HAVE_LDAP_CONNCB + ldap_referrals = dp_opt_get_bool(opts->basic, SDAP_REFERRALS); + if (ldap_referrals) { + DEBUG(1, ("LDAP referrals are not supported, because the LDAP library " + "is too old, see sssd-ldap(5) for details.\n")); + ret = dp_opt_set_bool(opts->basic, SDAP_REFERRALS, false); + } +#endif + /* schema type */ schema = dp_opt_get_string(opts->basic, SDAP_SCHEMA); if (strcasecmp(schema, "rfc2307") == 0) { -- 1.6.6