summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-10-13 01:35:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:58 -0500
commitd70fbdbefa321825998b5bf558c23733fb46425a (patch)
treec1e7b0b2930c0ac122b181c4ec4544474b85c231 /source4/scripting/libjs
parent6c4bc15f3b76ccfb154cababfccd443d83d2c28a (diff)
downloadsamba-d70fbdbefa321825998b5bf558c23733fb46425a.tar.gz
samba-d70fbdbefa321825998b5bf558c23733fb46425a.tar.bz2
samba-d70fbdbefa321825998b5bf558c23733fb46425a.zip
r19258: Don't delete the contents of the partitions twice, and in particular
don't delete their contents until we have specified the new partition locations. However, preserve the important part of tridge's change, that is to ensure that no database index is present when the mass delete occours. In my testing, it is best to leave the index until the provision is compleated. Andrew Bartlett (This used to be commit 962219df7dc53ce6f6889f4b71ee19850c7ff7b5)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r--source4/scripting/libjs/provision.js23
1 files changed, 6 insertions, 17 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index e020cc41bd..2dc6bb522b 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -157,25 +157,8 @@ function ldb_delete(ldb)
*/
function ldb_erase(ldb)
{
- 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<names.length;i++) {
- attrs = new Array("dn");
- res = ldb.search("(objectclass=*)", names[i], ldb.SCOPE_SUBTREE, attrs);
- var j;
- for (j=0;j<res.length;j++) {
- ldb.del(res[j].dn);
- }
- }
- }
- }
-
/* delete the specials */
ldb.del("@INDEXLIST");
ldb.del("@ATTRIBUTES");
@@ -528,6 +511,9 @@ function provision(subobj, message, blank, paths, session_info, credentials)
setup_add_ldif("provision.ldif", info, samdb, false);
if (blank != false) {
+ message("Setting up sam.ldb index\n");
+ setup_add_ldif("provision_index.ldif", info, samdb, false);
+
var commit_ok = samdb.transaction_commit();
if (!commit_ok) {
info.message("ldb commit failed: " + samdb.errstring() + "\n");
@@ -543,6 +529,9 @@ function provision(subobj, message, blank, paths, session_info, credentials)
return false;
}
+ message("Setting up sam.ldb index\n");
+ setup_add_ldif("provision_index.ldif", info, samdb, false);
+
var commit_ok = samdb.transaction_commit();
if (!commit_ok) {
info.message("samdb commit failed: " + samdb.errstring() + "\n");