From fcd16eab6c9cbba05f3e2719527ed217d816d75c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Oct 2009 11:14:36 +1100 Subject: [PATCH] s4-ldb: delete empty index records --- source4/lib/ldb/ldb_tdb/ldb_index.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index c02e74b61db..8578e06c0de 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -199,6 +199,14 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn, struct ldb_message *msg; int ret; + if (list->count == 0) { + ret = ltdb_delete_noindex(module, dn); + if (ret == LDB_ERR_NO_SUCH_OBJECT) { + return LDB_SUCCESS; + } + return ret; + } + msg = ldb_msg_new(module); if (!msg) { ldb_module_oom(module); -- 2.11.4.GIT