mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ITS#7517 Don't save dropped dirty MDB databases.
mdb_txn_commit's attempt to save the DB could corrupt another DB if another thread had called mdb_dbi_open and reused the closed DBI.
This commit is contained in:
parent
8e1bbdf0dd
commit
c7db955a94
@ -7146,8 +7146,10 @@ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del)
|
||||
/* Can't delete the main DB */
|
||||
if (del && dbi > MAIN_DBI) {
|
||||
rc = mdb_del(txn, MAIN_DBI, &mc->mc_dbx->md_name, NULL);
|
||||
if (!rc)
|
||||
if (!rc) {
|
||||
txn->mt_dbflags[dbi] = DB_STALE;
|
||||
mdb_dbi_close(txn->mt_env, dbi);
|
||||
}
|
||||
} else {
|
||||
/* reset the DB record, mark it dirty */
|
||||
txn->mt_dbflags[dbi] |= DB_DIRTY;
|
||||
|
Loading…
Reference in New Issue
Block a user