>From fc8bfeec8c0b25188c11e508c7d0a6444c19f0d1 Mon Sep 17 00:00:00 2001 From: Rowland Penny Date: Thu, 2 Jun 2016 16:17:34 +0100 Subject: [PATCH 3/5] samba-tool domain provision, check length of NetBIOS domain name. This fixes bug 11925 Signed-off-by: Rowland Penny --- python/samba/netcmd/domain.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index b2dd0be..59e8929 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -345,6 +345,10 @@ class cmd_domain_provision(Command): if domain is None: raise CommandError("No domain set!") + if len(domain) > 15: + raise CommandError("The maximum length of the NetBIOS domain \ +name is 15 characters") + if realm == domain: raise CommandError("The NetBIOS domain name cannot be the same \ as the realm") @@ -377,6 +381,9 @@ as the realm") raise CommandError("You must supply the realm name!") if domain is None: raise CommandError("You must supply the NetBIOS domain name!") + if len(domain) > 15: + raise CommandError("The maximum length of the NetBIOS domain \ +name is 15 characters") if realm == domain: raise CommandError("The NetBIOS domain name cannot be the same \ as the realm") -- 1.7.10.4