dbwrap_rbt: fix modifying the db during traverse
authorStefan Metzmacher <metze@samba.org>
Wed, 25 Nov 2015 08:22:08 +0000 (09:22 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 27 Nov 2015 09:10:18 +0000 (10:10 +0100)
commit0f46da08e160e6712e5282af14e1ec4012614fc7
treee61d5f4f8d4185a5392809b2ffb9fda2194d8d64
parent590507951fc514a679f44b8bfdd03c721189c3fa
dbwrap_rbt: fix modifying the db during traverse

We delete and add of records rebalace the tree, but our
traverse code doesn't handle that and skips records
randomly.

We maintain records in a linked list for now
in addition to the rbtree and use that list during
traverse.

This add a bit overhead, but at least it works reliable.
If someone finds a way to do reliable traverse with the
rebalanced tree, we can replace this commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/dbwrap/dbwrap_rbt.c