From: Graham B. <gb...@po...> - 2001-04-20 12:09:53
|
It would seem the server thinks you are a version 2 client. Error code 9 is LDAP_PARTIAL_RESULTS Returned to version 2 clients when a referral is returned. The response will contain a list of URL's for other servers. It is then returning the referrals in the error message. Can you turn on debug by adding debug => 15 into the arguments of the constructor Graham. On Fri, Apr 20, 2001 at 01:23:43PM +0200, Roland Stigge wrote: > Hi, > > Chris Ridd wrote: > > > > (We are using Net::LDAP 0.22 and OpenLDAP 1.2.11) > > > It seems that my configuration doesn't return any referrals. I have > > > configured two servers, one holding o=epigenomics, the other on > > > c=us,o=epigenomics. Via PHP and ldapsearch tools, the inserted referrals > > > even seem to transparently redirect the client to the second server when > > > accessing/searching the c=us,epigenomics substructure. But with my > > > Net::LDAP code: > > > You are binding using LDAPv2. LDAPv2 did not have referrals. > > > > Some vendors have 'patched in' some support for referrals in LDAPv2, but > > this is completely non-standard and not supported by Net::LDAP. > > > > Try binding with LDAPv3 instead and see what you get. Hint: pass version => > > 3 in the bind call. > > I already tried that: > ----- > $ldap = Net::LDAP->new("wilson"); > $ldap->bind(version => 3); > print "LDAP Version: ",$ldap->version,"\n"; > $mesg = $ldap->search( base => "o=epigenomics", > filter => '(cn=*)', > deref => 3, > ); > > @referrals = $mesg->referrals; > foreach $ref (@referrals) { > print "Referral: ",$ref,"\n"; > } > > print "Return code: ",$mesg->code,"\n"; > print "Error message: \"",$mesg->error,"\"\n"; > > $n = $mesg->all_entries; > print "Number of Entries: ".$n."\n"; > > foreach $entry ($mesg->entries) { > print "dn: ",$entry->dn,"\n"; > } > ----- > > but got the same result: > ----- > LDAP Version: 3 > Return code: 9 > Error message: "Referral: > ldap://deledda/c=gdr,o=epigenomics > ldap://deledda/c=us,o=epigenomics" > Number of Entries: 2 > dn: cn=admin,o=epigenomics > dn: cn=updated,o=epigenomics > ----- > > Even with LDAPv3, I get the same result. "Real" referrals seem to be > suppressed (in the array). Instead, the error message (!) contains the > referral. As you see, I added a referral. So even multiple referrals are > displayed in the error message. > > Is this the desired behavior of Net::LDAP? I don't like the idea to > parse error strings instead of being able to use the native referrals in > $mesg->referrals. > > Thanks in advance. > > bye, > > -- > Roland Stigge > > Epigenomics AG Kastanienallee 24 > www.epigenomics.com 10435 Berlin > |