git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tdb: Do early RDONLY error check for tdb_delete
[samba.git]
/
lib
/
tdb
/
common
/
tdb.c
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;