summaryrefslogtreecommitdiff
path: root/source/tdb/tdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tdb/tdb.c')
-rw-r--r--source/tdb/tdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index c414ae0d310..34681ea78f2 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -1257,7 +1257,8 @@ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
/* Try to clean dead ones from old traverses */
current = tlock->off;
tlock->off = rec->next;
- if (do_delete(tdb, current, rec) != 0)
+ if (!tdb->read_only &&
+ do_delete(tdb, current, rec) != 0)
goto fail;
}
tdb_unlock(tdb, tlock->hash, F_WRLCK);