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 );
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
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