>From 1504d00b28effaf74b981b7755dbb116cad0a277 Mon Sep 17 00:00:00 2001 From: Rowland Penny Date: Mon, 6 Jun 2016 16:05:29 +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 0ca4c7f..130a3b9 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -348,6 +348,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") @@ -382,6 +386,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