projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7db12a
)
ITS#7377 Catch mdb_put() to blocked/read-only txns
author
Hallvard Furuseth
<hallvard@openldap.org>
Sun, 19 Jul 2015 19:44:02 +0000
(21:44 +0200)
committer
Hallvard Furuseth
<hallvard@openldap.org>
Sun, 19 Jul 2015 19:44:02 +0000
(21:44 +0200)
...early enough that txn state is left unchanged.
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index
532d94a
..
39d890e
100644
(file)
--- a/
libraries/liblmdb/mdb.c
+++ b/
libraries/liblmdb/mdb.c
@@
-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);
}