[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Cannot follow referrals in C program
We are running LDAP 2.0.23 under FreeBSD 4.6.
We have several directories with suffixes
dc=au,dc=cordoors,dc=com
dc=my,dc=cordoors,dc=com
dc=us,dc=cordoods,dc=com
...
dc=cordoors,dc=com
The final directory contains referrals to the others.
All of this works just fine, referrals and all,
until I try to write C programs to search from
the top level, at which point referrals
absolutely fail to work.
I have looked at the code for ldapsearch -- I have
even stolen chuncks of it ;-).
I an setting LDAP_OPT_REFERRALS, after ldap_initialize and before ldap_bind:
if (ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON) != LDAP_OPT_SUCCESS)
{
fprintf(stderr, "Could not set LDAP_OPT_REFERRALS\n");
return 1;
}
and using ldap_search_ext:
if ((ret = ldap_search_ext(ld, base, LDAP_SCOPE_SUBTREE, filter, attrs, 0,
sctrls, cctrls, timeout, sizelimit, &msgid)) != LDAP_SUCCESS)
Base is really what I think it is (dc=cordoors,dc=com).
Referrals are Just Not Followed. What am I missing?
Below is the logfile, showing a failed retrieve with my
program, and a successful one with ldapsearch.
Help pleasse!
--Chris Robertson
Corinthian Engineering
Sydney, Australia
Sep 20 16:14:15 mippet slapd[81819]: daemon: conn=12 fd=14 connection from IP=192.65.182.30:2945 (IP=:: 34049) accepted.
Sep 20 16:14:15 mippet slapd[81819]: conn=12 op=0 BIND dn="" method=128
Sep 20 16:14:15 mippet slapd[81819]: conn=12 op=0 RESULT tag=97 err=0 text=
Sep 20 16:14:15 mippet slapd[81819]: conn=12 op=1 SRCH base="dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:14:15 mippet slapd[81819]: conn=12 op=1 SEARCH RESULT tag=101 err=9 text=Referral: ldaps://mippet.ci.com.au:636/dc=au,dc=cordoors,
dc=com ldaps://mippet.ci.com.au:636/dc=my,dc=cordoors,dc=com ldaps://mippet.ci.com.au:636/dc=id,dc=cordoors,dc=com ldaps://mippet.ci.com.au:
636/dc=th,dc=cordoors,dc=com ldaps://mippet.ci.com.au:636/dc=sg,dc=cordoors,dc=com ldaps://mippet.ci.com.au:636/dc=us,dc=cordoors,dc=com
Sep 20 16:14:15 mippet slapd[81819]: daemon: conn=13 fd=50 connection from IP=192.65.182.30:2946 (IP=:: 31746) accepted.
Sep 20 16:14:15 mippet slapd[81819]: conn=13 op=0 BIND dn="" method=128
Sep 20 16:14:15 mippet slapd[81819]: conn=13 op=0 RESULT tag=97 err=0 text=
Sep 20 16:14:15 mippet slapd[81819]: conn=13 op=1 SRCH base="dc=au,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:14:15 mippet slapd[81819]: conn=13 op=1 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:14:15 mippet slapd[81819]: conn=12 op=2 UNBIND
Sep 20 16:14:15 mippet slapd[81819]: conn=-1 fd=14 closed
Sep 20 16:14:15 mippet slapd[81819]: conn=13 op=2 UNBIND
Sep 20 16:14:15 mippet slapd[81819]: conn=-1 fd=50 closed
Sep 20 16:18:34 mippet slapd[81819]: daemon: conn=14 fd=14 connection from IP=192.65.182.30:3237 (IP=:: 34049) accepted.
Sep 20 16:18:34 mippet slapd[81819]: conn=14 op=0 BIND dn="" method=128
Sep 20 16:18:34 mippet slapd[81819]: conn=14 op=0 RESULT tag=97 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=14 op=1 SRCH base="dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=14 op=1 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: daemon: conn=15 fd=50 connection from IP=192.65.182.30:3238 (IP=:: 31746) accepted.
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=0 BIND dn="" method=128
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=0 RESULT tag=97 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=1 SRCH base="dc=au,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=2 SRCH base="dc=us,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=3 SRCH base="dc=sg,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=4 SRCH base="dc=th,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=4 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=5 SRCH base="dc=id,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=6 SRCH base="dc=my,dc=cordoors,dc=com" scope=2 filter="(objectClass=ciServer)"
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=2 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=3 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=5 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=6 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=1 SEARCH RESULT tag=101 err=0 text=
Sep 20 16:18:34 mippet slapd[81819]: conn=14 op=2 UNBIND
Sep 20 16:18:34 mippet slapd[81819]: conn=-1 fd=14 closed
Sep 20 16:18:34 mippet slapd[81819]: conn=15 op=7 UNBIND
Sep 20 16:18:34 mippet slapd[81819]: conn=-1 fd=50 closed