s4-ldb: cope better with corruption of tdb records
commitaf1e7e1c51d1ae60f52dd2d1a71ca33c90aa5b6e
authorAndrew Tridgell <tridge@samba.org>
Tue, 15 Sep 2009 17:00:24 +0000 (15 10:00 -0700)
committerAndrew Tridgell <tridge@samba.org>
Tue, 15 Sep 2009 18:48:12 +0000 (15 11:48 -0700)
tree1a7dba615c9a488129ed12043c1b75081479b30d
parent2e7841ff51107b0ccb65f19ea4c53d5a42cefb45
s4-ldb: cope better with corruption of tdb records

When doing an indexed search if we hit a corrupt record we abandoned
the indexed search and did a full search. The problem was that we
might have sent some records to the caller already, which means the
caller ended up with duplicate records. Fix this by returning a search
error if indexing returns an error and we have given any records to
the caller.
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_pack.c
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h