s4-join: give a clear error when using short domain form
authorAndrew Tridgell <tridge@samba.org>
Tue, 14 Sep 2010 08:28:27 +0000 (18:28 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 05:39:36 +0000 (15:39 +1000)
we now require the full domain name, for the DNS/CLDAP lookup

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/samba/netcmd/join.py

index ec8cd11122f6f4b0d0489b1ed9198f7f837d3ead..e7e5941c630b0c348be83effdfd3958f8c31caf0 100644 (file)
@@ -28,7 +28,7 @@ from samba.join import join_rodc
 class cmd_join(Command):
     """Joins domain as either member or backup domain controller [server connection needed]"""
 
-    synopsis = "%prog join <domain> [BDC | MEMBER | RODC] [options]"
+    synopsis = "%prog join <dnsdomain> [BDC | MEMBER | RODC] [options]"
 
     takes_optiongroups = {
         "sambaopts": options.SambaOptions,
@@ -57,6 +57,9 @@ class cmd_join(Command):
         if not role is None:
             role = role.upper()
 
+        if domain.find('.') == -1:
+            raise CommandError("Please use the full DNS domain name, not the short form for '%s'" % domain)
+
         if role is None:
             secure_channel_type = SEC_CHAN_WKSTA
         elif role == "BDC":