summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/libjs/provision.js23
-rw-r--r--source4/setup/provision_index.ldif16
-rw-r--r--source4/setup/provision_init.ldif16
3 files changed, 22 insertions, 33 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");
diff --git a/source4/setup/provision_index.ldif b/source4/setup/provision_index.ldif
new file mode 100644
index 0000000000..2dd2e7d60f
--- /dev/null
+++ b/source4/setup/provision_index.ldif
@@ -0,0 +1,16 @@
+dn: @INDEXLIST
+@IDXATTR: name
+@IDXATTR: sAMAccountName
+@IDXATTR: objectSid
+@IDXATTR: objectCategory
+@IDXATTR: member
+@IDXATTR: uidNumber
+@IDXATTR: gidNumber
+@IDXATTR: unixName
+@IDXATTR: privilege
+@IDXATTR: nCName
+@IDXATTR: lDAPDisplayName
+@IDXATTR: subClassOf
+@IDXATTR: dnsRoot
+@IDXATTR: nETBIOSName
+
diff --git a/source4/setup/provision_init.ldif b/source4/setup/provision_init.ldif
index 8f4258ae1b..a3eb60ab94 100644
--- a/source4/setup/provision_init.ldif
+++ b/source4/setup/provision_init.ldif
@@ -1,19 +1,3 @@
-dn: @INDEXLIST
-@IDXATTR: name
-@IDXATTR: sAMAccountName
-@IDXATTR: objectSid
-@IDXATTR: objectCategory
-@IDXATTR: member
-@IDXATTR: uidNumber
-@IDXATTR: gidNumber
-@IDXATTR: unixName
-@IDXATTR: privilege
-@IDXATTR: nCName
-@IDXATTR: lDAPDisplayName
-@IDXATTR: subClassOf
-@IDXATTR: dnsRoot
-@IDXATTR: nETBIOSName
-
dn: @ATTRIBUTES
userPrincipalName: CASE_INSENSITIVE
servicePrincipalName: CASE_INSENSITIVE