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

Referral chasing when using ldap_search()



Greetings all,

Are referrals automatically chased when using ldap_search() ?

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.

--Chris Robertson
Corinthian Engineering