rem: var modify_ok = setup_ldb_modify("provision_schema_basedn_modify.ldif", info, samdb); if (!modify_ok) { if (!add_ok) { 
add: var modify_schema_ok = setup_ldb_modify("provision_schema_basedn_modify.ldif", info, samdb); if (!modify_schema_ok) { if (!add_schema_ok) { 
context: function provision(subobj, message, blank, paths, session_info, credentials, ldapbackend){	var lp = loadparm_init();	var sys = sys_init();	var info = new Object();	var ok = provision_fix_subobj(subobj, paths);	assert(ok);	if (subobj.DOMAINGUID != undefined) {		subobj.DOMAINGUID_MOD = sprintf("replace: objectGUID\nobjectGUID: %s\n-", subobj.DOMAINGUID);	} else {		subobj.DOMAINGUID_MOD = "";	}	if (subobj.HOSTGUID != undefined) {		subobj.HOSTGUID_ADD = sprintf("objectGUID: %s", subobj.HOSTGUID);	} else {		subobj.HOSTGUID_ADD = "";	}	info.subobj = subobj;	info.message = message;	info.credentials = credentials;	info.session_info = session_info;	/* only install a new smb.conf if there isn't one there already */	var st = sys.stat(paths.smbconf);	if (st == undefined) {		var smbconfsuffix;		if (strlower(subobj.SERVERROLE) == strlower("domain controller")) {			smbconfsuffix = "dc";		} else if (strlower(subobj.SERVERROLE) == strlower("member server")) {			smbconfsuffix = "member";		} else {			smbconfsuffix = subobj.SERVERROLE;		}		message("Setting up " + paths.smbconf +"\n");		setup_file("provision.smb.conf." + smbconfsuffix, info.message, paths.smbconf, subobj);		lp.reload();	}	/* only install a new shares config db if there is none */	st = sys.stat(paths.shareconf);	if (st == undefined) {		message("Setting up share.ldb\n");		setup_ldb("share.ldif", info, paths.shareconf);	}	message("Setting up " + paths.secrets + "\n");	setup_ldb("secrets_init.ldif", info, paths.secrets);	setup_ldb("secrets.ldif", info, paths.secrets, false);	message("Setting up the registry\n");	var reg = reg_open();	reg.apply_patchfile(lp.get("setup directory") + "/provision.reg")	message("Setting up teplates into " + paths.templates + "\n");	setup_ldb("provision_templates.ldif", info, paths.templates);	message("Setting up sam.ldb partitions\n");	/* Also wipes the database */	setup_ldb("provision_partitions.ldif", info, paths.samdb);	var samdb = open_ldb(info, paths.samdb, false);	message("Setting up sam.ldb attributes\n");	setup_add_ldif("provision_init.ldif", info, samdb, false);	message("Setting up sam.ldb rootDSE\n");	setup_add_ldif("provision_rootdse_add.ldif", info, samdb, false);	message("Erasing data from partitions\n");	ldb_erase_partitions(info, samdb, ldapbackend);		// (hack) Reload, now we have the partitions and rootdse loaded.  	var commit_ok = samdb.transaction_commit();	if (!commit_ok) {		info.message("samdb commit failed: " + samdb.errstring() + "\n");		assert(commit_ok);	}	samdb.close();	samdb = open_ldb(info, paths.samdb, false);	message("Adding DomainDN: " + subobj.DOMAINDN + " (permitted to fail)\n");	var add_ok = setup_add_ldif("provision_basedn.ldif", info, samdb, true);	message("Modifying DomainDN: " + subobj.DOMAINDN + "\n");	var modify_ok = setup_ldb_modify("provision_basedn_modify.ldif", info, samdb);	if (!modify_ok) {		if (!add_ok) {			message("%s", "Failed to both add and modify " + subobj.DOMAINDN + " in target " + subobj.DOMAINDN_LDB + ": " + samdb.errstring() + "\n");			message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n"); 		};		assert(modify_ok);	};	message("Adding configuration container (permitted to fail)\n");	var add_ok = setup_add_ldif("provision_configuration_basedn.ldif", info, samdb, true);	message("Modifying configuration container\n");	var modify_ok = setup_ldb_modify("provision_configuration_basedn_modify.ldif", info, samdb);	if (!modify_ok) {		if (!add_ok) {			message("%s", "Failed to both add and modify " + subobj.CONFIGDN + " in target " + subobj.CONFIGDN_LDB + ": " + samdb.errstring() + "\n");			message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n"); 			assert(modify_ok);		}		assert(modify_ok);	}	message("Adding schema container (permitted to fail)\n");	var add_ok = setup_add_ldif("provision_schema_basedn.ldif", info, samdb, true);	message("Modifying schema container\n");	var modify_ok = setup_ldb_modify("provision_schema_basedn_modify.ldif", info, samdb);	if (!modify_ok) {		if (!add_ok) {			message("%s", "Failed to both add and modify " + subobj.SCHEMADN + " in target " + subobj.SCHEMADN_LDB + ": " + samdb.errstring() + "\n");			message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n"); 			assert(modify_ok);		}		message("Failed to modify the schema container: " + samdb.errstring() + "\n");		assert(modify_ok);	}	message("Setting up sam.ldb Samba4 schema\n");	setup_add_ldif("schema_samba4.ldif", info, samdb, false);	message("Setting up sam.ldb AD schema\n");	setup_add_ldif("schema.ldif", info, samdb, false);	// (hack) Reload, now we have the schema loaded.  	var commit_ok = samdb.transaction_commit();	if (!commit_ok) {		info.message("samdb commit failed: " + samdb.errstring() + "\n");		assert(commit_ok);	}	samdb.close();	samdb = open_ldb(info, paths.samdb, false);	message("Setting up sam.ldb configuration data\n");	setup_add_ldif("provision_configuration.ldif", info, samdb, false);	message("Setting up display specifiers\n");	setup_add_ldif("display_specifiers.ldif", info, samdb, false);	message("Adding users container (permitted to fail)\n");	var add_ok = setup_add_ldif("provision_users_add.ldif", info, samdb, true);	message("Modifying users container\n");	var modify_ok = setup_ldb_modify("provision_users_modify.ldif", info, samdb);	if (!modify_ok) {		if (!add_ok) {			message("Failed to both add and modify the users container\n");			assert(modify_ok);		}		assert(modify_ok);	}	message("Adding computers container (permitted to fail)\n");	var add_ok = setup_add_ldif("provision_computers_add.ldif", info, samdb, true);	message("Modifying computers container\n");	var modify_ok = setup_ldb_modify("provision_computers_modify.ldif", info, samdb);	if (!modify_ok) {		if (!add_ok) {			message("Failed to both add and modify the computers container\n");			assert(modify_ok);		}		assert(modify_ok);	}	message("Setting up sam.ldb data\n");	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);		message("Setting up sam.ldb rootDSE marking as syncronized\n");		setup_modify_ldif("provision_rootdse_modify.ldif", info, samdb, false);		var commit_ok = samdb.transaction_commit();		if (!commit_ok) {			info.message("ldb commit failed: " + samdb.errstring() + "\n");			assert(commit_ok);		}		return true;	}//	message("Activate schema module");//	setup_modify_ldif("schema_activation.ldif", info, samdb, false);////	// (hack) Reload, now we have the schema loaded.  //	var commit_ok = samdb.transaction_commit();//	if (!commit_ok) {//		info.message("samdb commit failed: " + samdb.errstring() + "\n");//		assert(commit_ok);//	}//	samdb.close();////	samdb = open_ldb(info, paths.samdb, false);//	message("Setting up sam.ldb users and groups\n");	setup_add_ldif("provision_users.ldif", info, samdb, false);	if (strlower(subobj.SERVERROLE) == strlower("domain controller")) {		message("Setting up self join\n");		setup_add_ldif("provision_self_join.ldif", info, samdb, false);		setup_add_ldif("provision_group_policy.ldif", info, samdb, false);		sys.mkdir(paths.sysvol, 0755);		sys.mkdir(paths.sysvol + "/"+ subobj.DNSDOMAIN, 0755);		sys.mkdir(paths.sysvol + "/"+ subobj.DNSDOMAIN + "/Policies", 0755);		sys.mkdir(paths.sysvol + "/"+ subobj.DNSDOMAIN + "/Policies/{" + subobj.POLICYGUID + "}", 0755);		sys.mkdir(paths.sysvol + "/"+ subobj.DNSDOMAIN + "/Policies/{" + subobj.POLICYGUID + "}/Machine", 0755);		sys.mkdir(paths.sysvol + "/"+ subobj.DNSDOMAIN + "/Policies/{" + subobj.POLICYGUID + "}/User", 0755);		sys.mkdir(paths.netlogon, 0755);		setup_ldb("secrets_dc.ldif", info, paths.secrets, false);	}	if (setup_name_mappings(info, samdb) == false) {		return false;	}	message("Setting up sam.ldb index\n");	setup_add_ldif("provision_index.ldif", info, samdb, false);	message("Setting up sam.ldb rootDSE marking as syncronized\n");	setup_modify_ldif("provision_rootdse_modify.ldif", info, samdb, false);	var commit_ok = samdb.transaction_commit();	if (!commit_ok) {		info.message("samdb commit failed: " + samdb.errstring() + "\n");		assert(commit_ok);	}	message("Setting up phpLDAPadmin configuration\n");	setup_file("phpldapadmin-config.php", info.message, paths.phpldapadminconfig, subobj);	message("Please install the phpLDAPadmin configuration located at " + paths.phpldapadminconfig + " into /etc/phpldapadmin/config.php\n");	return true;}
meta: 5771	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5771/bb07e5853149b7d3c1fee3c93cbcefb333038dbc/provision.js/clean/source4/scripting/libjs/provision.js