From: Kurt Zeilenga Date: Fri, 8 Dec 2000 19:45:04 +0000 (+0000) Subject: Fix referral scope logic X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1629 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8292a62da2d85ec7f877a47f1b1684a1a589dee;p=openldap Fix referral scope logic --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 5b6622365d..880b0015bc 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -977,11 +977,17 @@ re_encode_request( LDAP *ld, /* search requests need to be re-scope-ed */ rc = ber_scanf( &tmpber, "{ae" /*"}"*/, &orig_dn, &scope ); - if( srv->lud_scope == LDAP_SCOPE_DEFAULT && - scope != LDAP_SCOPE_SUBTREE ) - { + if( srv->lud_scope != LDAP_SCOPE_DEFAULT ) { + /* use the scope provided in reference */ + scope = srv->lud_scope; + + } else if ( scope != LDAP_SCOPE_SUBTREE ) { + /* use scope implied by previous operation */ + /* base -> base */ + /* one -> base */ + /* subtree -> subtree */ scope = LDAP_SCOPE_BASE; - } + } } else { rc = ber_scanf( &tmpber, "{a" /*}*/, &orig_dn );