Referral support (was: port of Net::LDAP::Entry)

Michael Ströder michael at stroeder.com
Thu Jul 25 12:42:30 CEST 2002


Robert Sander wrote:
> On Thu, Jul 25, 2002 at 11:59:21AM +0200, Michael Ströder wrote:
> 
>>Before I write a pile of postings about it I'd like to know what 
>>your understanding of handling referrals is.
> 
> The Perl modules in Net::LDAP return a entries array and a references
> array after a search when the parameter "deref" is set to 3. I think
> this is DEREF_ALWAYS.

Option OPT_DEREF has nothing to do with referrals. It's for 
aliases. OPT_REFERRALS is the relevant option which defines 
whether the OpenLDAP library internally follows referrals or not.

> With the referrals you are able to search further in the tree.

If you switch off internal referral handling you will receive 
search continuations along with normal search results as tuples 
with None as first item and a string containing the LDAP URL as 
second item. (Note that it might block when python-ldap is using 
the OpenLDAP 2.1 libs. I did not have the possibility to track 
down this issue.)

See example:

http://sites.inka.de:8002/web2ldap?ldap://ldap.rediris.es/dc%3Des??one?

(Please use [Disconnect] after use to quickly erase the LDAP 
connection. This demo runs on a restricted shell-account allowing 
only 24 file handles).

Example code:




More information about the python-ldap mailing list