[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Referral chasing when using ldap_search()

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Christine
> Robertson

> Greetings all,
Hello Christine,

> Are referrals automatically chased when using ldap_search() ?

Only if you enable the specific option.
> I have a set of directories with dc=cordoors,dc=com as the base
> suffix, and referrals to other suffixes such as dc=aus,dc=cordoors,dc=com
> and dc=us,dc=cordoors,dc=coms, which live in different directories
> on the same host (all in the same slapd.conf, all in the right order).
> Using ldapsearch at the command line with the -C option picks
> up entries under the subtrees with no problem when the search
> base is given as -b dc=cordoors,dc=com.
> However, when I give the same base to a C search program, I
> get no records.  If I specify one of the subtrees as the base,
> no problems (yes, I am using LDAP_SCOPE_SUBTREE).
> I have tried using ldap_set_options() to turn referrals on
> explicitly, but no success.  We initialize, bind, initiate the
> search all OK, then get NULL back from ldap_first_entry with
> an error code of "Success".  It's quite happy that there are
> no entries.
> Can someone point me at what I am doing wrong, or more doco
> on using the C API other than the manual pages?  I would rather
> not have to grab the code from ldapsearch if I can avoid it.

Well, the ldapsearch client just uses ldap_set_option, it doesn't do
anything that you can't do.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support