/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2004-2009 The OpenLDAP Foundation.
+ * Copyright 2004-2012 The OpenLDAP Foundation.
* Portions Copyright 2005 Symas Corporation.
* All rights reserved.
*
ch_free( (*an)[i].an_name.bv_val );
do {
(*an)[i] = (*an)[i+1];
+ i++;
} while ( !BER_BVISNULL( &(*an)[i].an_name ));
}
return 0;
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
translucent_info *ov = on->on_bi.bi_private;
- const struct berval bv_exop_pwmod = BER_BVC(LDAP_EXOP_MODIFY_PASSWD);
Entry *e = NULL, *re = NULL;
BackendDB *db;
int rc = 0;
}
static int translucent_exop(Operation *op, SlapReply *rs) {
- SlapReply nrs = { REP_RESULT };
-
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
translucent_info *ov = on->on_bi.bi_private;
const struct berval bv_exop_pwmod = BER_BVC(LDAP_EXOP_MODIFY_PASSWD);
if ( tc->step & USE_LIST ) {
re = tavl_delete( &tc->list, le, entry_dn_cmp );
if ( re ) {
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry( op, rs, on );
rc = test_filter( op, re, tc->orig );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_flags |= REP_ENTRY_MUSTBEFREED;
rc = overlay_entry_get_ov(op, &rs->sr_entry->e_nname, NULL, NULL, 0, &le, on);
if ( rc == LDAP_SUCCESS && le ) {
re = entry_dup( rs->sr_entry );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry( op, rs, on );
} else {
le = NULL;
}
}
/* Dispose of local entry */
if ( tc->step & LCL_SIDE ) {
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry(op, rs, on);
} else {
overlay_entry_release_ov(op, le, 0, on);
}
av = tavl_end( tc.list, TAVL_DIR_LEFT );
while ( av ) {
rs->sr_entry = av->avl_data;
- rc = test_filter( op, rs->sr_entry, op->ors_filter );
- if ( rc == LDAP_COMPARE_TRUE ) {
+ if ( rc == LDAP_SUCCESS && LDAP_COMPARE_TRUE ==
+ test_filter( op, rs->sr_entry, op->ors_filter ))
+ {
rs->sr_flags = REP_ENTRY_MUSTBEFREED;
rc = send_search_entry( op, rs );
- if ( rc ) break;
} else {
entry_free( rs->sr_entry );
}
av = tavl_next( av, TAVL_DIR_RIGHT );
}
tavl_free( tc.list, NULL );
+ rs->sr_flags = 0;
rs->sr_entry = NULL;
}
send_ldap_result( op, rs );
backend_stopdown_one( &ov->db );
}
+ ldap_pvt_thread_mutex_destroy( &ov->db.be_pcl_mutex );
ch_free(ov);
on->on_bi.bi_private = NULL;
}