* multiple suffixes for a single backend won't work!
*/
bdb->bi_sufflen = strlen(be->be_suffix[0]);
- bdb->bi_nsufflen = strlen(be->be_nsuffix[0]);
- rdns = ldap_explode_dn(be->be_nsuffix[0], 0);
+ rdns = ldap_explode_dn(be->be_nsuffix[0]->bv_val, 0);
for (i=0; rdns[i]; i++);
bdb->bi_nrdns = i;
charray_free(rdns);
ldap_pvt_thread_rdwr_rlock(&bdb->bi_tree_rdwr);
o = bdb_find_id_node(id, bdb->bi_tree);
rlen = bdb->bi_sufflen + 1;
- nrlen = bdb->bi_nsufflen + 1;
+ nrlen = be->be_nsuffix[0]->bv_len + 1;
for (n = o; n; n=n->i_parent) {
rlen += n->i_rdn->rdn.bv_len + 1;
nrlen += n->i_rdn->nrdn.bv_len + 1;
ptr--;
nptr--;
strcpy(ptr, be->be_suffix[0]);
- strcpy(nptr, be->be_nsuffix[0]);
+ strcpy(nptr, be->be_nsuffix[0]->bv_val);
return 0;
}
monitor_defined++;
charray_add( &be->be_suffix, SLAPD_MONITOR_DN );
- charray_add( &be->be_nsuffix, SLAPD_MONITOR_NDN );
+ ber_bvecadd( &be->be_nsuffix, ber_bvstr( SLAPD_MONITOR_NDN ));
mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
if( !be_issuffix( be, parent ) ) {
int i;
for( i=0; be->be_nsuffix[i] != NULL; i++ ) {
- if( dn_issuffix( nbase, be->be_nsuffix[i] ) ) {
+ if( dn_issuffix( nbase, be->be_nsuffix[i]->bv_val ) ) {
matched = ch_strdup( be->be_suffix[i] );
break;
}
for ( j = 0; backends[i].be_nsuffix != NULL &&
backends[i].be_nsuffix[j] != NULL; j++ )
{
- len = strlen( backends[i].be_nsuffix[j] );
+ len = backends[i].be_nsuffix[j]->bv_len;
if ( len > dnlen ) {
/* suffix is longer than DN */
}
- if ( strcmp( backends[i].be_nsuffix[j], &dn[dnlen-len] ) == 0 ) {
+ if ( strcmp( backends[i].be_nsuffix[j]->bv_val, &dn[dnlen-len] ) == 0 ) {
if( be == NULL ) {
be = &backends[i];
)
{
int i;
+ int len = strlen(suffix);
for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i] != NULL; i++ ) {
- if ( strcmp( be->be_nsuffix[i], suffix ) == 0 ) {
+ if ( len != be->be_nsuffix[i]->bv_len ) {
+ continue;
+ }
+ if ( strcmp( be->be_nsuffix[i]->bv_val, suffix ) == 0 ) {
return( 1 );
}
}
} else {
char *dn = ch_strdup( cargv[1] );
+
if ( load_ucdata( NULL ) < 0 ) {
return( 1 );
}
return 1;
}
#endif /* USE_LDAP_DN_PARSING */
- charray_add( &be->be_nsuffix, dn );
- free( dn );
+ ber_bvecadd( &be->be_nsuffix, ber_bvstr( dn ));
}
/* set database suffixAlias */
/* these should be renamed from be_ to bd_ */
char **be_suffix; /* the DN suffixes of data in this backend */
- char **be_nsuffix; /* the normalized DN suffixes 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 */
char *be_root_dn; /* the magic "root" dn for this db */
char *be_root_ndn; /* the magic "root" normalized dn for this db */