ITS#7256 A few issues discovered during testing slapmodify.

- bdb deallocates cursor after some tool operations but expects it to be
  around every time it is called
- mdb tries to allocate a second transaction while it already holds one,
  deadlocking
- op->o_hdr must exist for most uses of op, but o_tmpmfuncs need not
- what about indexing after a tool modify? Does it happen automatically?
This commit is contained in:
Ondrej Kuznik 2012-04-23 16:58:20 +02:00 committed by Howard Chu
parent d3a5ab824d
commit 01f698bce9
2 changed files with 19 additions and 1 deletions

View file

@ -747,6 +747,15 @@ done:
e->e_id = NOID;
}
if ( cursor == NULL )
{
int rc = bdb->bi_id2entry->bdi_db->cursor(
bdb->bi_id2entry->bdi_db, bdb->bi_cache.c_txn, &cursor,
bdb->bi_db_opflags );
if ( rc != 0 )
e->e_id = NOID;
}
return e->e_id;
}
@ -982,6 +991,15 @@ done:
e->e_id = NOID;
}
if ( cursor == NULL )
{
int rc = bdb->bi_id2entry->bdi_db->cursor(
bdb->bi_id2entry->bdi_db, bdb->bi_cache.c_txn, &cursor,
bdb->bi_db_opflags );
if ( rc != 0 )
e->e_id = NOID;
}
return e->e_id;
}

View file

@ -245,7 +245,7 @@ int mdb_entry_return(
if ( !e )
return 0;
if ( e->e_private ) {
if ( op->o_hdr ) {
if ( op->o_hdr && op->o_tmpmfuncs ) {
op->o_tmpfree( e->e_nname.bv_val, op->o_tmpmemctx );
op->o_tmpfree( e->e_name.bv_val, op->o_tmpmemctx );
op->o_tmpfree( e, op->o_tmpmemctx );