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

Re: Patch for referrals (ITS#905)

Kurt@OpenLDAP.org wrote:
> I committed some changes to HEAD based in part on your patch.
> Please test and provide feedback to devel mailing list.  Thanks.

I have tested the modifications and there is a problem. Here is the code from 
request.c that handle the re-encoding of the scope:

if( srv->lud_scope == LDAP_SCOPE_DEFAULT &&
    scope != LDAP_SCOPE_SUBTREE )
  scope = LDAP_SCOPE_BASE;

With this code, if the referral tells what scope to use, its value is 
ignored... In rfc2255, the rule is:
- if the scope is in the url, its value must be used
- if there is no scope in the url, the scope is "base"

I remember there were some talks about these rules in an OpenLDAP mailing 
list and agree that when the original scope is "subtree" and no scope is 
precised in the referral, we should keep "subtree" instead of changing to 
"base". So, here is what I would write (I have tested it, it works):

if (srv->lud_scope != LDAP_SCOPE_DEFAULT)
  /* take the scope from the url*/
  scope = srv->lud_scope;
else if (scope != LDAP_SCOPE_SUBTREE)
  /* "base" is the default value */
  scope = LDAP_SCOPE_BASE;

(sorry for this late reply)
Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
80, avenue des Buttes de Coesmes - 35700 RENNES
tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85