svn commit: samba r19258 - in branches/SAMBA_4_0/source: scripting/libjs setup

abartlet at samba.org abartlet at samba.org
Fri Oct 13 01:35:54 GMT 2006


Author: abartlet
Date: 2006-10-13 01:35:52 +0000 (Fri, 13 Oct 2006)
New Revision: 19258

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19258

Log:
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

Added:
   branches/SAMBA_4_0/source/setup/provision_index.ldif
Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js
   branches/SAMBA_4_0/source/setup/provision_init.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===================================================================
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js	2006-10-12 21:03:28 UTC (rev 19257)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js	2006-10-13 01:35:52 UTC (rev 19258)
@@ -157,25 +157,8 @@
 */
 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 @@
 	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 @@
 		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");

Added: branches/SAMBA_4_0/source/setup/provision_index.ldif
===================================================================
--- branches/SAMBA_4_0/source/setup/provision_index.ldif	2006-10-12 21:03:28 UTC (rev 19257)
+++ branches/SAMBA_4_0/source/setup/provision_index.ldif	2006-10-13 01:35:52 UTC (rev 19258)
@@ -0,0 +1,16 @@
+dn: @INDEXLIST
+ at IDXATTR: name
+ at IDXATTR: sAMAccountName
+ at IDXATTR: objectSid
+ at IDXATTR: objectCategory
+ at IDXATTR: member
+ at IDXATTR: uidNumber
+ at IDXATTR: gidNumber
+ at IDXATTR: unixName
+ at IDXATTR: privilege
+ at IDXATTR: nCName
+ at IDXATTR: lDAPDisplayName
+ at IDXATTR: subClassOf
+ at IDXATTR: dnsRoot
+ at IDXATTR: nETBIOSName
+

Modified: branches/SAMBA_4_0/source/setup/provision_init.ldif
===================================================================
--- branches/SAMBA_4_0/source/setup/provision_init.ldif	2006-10-12 21:03:28 UTC (rev 19257)
+++ branches/SAMBA_4_0/source/setup/provision_init.ldif	2006-10-13 01:35:52 UTC (rev 19258)
@@ -1,19 +1,3 @@
-dn: @INDEXLIST
- at IDXATTR: name
- at IDXATTR: sAMAccountName
- at IDXATTR: objectSid
- at IDXATTR: objectCategory
- at IDXATTR: member
- at IDXATTR: uidNumber
- at IDXATTR: gidNumber
- at IDXATTR: unixName
- at IDXATTR: privilege
- at IDXATTR: nCName
- at IDXATTR: lDAPDisplayName
- at IDXATTR: subClassOf
- at IDXATTR: dnsRoot
- at IDXATTR: nETBIOSName
-
 dn: @ATTRIBUTES
 userPrincipalName: CASE_INSENSITIVE
 servicePrincipalName: CASE_INSENSITIVE



More information about the samba-cvs mailing list