rem: info.message("ldb search failed: " + res.errstr + "\n"); 
add: info.message("ldb search failed: " + res3.errstr + "\n"); 
context: function ldb_erase_partitions(info, ldb, ldapbackend){	var rootDSE_attrs = new Array("namingContexts");	var lp = loadparm_init();	var j;	var res = ldb.search("(objectClass=*)", "", ldb.SCOPE_BASE, rootDSE_attrs);	if (res.error != 0) {		info.message("rootdse search failed: " + res.errstr + "\n");		assert(res.error == 0);	}	assert(res.msgs.length == 1);	if (typeof(res.msgs[0].namingContexts) == "undefined") {		return;	}		for (j=0; j<res.msgs[0].namingContexts.length; j++) {		var anything = "(|(objectclass=*)(dn=*))";		var attrs = new Array("dn");		var basedn = res.msgs[0].namingContexts[j];		var k;		var previous_remaining = 1;		var current_remaining = 0;		if (ldapbackend && (basedn == info.subobj.DOMAINDN)) {			/* Only delete objects that were created by provision */			anything = "(objectcategory=*)";		}		for (k=0; k < 10 && (previous_remaining != current_remaining); k++) {			/* and the rest */			var res2 = ldb.search(anything, basedn, ldb.SCOPE_SUBTREE, attrs);			var i;			if (res2.error != 0) {				info.message("ldb search failed: " + res.errstr + "\n");				continue;			}			previous_remaining = current_remaining;			current_remaining = res2.msgs.length;			for (i=0;i<res2.msgs.length;i++) {				ldb.del(res2.msgs[i].dn);			}						var res3 = ldb.search(anything, basedn, ldb.SCOPE_SUBTREE, attrs);			if (res3.error != 0) {				info.message("ldb search failed: " + res.errstr + "\n");				continue;			}			if (res3.msgs.length != 0) {				info.message("Failed to delete all records under " + basedn + ", " + res3.msgs.length + " records remaining\n");			}		}	}}
meta: 1914	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1914/c3c27fadc0a53f8d3de57bae1158a8b244742d72/provision.js/clean/source4/scripting/libjs/provision.js