diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-09-24 03:43:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:49 -0500 |
commit | 5860aef9cd53da572bef1b86a62a3a5e86da84b0 (patch) | |
tree | ceef07b8fdd5763db9077d157351f5bc58a3d761 /source4/lib/tdb/common/tdb.c | |
parent | 5a770bf72061e6b57f88e28fc585ff3c015ace49 (diff) | |
download | samba-5860aef9cd53da572bef1b86a62a3a5e86da84b0.tar.gz samba-5860aef9cd53da572bef1b86a62a3a5e86da84b0.tar.bz2 samba-5860aef9cd53da572bef1b86a62a3a5e86da84b0.zip |
r10465: separate out a read_only db from a read-only traversal to ensure we
don't end up doing a mmap read only
(This used to be commit 294ccfd46a0c4e1af9365d028acdabec03c41ad3)
Diffstat (limited to 'source4/lib/tdb/common/tdb.c')
-rw-r--r-- | source4/lib/tdb/common/tdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c index 2e229e88cc..4b0d4a31c5 100644 --- a/source4/lib/tdb/common/tdb.c +++ b/source4/lib/tdb/common/tdb.c @@ -164,7 +164,7 @@ int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct tdb_off_t last_ptr, i; struct list_struct lastrec; - if (tdb->read_only) return -1; + if (tdb->read_only || tdb->traverse_read) return -1; if (tdb_write_lock_record(tdb, rec_ptr) == -1) { /* Someone traversing here: mark it as dead */ @@ -227,7 +227,7 @@ int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag) char *p = NULL; int ret = 0; - if (tdb->read_only) { + if (tdb->read_only || tdb->traverse_read) { tdb->ecode = TDB_ERR_RDONLY; return -1; } |