aliased_dn = ch_strdup( cargv[2] );
(void) dn_normalize( aliased_dn );
- charray_add( &be->be_suffixAlias, alias );
- charray_add( &be->be_suffixAlias, aliased_dn );
-
- free(alias);
- free(aliased_dn);
+ ber_bvecadd( &be->be_suffixAlias,
+ ber_bvstr( alias ) );
+ ber_bvecadd( &be->be_suffixAlias,
+ ber_bvstr( aliased_dn ) );
}
/* set max deref depth */
/* these should be renamed from be_ to bd_ */
char **be_suffix; /* the DN suffixes of data in this backend */
struct berval **be_nsuffix; /* the normalized DN suffixes in this backend */
- char **be_suffixAlias; /* pairs of DN suffix aliases and deref values */
+ struct berval **be_suffixAlias; /* pairs of DN suffix aliases and deref values */
char *be_root_dn; /* the magic "root" dn for this db */
char *be_root_ndn; /* the magic "root" normalized dn for this db */
struct berval be_root_pw; /* the magic "root" password for this db */
be->be_suffixAlias != NULL && be->be_suffixAlias[i] != NULL;
i += 2 )
{
- int aliasLength = strlen (be->be_suffixAlias[i]);
+ int aliasLength = be->be_suffixAlias[i]->bv_len;
int diff = dnLength - aliasLength;
if ( diff < 0 ) {
/* XXX or an escaped separator... oh well */
}
- if (!strcmp(be->be_suffixAlias[i], &dn[diff])) {
+ if (!strcmp(be->be_suffixAlias[i]->bv_val, &dn[diff])) {
char *oldDN = dn;
- dn = ch_malloc( diff + strlen(be->be_suffixAlias[i+1]) + 1 );
+ dn = ch_malloc( diff + be->be_suffixAlias[i+1]->bv_len + 1 );
strncpy( dn, oldDN, diff );
- strcpy( &dn[diff], be->be_suffixAlias[i+1] );
+ strcpy( &dn[diff], be->be_suffixAlias[i+1]->bv_val );
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"suffix_alias: converted \"%s\" to \"%s\"\n",