git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ed2a67
)
tdb: Do early RDONLY error check for tdb_delete
author
Volker Lendecke
<vl@samba.org>
Thu, 25 Oct 2018 13:59:48 +0000
(15:59 +0200)
committer
Jeremy Allison
<jra@samba.org>
Mon, 29 Oct 2018 22:36:25 +0000
(23:36 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tdb/common/tdb.c
patch
|
blob
|
history
diff --git
a/lib/tdb/common/tdb.c
b/lib/tdb/common/tdb.c
index 4e433c89e1e36cffcc05b28e5622bb5ae50f6987..2a6d8977002168d58ae35026bd711f68a85548a6 100644
(file)
--- a/
lib/tdb/common/tdb.c
+++ b/
lib/tdb/common/tdb.c
@@
-463,6
+463,11
@@
static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
struct tdb_record rec;
int ret;
+ if (tdb->read_only || tdb->traverse_read) {
+ tdb->ecode = TDB_ERR_RDONLY;
+ return -1;
+ }
+
rec_ptr = tdb_find_lock_hash(tdb, key, hash, F_WRLCK, &rec);
if (rec_ptr == 0) {
return -1;