From 151e30e18aea131291bc53f167378192165bb89c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Oct 2006 08:32:58 +0000 Subject: r19252: - fixed 'erase' argument to setup_ldb() - when wiping a ldb, wipe within each naming context first. By not wiping the naming contexts we didn't wipe the partitions, which caused a massive slowdown in re-provisioning due to re-indexing of the schema. (This used to be commit b62437214cf7c98c81598c4f37c91ab284928dbb) --- source4/scripting/libjs/provision.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index c20453a74d..e020cc41bd 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -157,7 +157,24 @@ function ldb_delete(ldb) */ function ldb_erase(ldb) { - var attrs = new Array("dn"); + var attrs = new Array("namingContexts"); + var res; + + /* delete within each naming context - this copes with existing partitions */ + res = ldb.search("objectClass=*", "", ldb.SCOPE_BASE, attrs); + if (typeof(res) != "undefined") { + if (res.length > 0) { + var names = res[0].namingContexts; + for (i=0;i