rem: var basedn = res[0].namingContexts[j]; 
add: var basedn = res.msgs[0].namingContexts[j]; 
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);	assert(typeof(res) != "undefined");	assert(res.length == 1);	if (typeof(res[0].namingContexts) == "undefined") {		return;	}		for (j=0; j<res[0].namingContexts.length; j++) {		var anything = "(|(objectclass=*)(dn=*))";		var attrs = new Array("dn");		var basedn = res[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 (typeof(res2) == "undefined") {				info.message("ldb search failed: " + ldb.errstring() + "\n");				continue;			}			previous_remaining = current_remaining;			current_remaining = res2.length;			for (i=0;i<res2.length;i++) {				ldb.del(res2[i].dn);			}						var res3 = ldb.search(anything, basedn, ldb.SCOPE_SUBTREE, attrs);			if (typeof(res3) == "undefined") {				info.message("ldb search failed: " + ldb.errstring() + "\n");				continue;			}			if (res3.length != 0) {				info.message("Failed to delete all records under " + basedn + ", " + res3.length + " records remaining\n");			}		}	}}
meta: 1392	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1392/7ca399c0755e186508a4ed9796cbbbe6f50181e9/provision.js/buggy/source4/scripting/libjs/provision.js