1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00

r12947: added some error checking that I stumbled across while testing domain migration

This commit is contained in:
Andrew Tridgell 2006-01-15 16:24:55 +00:00 committed by Gerald (Jerry) Carter
parent 701558b5fe
commit c7951d17b1

View File

@ -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;