From 5860aef9cd53da572bef1b86a62a3a5e86da84b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 24 Sep 2005 03:43:02 +0000 Subject: 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) --- source4/lib/tdb/common/lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/lib/tdb/common/lock.c') diff --git a/source4/lib/tdb/common/lock.c b/source4/lib/tdb/common/lock.c index 7a76bd3d9b..703cfe9dc5 100644 --- a/source4/lib/tdb/common/lock.c +++ b/source4/lib/tdb/common/lock.c @@ -46,7 +46,7 @@ int tdb_brlock_len(struct tdb_context *tdb, tdb_off_t offset, return 0; } - if ((rw_type == F_WRLCK) && (tdb->read_only)) { + if ((rw_type == F_WRLCK) && (tdb->read_only || tdb->traverse_read)) { tdb->ecode = TDB_ERR_RDONLY; return -1; } @@ -161,7 +161,7 @@ int tdb_lockall(struct tdb_context *tdb) u32 i; /* There are no locks on read-only dbs */ - if (tdb->read_only) + if (tdb->read_only || tdb->traverse_read) return TDB_ERRCODE(TDB_ERR_LOCK, -1); for (i = 0; i < tdb->header.hash_size; i++) if (tdb_lock(tdb, i, F_WRLCK)) -- cgit