summaryrefslogtreecommitdiffstats
path: root/source/tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-06-20 14:48:36 +0000
committerAndrew Tridgell <tridge@samba.org>2003-06-20 14:48:36 +0000
commitf327c06108cd1a9146f4c24aa4274997be0b4fb4 (patch)
tree60dfca5b367a7b901f7c973af8fcb4963dd579e3 /source/tdb
parent81abfec7faf8675391d017c2e4160cd77a1ab157 (diff)
downloadsamba-f327c06108cd1a9146f4c24aa4274997be0b4fb4.tar.gz
samba-f327c06108cd1a9146f4c24aa4274997be0b4fb4.tar.xz
samba-f327c06108cd1a9146f4c24aa4274997be0b4fb4.zip
fixed a bug found by volker
when we are traversing a readonly dababase we should not try to cleanup the pending-delete records
Diffstat (limited to 'source/tdb')
-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);