summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/util.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 53b6c80c..ca14aee3 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -266,6 +266,9 @@ def validate_hostname(hostname, check_fqdn=True, allow_underscore=False):
if hostname.endswith('.'):
hostname = hostname[:-1]
+ if '..' in hostname:
+ raise ValueError(_('hostname contains empty label (consecutive dots)'))
+
if '.' not in hostname:
if check_fqdn:
raise ValueError(_('not fully qualified'))