From d46252fb21a6c3e6d24bbaa2c49fae2e1c23b296 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 7 Dec 2001 22:41:43 +0000 Subject: [PATCH] Port reference scope fix from back-ldbm --- servers/slapd/back-bdb/search.c | 6 +++++- tests/data/referrals.ldif | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 1251cefaab..f642ca9b5f 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -357,8 +357,12 @@ bdb_search( if ( !manageDSAit && scope != LDAP_SCOPE_BASE && is_entry_referral( e ) ) { - struct berval **refs = get_entry_referrals( + struct berval **erefs = get_entry_referrals( be, conn, op, e, NULL, scope ); + struct berval **ref = referral_rewrite( eref, e->e_dn, NULL, + scope == LDAP_SCOPE_SUBTREE + ? LDAP_SCOPE_SUBTREE + : LDAP_SCOPE_BASE ); send_search_reference( be, conn, op, e, refs, NULL, &v2refs ); diff --git a/tests/data/referrals.ldif b/tests/data/referrals.ldif index abb0b849ea..54911cb0a6 100644 --- a/tests/data/referrals.ldif +++ b/tests/data/referrals.ldif @@ -2,30 +2,30 @@ dn: c=US c: US objectclass: country -dn: o=ABC, c=US +dn: o=ABC,c=US o: ABC ref: ldap//hostA/o=abc,c=us HostA ref: ldap//hostB/o=abc,c=us HostB objectclass: referral objectclass: extensibleObject -dn: o=XYZ, c=US +dn: o=XYZ,c=US o: XYZ ref: ldap//hostC/o=xyz,c=us HostC objectclass: referral objectclass: extensibleObject -dn: o=Alias, c=US +dn: o=Alias,c=US o: Alias -aliasedObjectName: o=University of Michigan, c=US +aliasedObjectName: o=University of Michigan,c=US objectclass: alias objectclass: extensibleObject -dn: o=University of Michigan, c=US +dn: o=University of Michigan,c=US o: University of Michigan objectclass: organization -dn: cn=Manager, o=University of Michigan, c=US +dn: cn=Manager,o=University of Michigan,c=US cn: Manager cn: Directory Manager cn: Dir Man @@ -34,17 +34,17 @@ description: Manager of the directory userpassword:: c2VjcmV0 objectclass: person -dn: cn=Alias, o=University of Michigan, c=US +dn: cn=Alias,o=University of Michigan,c=US cn: Alias -aliasedobjectname: cn=Manager, o=University of Michigan, c=US +aliasedobjectname: cn=Manager,o=University of Michigan,c=US objectclass: extensibleObject -dn: cn=Circular, o=University of Michigan, c=US +dn: cn=Circular,o=University of Michigan,c=US cn: Circular -aliasedobjectname: cn=Circular, o=University of Michigan, c=US +aliasedobjectname: cn=Circular,o=University of Michigan,c=US objectclass: extensibleObject -dn: cn=Subordinate, o=University of Michigan, c=US +dn: cn=Subordinate,o=University of Michigan,c=US cn: Subordinate -aliasedobjectname: cn=Subordinate, cn=Alias, o=University of Michigan, c=US +aliasedobjectname: cn=Subordinate,cn=Alias,o=University of Michigan,c=US objectclass: extensibleObject -- 2.39.5