svn commit: samba r23350 - in branches/SAMBA_4_0_RELEASE: source/scripting/libjs webapps/install

abartlet at samba.org abartlet at samba.org
Tue Jun 5 05:15:15 GMT 2007


Author: abartlet
Date: 2007-06-05 05:15:15 +0000 (Tue, 05 Jun 2007)
New Revision: 23350

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

Log:
Fix a nasty issue we had with SWAT.  We could not provision into a
different domain, as we didn't re-calcuate the DOMAINDN after the user
changed it in the form.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0_RELEASE/source/scripting/libjs/provision.js
   branches/SAMBA_4_0_RELEASE/webapps/install/provision.esp


Changeset:
Modified: branches/SAMBA_4_0_RELEASE/source/scripting/libjs/provision.js
===================================================================
--- branches/SAMBA_4_0_RELEASE/source/scripting/libjs/provision.js	2007-06-05 01:59:37 UTC (rev 23349)
+++ branches/SAMBA_4_0_RELEASE/source/scripting/libjs/provision.js	2007-06-05 05:15:15 UTC (rev 23350)
@@ -436,7 +436,7 @@
 	return true;
 }
 
-function provision_fix_subobj(subobj, message, paths)
+function provision_fix_subobj(subobj, paths)
 {
 	subobj.REALM       = strupper(subobj.REALM);
 	subobj.HOSTNAME    = strlower(subobj.HOSTNAME);
@@ -444,6 +444,19 @@
 	assert(valid_netbios_name(subobj.DOMAIN));
 	subobj.NETBIOSNAME = strupper(subobj.HOSTNAME);
 	assert(valid_netbios_name(subobj.NETBIOSNAME));
+	subobj.DNSDOMAIN    = strlower(subobj.REALM);
+	subobj.DNSNAME      = sprintf("%s.%s", 
+				      strlower(subobj.HOSTNAME), 
+				      subobj.DNSDOMAIN);
+	rdn_list = split(".", subobj.DNSDOMAIN);
+	subobj.DOMAINDN     = "DC=" + join(",DC=", rdn_list);
+	subobj.DOMAINDN_LDB = "users.ldb";
+	subobj.ROOTDN       = subobj.DOMAINDN;
+	subobj.CONFIGDN     = "CN=Configuration," + subobj.ROOTDN;
+	subobj.CONFIGDN_LDB = "configuration.ldb";
+	subobj.SCHEMADN     = "CN=Schema," + subobj.CONFIGDN;
+	subobj.SCHEMADN_LDB = "schema.ldb";
+
 	var rdns = split(",", subobj.DOMAINDN);
 	subobj.RDN_DC = substr(rdns[0], strlen("DC="));
 
@@ -461,7 +474,7 @@
 	var sys = sys_init();
 	var info = new Object();
 
-	var ok = provision_fix_subobj(subobj, message, paths);
+	var ok = provision_fix_subobj(subobj, paths);
 	assert(ok);
 
 	info.subobj = subobj;
@@ -511,7 +524,7 @@
 	var sys = sys_init();
 	var info = new Object();
 
-	var ok = provision_fix_subobj(subobj, message, paths);
+	var ok = provision_fix_subobj(subobj, paths);
 	assert(ok);
 
 	if (subobj.DOMAINGUID != undefined) {
@@ -714,7 +727,7 @@
 	var sys = sys_init();
 	var info = new Object();
 
-	var ok = provision_fix_subobj(subobj, message, paths);
+	var ok = provision_fix_subobj(subobj, paths);
 	assert(ok);
 
 	info.subobj = subobj;
@@ -787,6 +800,9 @@
 /* Write out a DNS zone file, from the info in the current database */
 function provision_ldapbase(subobj, message, paths)
 {
+	var ok = provision_fix_subobj(subobj, paths);
+	assert(ok);
+
 	message("Setting up LDAP base entry: " + subobj.DOMAINDN + " \n");
 	var rdns = split(",", subobj.DOMAINDN);
 	subobj.EXTENSIBLEOBJECT = "objectClass: extensibleObject";
@@ -850,19 +866,6 @@
 	subobj.BACKUP       = findnss(nss.getgrnam, "backup", "wheel", "root", "staff");
 	subobj.USERS        = findnss(nss.getgrnam, "users", "guest", "other", "unknown", "usr");
 
-	subobj.DNSDOMAIN    = strlower(subobj.REALM);
-	subobj.DNSNAME      = sprintf("%s.%s", 
-				      strlower(subobj.HOSTNAME), 
-				      subobj.DNSDOMAIN);
-	rdn_list = split(".", subobj.DNSDOMAIN);
-	subobj.DOMAINDN     = "DC=" + join(",DC=", rdn_list);
-	subobj.DOMAINDN_LDB = "users.ldb";
-	subobj.ROOTDN       = subobj.DOMAINDN;
-	subobj.CONFIGDN     = "CN=Configuration," + subobj.ROOTDN;
-	subobj.CONFIGDN_LDB = "configuration.ldb";
-	subobj.SCHEMADN     = "CN=Schema," + subobj.CONFIGDN;
-	subobj.SCHEMADN_LDB = "schema.ldb";
-
 	//Add modules to the list to activate them by default
 	//beware often order is important
 	//
@@ -892,6 +895,7 @@
 
 	subobj.EXTENSIBLEOBJECT = "# no objectClass: extensibleObject for local ldb";
 	subobj.ACI		= "# no aci for local ldb";
+
 	return subobj;
 }
 

Modified: branches/SAMBA_4_0_RELEASE/webapps/install/provision.esp
===================================================================
--- branches/SAMBA_4_0_RELEASE/webapps/install/provision.esp	2007-06-05 01:59:37 UTC (rev 23349)
+++ branches/SAMBA_4_0_RELEASE/webapps/install/provision.esp	2007-06-05 05:15:15 UTC (rev 23350)
@@ -16,7 +16,6 @@
 	lp.set("realm", lp.get("workgroup") + ".example.com");
 }
 
-
 var subobj = provision_guess();
 /* Don't supply default password for web interface */
 subobj.ADMINPASS = "";
@@ -47,10 +46,11 @@
 }
 
 if (form['submit'] == "Provision") {
+
         /* overcome an initially blank smb.conf */
 	lp.set("realm", subobj.REALM);
 	lp.set("workgroup", subobj.DOMAIN);
-	lp.reload()
+	lp.reload();
 	var goodpass = (subobj.CONFIRM == subobj.ADMINPASS);
 
 	if (!goodpass) {



More information about the samba-cvs mailing list