fixed a bug found by volker
authorAndrew Tridgell <tridge@samba.org>
Fri, 20 Jun 2003 14:48:36 +0000 (14:48 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 20 Jun 2003 14:48:36 +0000 (14:48 +0000)
when we are traversing a readonly dababase we should not try to
cleanup the pending-delete records
(This used to be commit f327c06108cd1a9146f4c24aa4274997be0b4fb4)

source3/tdb/tdb.c

index c414ae0d3108ccaf12aa9165d171d14bc8127a90..34681ea78f28fea90617ad1699fae9e37abd7eef 100644 (file)
@@ -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);