From 66836445a2d5fde1e82eae7fc2f6a6ee86a6c468 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Thu, 10 Dec 2009 21:00:26 +0100 Subject: s3: add LDAP Alias Dereferencing support Thanks to Dan Cox for initial patch for 3.0. This closes #2350. --- source3/lib/smbldap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/lib/smbldap.c') 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; } -- cgit