mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 19:49:35 -05:00
ITS#7377 Catch mdb_put() to blocked/read-only txns
...early enough that txn state is left unchanged.
This commit is contained in:
parent
d7db12ad77
commit
4dea7d44fa
1 changed files with 3 additions and 0 deletions
|
|
@ -8602,6 +8602,9 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi,
|
|||
if (flags & ~(MDB_NOOVERWRITE|MDB_NODUPDATA|MDB_RESERVE|MDB_APPEND|MDB_APPENDDUP))
|
||||
return EINVAL;
|
||||
|
||||
if (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_BLOCKED))
|
||||
return (txn->mt_flags & MDB_TXN_RDONLY) ? EACCES : MDB_BAD_TXN;
|
||||
|
||||
mdb_cursor_init(&mc, txn, dbi, &mx);
|
||||
return mdb_cursor_put(&mc, key, data, flags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue