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)
*/
function ldb_erase(ldb)
{
*/
function ldb_erase(ldb)
{
- var attrs = new Array("namingContexts");
- /* 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");
/* delete the specials */
ldb.del("@INDEXLIST");
ldb.del("@ATTRIBUTES");
setup_add_ldif("provision.ldif", info, samdb, false);
if (blank != false) {
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");
var commit_ok = samdb.transaction_commit();
if (!commit_ok) {
info.message("ldb commit failed: " + samdb.errstring() + "\n");
+ 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");
var commit_ok = samdb.transaction_commit();
if (!commit_ok) {
info.message("samdb commit failed: " + samdb.errstring() + "\n");
--- /dev/null
+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: @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
dn: @ATTRIBUTES
userPrincipalName: CASE_INSENSITIVE
servicePrincipalName: CASE_INSENSITIVE