summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-22 11:14:36 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-22 12:47:54 +1100
commitfcd16eab6c9cbba05f3e2719527ed217d816d75c (patch)
tree38fa9dc2449b6a1a3df7f79e4f63c574d1d406a5 /source4/lib/ldb/ldb_tdb
parent936c8f311ac435a7d6cf2643c3dc4a9cbc9a79da (diff)
downloadsamba-fcd16eab6c9cbba05f3e2719527ed217d816d75c.tar.gz
samba-fcd16eab6c9cbba05f3e2719527ed217d816d75c.tar.bz2
samba-fcd16eab6c9cbba05f3e2719527ed217d816d75c.zip
s4-ldb: delete empty index records
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index c02e74b61d..8578e06c0d 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);