be->be_pending_csn_list = (struct be_pcl *)
ch_calloc( 1, sizeof( struct be_pcl ));
- build_new_dn( &be->be_context_csn, be->be_nsuffix,
- (struct berval *)&slap_ldapsync_cn_bv, NULL );
LDAP_TAILQ_INIT( be->be_pending_csn_list );
}
}
- ldap_pvt_thread_mutex_init( &syncrepl_rq.rq_mutex );
- LDAP_STAILQ_INIT( &syncrepl_rq.task_list );
- LDAP_STAILQ_INIT( &syncrepl_rq.run_list );
+ ldap_pvt_thread_mutex_init( &slapd_rq.rq_mutex );
+ LDAP_STAILQ_INIT( &slapd_rq.task_list );
+ LDAP_STAILQ_INIT( &slapd_rq.run_list );
/* open each backend database */
for( i = 0; i < nBackendDB; i++ ) {
LDAP_STAILQ_FOREACH( si, &backendDB[i].be_syncinfo, si_next ) {
si->si_be = &backendDB[i];
init_syncrepl( si );
- ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
- ldap_pvt_runqueue_insert( &syncrepl_rq,
+ ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+ ldap_pvt_runqueue_insert( &slapd_rq,
si->si_interval, do_syncrepl, (void *) si );
- ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
+ ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
}
}
}
struct slap_csn_entry *tmp_csne = csne;
LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
- ch_free( csne->ce_csn->bv_val );
- ch_free( csne->ce_csn );
+ ch_free( csne->ce_csn.bv_val );
csne = LDAP_TAILQ_NEXT( csne, ce_csn_link );
ch_free( tmp_csne );
}
if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
- if ( bd->be_context_csn.bv_val ) free( bd->be_context_csn.bv_val );
acl_destroy( bd->be_acl, frontendDB->be_acl );
}
free( backendDB );
/* destroy frontend database */
bd = frontendDB;
- if ( bd->bd_info->bi_db_destroy ) {
- bd->bd_info->bi_db_destroy( bd );
+ if ( bd ) {
+ if ( bd->bd_info->bi_db_destroy ) {
+ bd->bd_info->bi_db_destroy( bd );
+ }
+ ber_bvarray_free( bd->be_suffix );
+ ber_bvarray_free( bd->be_nsuffix );
+ if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
+ if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
+ if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
+ acl_destroy( bd->be_acl, frontendDB->be_acl );
}
- ber_bvarray_free( bd->be_suffix );
- ber_bvarray_free( bd->be_nsuffix );
- if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
- if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
- if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
- acl_destroy( bd->be_acl, frontendDB->be_acl );
return 0;
}
be->be_requires = frontendDB->be_requires;
be->be_ssf_set = frontendDB->be_ssf_set;
- be->be_context_csn.bv_len = 0;
- be->be_context_csn.bv_val = NULL;
be->be_pcl_mutexp = &be->be_pcl_mutex;
ldap_pvt_thread_mutex_init( be->be_pcl_mutexp );
Filter *filter;
Entry *user;
Backend *b2 = op->o_bd;
- void *o_private = op->o_private;
if ( target && dn_match( &target->e_nname, op_ndn ) ) {
user = target;
/* back-bdb stored lockinfo here, we saved it
* above. Clear it out so that a new lock can be used.
*/
- op->o_private = NULL;
op->o_bd = select_backend( op_ndn, 0, 0 );
rc = be_entry_get_rw(op, op_ndn, NULL, NULL, 0, &user );
}
}
if ( user != target ) {
be_entry_release_r( op, user );
- /* restore previous lockinfo, if any */
- op->o_private = o_private;
}
}
op->o_bd = b2;
/* Let the overlays have a chance at this */
be_orig = op->o_bd;
- op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
+ if ( SLAP_ISOVERLAY( be_orig ))
+ op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
if (( SLAP_OPATTRS( rs->sr_attr_flags ) || op->ors_attrs ) &&
op->o_bd && op->o_bd->be_operational != NULL )