X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=source3%2Flib%2Fsmbldap.c;h=4727c1593e57f84e79bdf8ab845ee977ba4ecb7c;hp=f7ca1c167bdc82623bef3c05e548b93e75f040e2;hb=66836445a2d5fde1e82eae7fc2f6a6ee86a6c468;hpb=835e7d6c98406725dc9dab891d3025b9a11b7eb9;ds=sidebyside diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index f7ca1c167bd..4727c1593e5 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; }