summaryrefslogtreecommitdiff
path: root/source3/lib/smbldap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-13 10:03:57 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-13 10:03:57 +1100
commitae507f620ae34b69c5df86980ea6e374c9c1e548 (patch)
treec2669a72121c02ecc2d1e4aee16a3129960a5c66 /source3/lib/smbldap.c
parentdfbaf79a1b7455a0eef61813e07cb661cf17e995 (diff)
parent4a1b50afd567313cc25d5bbc14e01e170aa62a00 (diff)
downloadsamba-ae507f620ae34b69c5df86980ea6e374c9c1e548.tar.gz
samba-ae507f620ae34b69c5df86980ea6e374c9c1e548.tar.bz2
samba-ae507f620ae34b69c5df86980ea6e374c9c1e548.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/lib/smbldap.c')
-rw-r--r--source3/lib/smbldap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index c96801a72b..47b2208880 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -721,9 +721,18 @@ int smb_ldap_setup_conn(LDAP **ldap_struct, const char *uri)
rc = ldap_initialize(ldap_struct, uri);
if (rc) {
DEBUG(0, ("ldap_initialize: %s\n", ldap_err2string(rc)));
+ return rc;
}
- return rc;
+ if (lp_ldap_ref_follow() != Auto) {
+ rc = ldap_set_option(*ldap_struct, LDAP_OPT_REFERRALS,
+ lp_ldap_ref_follow() ? LDAP_OPT_ON : LDAP_OPT_OFF);
+ if (rc != LDAP_SUCCESS)
+ DEBUG(0, ("Failed to set LDAP_OPT_REFERRALS: %s\n",
+ ldap_err2string(rc)));
+ }
+
+ return LDAP_SUCCESS;
#else
/* Parse the string manually */
@@ -774,7 +783,6 @@ int smb_ldap_setup_conn(LDAP **ldap_struct, const char *uri)
}
#endif /* HAVE_LDAP_INITIALIZE */
-
/* now set connection timeout */
#ifdef LDAP_X_OPT_CONNECT_TIMEOUT /* Netscape */
{