summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2009-12-10 21:00:26 +0100
committerBjörn Jacke <bj@sernet.de>2009-12-10 21:28:05 +0100
commit66836445a2d5fde1e82eae7fc2f6a6ee86a6c468 (patch)
treebfd00fffff307bf028a7a31a689efbb545850937 /source3/lib
parent835e7d6c98406725dc9dab891d3025b9a11b7eb9 (diff)
downloadsamba-66836445a2d5fde1e82eae7fc2f6a6ee86a6c468.tar.gz
samba-66836445a2d5fde1e82eae7fc2f6a6ee86a6c468.tar.bz2
samba-66836445a2d5fde1e82eae7fc2f6a6ee86a6c468.zip
s3: add LDAP Alias Dereferencing support
Thanks to Dan Cox for initial patch for 3.0. This closes #2350.
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbldap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index f7ca1c167b..4727c1593e 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -877,6 +877,7 @@ static int smbldap_open_connection (struct smbldap_state *ldap_state)
{
int rc = LDAP_SUCCESS;
int version;
+ int deref;
LDAP **ldap_struct = &ldap_state->ldap_struct;
rc = smb_ldap_setup_conn(ldap_struct, ldap_state->uri);
@@ -902,6 +903,16 @@ static int smbldap_open_connection (struct smbldap_state *ldap_state)
return rc;
}
+ /* Set alias dereferencing method */
+ deref = lp_ldap_deref();
+ if (deref != -1) {
+ if (ldap_set_option (*ldap_struct, LDAP_OPT_DEREF, &deref) != LDAP_OPT_SUCCESS) {
+ DEBUG(1,("smbldap_open_connection: Failed to set dereferencing method: %d\n", deref));
+ } else {
+ DEBUG(5,("Set dereferencing method: %d\n", deref));
+ }
+ }
+
DEBUG(2, ("smbldap_open_connection: connection opened\n"));
return rc;
}