summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-01-15 16:24:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:12 -0500
commit5d91a37002ce4e656100f63368807796c84cdc24 (patch)
tree94c0f6aa46bd9ce8a6b5b1ee4ea574b13dee0223
parentba07f94438560830f9b4470ecd9577b8333475bf (diff)
downloadsamba-5d91a37002ce4e656100f63368807796c84cdc24.tar.gz
samba-5d91a37002ce4e656100f63368807796c84cdc24.tar.bz2
samba-5d91a37002ce4e656100f63368807796c84cdc24.zip
r12947: added some error checking that I stumbled across while testing domain migration
(This used to be commit c7951d17b1c4f53dd710d6a0fcf87ce678be3ff1)
-rw-r--r--source4/scripting/libjs/provision.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index 59bc9cac30..ef6fe31285 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -526,6 +526,8 @@ function valid_netbios_name(name)
function provision_validate(subobj, message)
{
+ var lp = loadparm_init();
+
if (!valid_netbios_name(subobj.DOMAIN)) {
message("Invalid NetBIOS name for domain\n");
return false;
@@ -536,6 +538,19 @@ function provision_validate(subobj, message)
return false;
}
+
+ if (lp.get("workgroup") != subobj.DOMAIN) {
+ message("workgroup '%s' in smb.conf must match chosen domain '%s'\n",
+ lp.get("workgroup"), subobj.DOMAIN);
+ return false;
+ }
+
+ if (lp.get("realm") != subobj.REALM) {
+ message("realm '%s' in smb.conf must match chosen realm '%s'\n",
+ lp.get("realm"), subobj.REALM);
+ return false;
+ }
+
return true;
}
@@ -547,7 +562,7 @@ function join_domain(domain, netbios_name, join_type, creds, message)
joindom.join_type = join_type;
joindom.netbios_name = netbios_name;
if (!ctx.JoinDomain(joindom)) {
- message("Domain Join failed: " + join.error_string);
+ message("Domain Join failed: " + joindom.error_string);
return false;
}
return true;