/* referral.c - BDB backend referral handler */
/* $OpenLDAP$ */
/*
- * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
if ( e == NULL ) {
char *matched_dn = NULL;
- struct berval **refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
- (long) op->o_tag, dn, matched_dn );
+ (long) op->o_tag, dn->bv_val, matched_dn );
if( is_entry_referral( matched ) ) {
rc = LDAP_OTHER;
/* send referrals */
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- ber_bvecfree( refs );
+ ber_bvarray_free( refs );
} else if ( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc, matched_dn,
matched_dn ? "bad referral object" : NULL,
if ( is_entry_referral( e ) ) {
/* entry is a referral */
- struct berval **refs = get_entry_referrals( be,
- conn, op, e );
- struct berval **rrefs = referral_rewrite(
+ BerVarray refs = get_entry_referrals( be, conn, op, e );
+ BerVarray rrefs = referral_rewrite(
refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT );
Debug( LDAP_DEBUG_TRACE,
if( rrefs != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, rrefs, NULL );
- ber_bvecfree( rrefs );
+ ber_bvarray_free( rrefs );
} else {
send_ldap_result( conn, op, rc = LDAP_OTHER, e->e_dn,
"bad referral object", NULL, NULL );
}
- ber_bvecfree( refs );
+ ber_bvarray_free( refs );
}
bdb_entry_return( be, e );