}
if ( !BER_BVISNULL( &p.e_nname ) ) {
- entry_clean( &p );
+ backsql_entry_clean( op, &p );
}
Debug( LDAP_DEBUG_TRACE, "<==backsql_add(\"%s\"): %d \"%s\"\n",
}
if ( !BER_BVISNULL( &e.e_nname ) ) {
- entry_clean( &e );
+ backsql_entry_clean( op, &e );
}
if ( bsi.bsi_attrs != NULL ) {
}
if ( !BER_BVISNULL( &e.e_nname ) ) {
- entry_clean( &e );
+ backsql_entry_clean( op, &e );
}
if ( bsi.bsi_attrs != NULL ) {
}
if ( !BER_BVISNULL( &d.e_nname ) ) {
- entry_clean( &d );
+ backsql_entry_clean( op, &d );
}
if ( !BER_BVISNULL( &p.e_nname ) ) {
- entry_clean( &p );
+ backsql_entry_clean( op, &p );
}
return rs->sr_err;
&bsi->bsi_oc->bom_oc->soc_cname,
bsi->bsi_op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
- entry_clean( bsi->bsi_e );
+ backsql_entry_clean( op, bsi->bsi_e );
return rc;
}
"structural_class() failed %d (%s)\n",
bsi->bsi_e->e_name.bv_val,
rc, text ? text : "" );
- entry_clean( bsi->bsi_e );
+ backsql_entry_clean( op, bsi->bsi_e );
return rc;
}
"to entry\n",
bsi->bsi_e->e_name.bv_val, soc.bv_val,
bsi->bsi_oc->bom_oc->soc_cname.bv_val );
- entry_clean( bsi->bsi_e );
+ backsql_entry_clean( op, bsi->bsi_e );
return rc;
}
}
&bsi->bsi_oc->bom_oc->soc_cname,
bsi->bsi_op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
- entry_clean( bsi->bsi_e );
+ backsql_entry_clean( op, bsi->bsi_e );
return rc;
}
}
bi->bi_chk_referrals = 0;
bi->bi_operational = backsql_operational;
bi->bi_entry_get_rw = backsql_entry_get;
+ bi->bi_entry_release_rw = backsql_entry_release;
bi->bi_connection_init = 0;
bi->bi_connection_destroy = backsql_connection_destroy;
if ( BACKSQL_CHECK_SCHEMA( bi ) ) {
char textbuf[ SLAP_TEXT_BUFLEN ] = { '\0' };
- entry_clean( &m );
+ backsql_entry_clean( op, &m );
bsi.bsi_e = &m;
rs->sr_err = backsql_id2entry( &bsi, &bsi.bsi_base_id );
}
if ( !BER_BVISNULL( &m.e_nname ) ) {
- entry_clean( &m );
+ backsql_entry_clean( op, &m );
}
if ( bsi.bsi_attrs != NULL ) {
if ( BACKSQL_CHECK_SCHEMA( bi ) ) {
char textbuf[ SLAP_TEXT_BUFLEN ] = { '\0' };
- entry_clean( &r );
+ backsql_entry_clean( op, &r );
(void)backsql_free_entryID( op, &e_id, 0 );
bsi.bsi_e = &r;
}
if ( !BER_BVISNULL( &r.e_nname ) ) {
- entry_clean( &r );
+ backsql_entry_clean( op, &r );
}
if ( !BER_BVISNULL( &p.e_nname ) ) {
- entry_clean( &p );
+ backsql_entry_clean( op, &p );
}
if ( !BER_BVISNULL( &n.e_nname ) ) {
- entry_clean( &n );
+ backsql_entry_clean( op, &n );
}
Debug( LDAP_DEBUG_TRACE, "<==backsql_modrdn()\n", 0, 0, 0 );
Operation *op, SlapReply *rs, AttributeName *attrs,
unsigned flags );
+void backsql_entry_clean( Operation *op, Entry *e );
+
/*
* sql-wrap.h
*/
extern BI_operational backsql_operational;
extern BI_entry_get_rw backsql_entry_get;
+extern BI_entry_release_rw backsql_entry_release;
extern BI_connection_destroy backsql_connection_destroy;
-DROP TABLE ldap_referrals;
DROP TABLE ldap_entry_objclasses;
DROP TABLE ldap_attr_mappings;
DROP TABLE ldap_entries;
DROP TABLE documents;
DROP TABLE authors_docs;
DROP TABLE phones;
+DROP TABLE referrals;
} else {
rs->sr_err = LDAP_OTHER;
}
- entry_clean( &user_entry2 );
+ backsql_entry_clean( op, &user_entry2 );
}
if ( bsi2.bsi_attrs != NULL ) {
op->o_tmpfree( bsi2.bsi_attrs,
next_entry:;
if ( e == &user_entry ) {
- entry_clean( &user_entry );
+ backsql_entry_clean( op, &user_entry );
}
next_entry2:;
send_ldap_result( op, rs );
}
- entry_clean( &base_entry );
+ backsql_entry_clean( op, &base_entry );
/* in case we got here accidentally */
- entry_clean( &user_entry );
+ backsql_entry_clean( op, &user_entry );
if ( rs->sr_v2ref ) {
ber_bvarray_free( rs->sr_v2ref );
return rc;
}
+void
+backsql_entry_clean(
+ Operation *op,
+ Entry *e )
+{
+ void *ctx;
+
+ ctx = ldap_pvt_thread_pool_context();
+
+ if ( ctx == NULL || ctx == op->o_tmpmemctx ) {
+ if ( !BER_BVISNULL( &e->e_name ) ) {
+ op->o_tmpfree( e->e_name.bv_val, op->o_tmpmemctx );
+ BER_BVZERO( &e->e_name );
+ }
+
+ if ( !BER_BVISNULL( &e->e_nname ) ) {
+ op->o_tmpfree( e->e_nname.bv_val, op->o_tmpmemctx );
+ BER_BVZERO( &e->e_nname );
+ }
+ }
+
+ entry_clean( e );
+}
+
+int
+backsql_entry_release(
+ Operation *op,
+ Entry *e,
+ int rw )
+{
+ backsql_entry_clean( op, e );
+
+ ch_free( e );
+
+ return 0;
+}