rem: var ldif = upgrade_sam_account(samba3.samaccounts[i],subobj.BASEDN); 
add: var ldif = upgrade_sam_account(samdb,samba3.samaccounts[i],subobj.BASEDN,subobj.DOMAINSID); 
context: function upgrade(subobj, samba3, message, paths){	var ret = 0;	var lp = loadparm_init();	var samdb = ldb_init();	var ok = samdb.connect(paths.samdb);	assert(ok);	message("Writing configuration\n");	var newconf = upgrade_smbconf(samba3.configuration,true);	newconf.save(paths.smbconf);	message("Importing account policies\n");	var ldif = upgrade_sam_policy(samba3,subobj.BASEDN);	ok = samdb.modify(ldif);	assert(ok);	message("Importing users\n");	for (var i in samba3.samaccounts) {		var msg = "... " + samba3.samaccounts[i].username;		var ldif = upgrade_sam_account(samba3.samaccounts[i],subobj.BASEDN);		ok = samdb.add(ldif);		if (!ok) { 			msg = msg + "... error: " + samdb.errstring();			ret = ret + 1; 		}		message(msg + "\n");	}	message("Importing groups\n");	for (var i in samba3.groupmappings) {		var msg = "... " + samba3.groupmappings[i].nt_name;		var ldif = upgrade_sam_group(samba3.groupmappings[i],subobj.BASEDN);		ok = samdb.add(ldif);		if (!ok) { 			msg = msg + "... error: " + samdb.errstring();			ret = ret + 1; 		}		message(msg + "\n");	}	message("Importing registry data\n");	var hives = new Array("hkcr","hkcu","hklm","hkpd","hku","hkpt"); 	for (var i in hives) {		var hn = hives[i];		message("... " + hn + "\n");		var regdb = ldb_init();		ok = regdb.connect(paths[hn]);		assert(ok);		var ldif = upgrade_registry(samba3.registry, hn, regdb);		for (var j in ldif) {			var msg = "... ... " + j;			ok = regdb.add(ldif[j]);			if (!ok) { 				msg = msg + "... error: " + regdb.errstring();				ret = ret + 1; 			}			message(msg + "\n");		}	}	message("Importing WINS data\n");	var winsdb = ldb_init();	ok = winsdb.connect(paths.winsdb);	assert(ok);	ldb_erase(winsdb);	var ldif = upgrade_wins(samba3);	ok = winsdb.add(ldif);	assert(ok);	// figure out ldapurl, if applicable	var ldapurl = undefined;	var pdb = samba3.configuration.get_list("passdb backend");	if (pdb != undefined) {		for (var b in pdb) {			if (substr(pdb[b], 0, 7) == "ldapsam") {				ldapurl = substr(pdb[b], 8);			}		}	}	// URL was not specified in passdb backend but ldap /is/ used	if (ldapurl == "") {		ldapurl = "ldap://" + samba3.configuration.get("ldap server");	}	// Enable samba3sam module if original passdb backend was ldap	if (ldapurl != undefined) {		message("Enabling Samba3 LDAP mappings for SAM database\n");		var ldif = sprintf("dn: @MAP=samba3sam@MAP_URL: %s", ldapurl);		ok = samdb.add(ldif);		assert(ok);		ok = samdb.modify("dn: @MODULESreplace: @LIST@LIST: samldb,timestamps,objectguid,rdn_name,samba3sam");		assert(ok);	}	return ret;}function upgrade_verify(subobj, samba3,paths,message){	message("Verifying account policies\n");	var samldb = ldb_init();	var ne = 0;	var ok = samldb.connect(paths.samdb);	assert(ok);		// FIXME}
meta: 5771	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5771/05db3024ba6a8cd0b3182595f4f6f2f1f0987e44/upgrade.js/buggy/source4/scripting/libjs/upgrade.js