summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdb/common/traverse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/tdb/common/traverse.c b/source4/lib/tdb/common/traverse.c
index 335dce4152..f8315f5770 100644
--- a/source4/lib/tdb/common/traverse.c
+++ b/source4/lib/tdb/common/traverse.c
@@ -220,6 +220,10 @@ int tdb_traverse(struct tdb_context *tdb,
{
struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
int ret;
+
+ if (tdb->read_only) {
+ return tdb_traverse_read(tdb, fn, private);
+ }
if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 0) == -1) {
TDB_LOG((tdb, 0, "tdb_traverse: failed to get transaction lock\n"));